1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Always pass an encoding option to Zlib::GzipReader.wrap

The arity of this method has been -1 since the import, so the
option has been passed always, even if Zlib::GzipReader#initialize
does not take the option.  Actually it takes the option since 1.9.

https://github.com/rubygems/rubygems/commit/2fcde0f4e0
This commit is contained in:
Nobuyoshi Nakada 2019-09-26 20:01:03 +09:00
parent 39e8d5e1cd
commit caa9d0bd78
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -534,11 +534,7 @@ EOM
when 'metadata' then
@spec = Gem::Specification.from_yaml entry.read
when 'metadata.gz' then
opts = {}
opts[:external_encoding] = Encoding::UTF_8 if
Zlib::GzipReader.method(:wrap).arity != 1
Zlib::GzipReader.wrap(entry, **opts) do |gzio|
Zlib::GzipReader.wrap(entry, external_encoding: Encoding::UTF_8) do |gzio|
@spec = Gem::Specification.from_yaml gzio.read
end
end