ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:72344] [Ruby trunk - Feature #8544] OpenURI should open 'file://' URIs
@ 2015-12-18  4:13 Joseph Jones
  0 siblings, 0 replies; only message in thread
From: Joseph Jones @ 2015-12-18  4:13 UTC (permalink / raw)
  To: Ruby developers; +Cc: ruby-core

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

Joseph Jones liked your message with Boxer. On December 12, 2015 at 09:30:03 MST, bokov.vlad@gmail.com wrote:Issue #8544 has been updated by Vlad Bokov.I think the difference in #relative? #absolute? behaviour also points that absolute URI with "file://" should be "open"-able`> URI.parse('file:///root').absolute?=> false> URI.parse('/root').absolute?=> true`----------------------------------------Feature #8544: OpenURI should open 'file://' URIshttps://bugs.ruby-lang.org/issues/8544#change-55497* Author: Silas Davis* Status: Open* Priority: Normal* Assignee: ----------------------------------------The following code prints the contents of '/tmp/file.txt':require 'open-uri'open('/tmp/file.txt').read {|f| puts f.read }which although useful should probably fail since a unix file path is not a URI, and therefore might shield data problems in a systemHowever the following should produce the same output and is a URI, but fails:open('file:///tmp/file.txt').read {|f| puts f.read }I note that the documentation for open-uri does explain that it is a wrapper for http, https, and ftp, but to deserve its name it should open such URIs as specified in this RFC: http://tools.ietf.org/html/rfc1630. This coupled with the fact that it already does open files, but not by a URI specification.-- https://bugs.ruby-lang.org/     

[-- Attachment #2: Type: text/html, Size: 1780 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-18  3:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18  4:13 [ruby-core:72344] [Ruby trunk - Feature #8544] OpenURI should open 'file://' URIs Joseph Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).