[#68137] improve semantics of manpages — "Anthony J. Bentley" <anthony@...>
Hi,
1 message
2015/02/17
[#68144] Re: Future of test suites for Ruby — Anthony Crumley <anthony.crumley@...>
FYI...
4 messages
2015/02/17
[#68343] [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault? — ruby@...
Issue #10916 has been reported by why do i need this acct just to create a bug report.
5 messages
2015/02/27
[#68373] Re: [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault?
— "Martin J. Dürst" <duerst@...>
2015/03/02
> * Author: why do i need this acct just to create a bug report
[#68358] [Ruby trunk - Bug #10902] require("enumerator") scans LOAD_PATH 2x on every invocation — ruby@...1.net
Issue #10902 has been updated by Aman Gupta.
3 messages
2015/02/28
[ruby-core:68311] [Ruby trunk - Feature #8544] OpenURI should open 'file://' URIs
From:
mdub@...
Date:
2015-02-25 23:02:03 UTC
List:
ruby-core #68311
Issue #8544 has been updated by Mike Williams.
Here's a naive implementation of support for "file:"
require 'open-uri'
require 'uri'
module URI
class File < Generic
def open(*args, &block)
::File.open(self.path, &block)
end
end
@@schemes['FILE'] = File
end
----------------------------------------
Feature #8544: OpenURI should open 'file://' URIs
https://bugs.ruby-lang.org/issues/8544#change-51666
* 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 system
However 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/