开发者

How to open a file name that looks like a URL after require open-uri?

开发者 https://www.devze.com 2023-04-09 09:17 出处:网络
How to open a file name that seems like a URL a开发者_JAVA百科fter require \'open-uri\' 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

精彩评论

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