[前][次][番号順一覧][スレッド一覧]

ruby-changes:58126

From: Nobuyoshi <ko1@a...>
Date: Sat, 5 Oct 2019 10:52:05 +0900 (JST)
Subject: [ruby-changes:58126] caa9d0bd78 (master): [rubygems/rubygems] Always pass an encoding option to Zlib::GzipReader.wrap

https://git.ruby-lang.org/ruby.git/commit/?id=caa9d0bd78

From caa9d0bd7851c3b8cc9064987109eed9952a7c90 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
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

diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb
index bef37ae..dadbf6a 100644
--- a/lib/rubygems/package.rb
+++ b/lib/rubygems/package.rb
@@ -534,11 +534,7 @@ EOM https://github.com/ruby/ruby/blob/trunk/lib/rubygems/package.rb#L534
     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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]