[open-uri] cannot parse correctly a file with a dot inside the filename

I have some big issue in opening one file …

currently I am writing

require ‘open-uri’

io = open(URI.parse(thumbnail_url))
def io.original_filename; base_uri.path.split(’/’).last; end
io.original_filename.blank? ? nil : io

this one ( and similar) open very well
thumbnail_url = “http://video.vertexdigitalsports.com//sitehome/site41/

I get

but trying to open this one … ( there is a dot in the filename …
thumbnail_url = “http://video.vertexdigitalsports.com//sitehome/site41/

I get
#StringIO:0x0000010702e15 and this raises an exception in my app…

I tried to use 'addressable/uri)

require ‘addressable/uri’
uri = Addressable::URI.parse(thumbnail_url)
open(uri.normalize.to_s) {|f| p f.status } => [“200”, “OK”]
io = open(uri.normalize.to_s) {|f| f.read }
but this is not right …

what should I rather write ?

thanks for your feedback

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs