How to open a file name that looks like a URL after require open-uri?
How to open a file name that seems like a URL a开发者_JAVA百科fter require 'open-uri'
require 'open-uri'
open("http://google.com")
in folder
- http://google.com
According to ruby-doc.org, open-uri creates an alias to the original open
called open_uri_original_open
. You can use that method for enforcing opening local files.
But then, I'm not sure if you can really have filenames like http://google.com
in your OS/filesystem.
精彩评论