[#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 — [email protected]
Issue #10902 has been updated by Aman Gupta.
3 messages
2015/02/28
[ruby-core:68287] [Ruby trunk - Bug #10900] [Open] GzipReader does not define `#external_encoding`
From:
akostadinov@...
Date:
2015-02-24 16:27:47 UTC
List:
ruby-core #68287
Issue #10900 has been reported by Aleksandar Kostadinov.
----------------------------------------
Bug #10900: GzipReader does not define `#external_encoding`
https://bugs.ruby-lang.org/issues/10900
* Author: Aleksandar Kostadinov
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: 2.0.0p353
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Hello,
I want to store/load some **yaml** and other text data in gz for space efficiency. I thought it's most efficient to read/write directly to/from a gzip stream. But seems like the **GzipReader** io object does not support everything that a regular file io object does. I spotted the **#external_encoding** method. So for example to load YAML directly from gzip I use the following method:
~~~
def load_yaml_from_gz(gz)
loaded = nil
Zlib::GzipReader.open(gz) do |f|
class << f
def external_encoding
Encoding::UTF_8
end
end
loaded = YAML.load(f, gz)
end
return loaded
end
~~~
I need the monkey-patching because otherwise the YAML.load method fails for no **#external_encoding** method defined.
To avoid monkey patching just to read some text from a gzip archive I propose that GzipReader implements **#external_encoding** the same way as **File** does.
--
https://bugs.ruby-lang.org/