diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-26 20:01:03 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-05 10:50:01 +0900 |
commit | caa9d0bd7851c3b8cc9064987109eed9952a7c90 (patch) | |
tree | f52f25bf744a8d3caa238d35b503fd5470c82188 /lib/rubygems | |
parent | 39e8d5e1cdc25ca17f74da5e72ba87dcdfa4a602 (diff) |
[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
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/package.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index bef37aedc1..dadbf6a481 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -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 |