Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Zlib::GzipWriter.wrap in 1.9 mode accepts only one argument #552
It seems this was fixed once upon a time in http://jira.codehaus.org/browse/JRUBY-2405 but it seems that change was lost some time over the past five years.
This is related to rubygems/rubygems#472, so jruby users in 1.9 mode can't install gems with RubyGems 2.0.0.
Here is an example to reproduce with:
require 'stringio' require 'zlib' io = StringIO.new \ "\x1F\x8B\b\0ou-Q\0\x03\xCBH\xCD\xC9\xC9\a\0\x86\xA6\x106\x05\0\0\0" Zlib::GzipReader.wrap io, external_encoding: Encoding::UTF_8 do |gzio| puts gzio.read end
This should print "hello"
We just need to pass an optional external encoding. It should be straightforward.
http://jira.codehaus.org/browse/JRUBY-2405 changed the method from 2-args to 1-arg, by the way.