From caa9d0bd7851c3b8cc9064987109eed9952a7c90 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 26 Sep 2019 20:01:03 +0900 Subject: [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 --- lib/rubygems/package.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/rubygems') 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 -- cgit v1.2.3