Line 0
Link Here
|
|
|
1 |
--- lib/rubygems/package.rb.orig 2020-02-18 06:58:15 UTC |
2 |
+++ lib/rubygems/package.rb |
3 |
@@ -486,7 +486,7 @@ EOM |
4 |
path = File.expand_path(path + File::SEPARATOR + basename) |
5 |
lstat = File.lstat path rescue nil |
6 |
if !lstat || !lstat.directory? |
7 |
- unless normalize_path(path).start_with? normalize_path(destination_dir) and (FileUtils.mkdir path, mkdir_options rescue false) |
8 |
+ unless normalize_path(path).start_with? normalize_path(destination_dir) and (FileUtils.mkdir path, **mkdir_options rescue false) |
9 |
raise Gem::Package::PathError.new(file_name, destination_dir) |
10 |
end |
11 |
end |
12 |
@@ -502,13 +502,9 @@ EOM |
13 |
when 'metadata' then |
14 |
@spec = Gem::Specification.from_yaml entry.read |
15 |
when 'metadata.gz' then |
16 |
- args = [entry] |
17 |
- args << { :external_encoding => Encoding::UTF_8 } if |
18 |
- Zlib::GzipReader.method(:wrap).arity != 1 |
19 |
- |
20 |
- Zlib::GzipReader.wrap(*args) do |gzio| |
21 |
+ Zlib::GzipReader.wrap(entry, external_encoding: Encoding::UTF_8) do |gzio| |
22 |
@spec = Gem::Specification.from_yaml gzio.read |
23 |
- end |
24 |
+ end |
25 |
end |
26 |
end |
27 |
|