开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜