diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-01 12:45:11 +0300 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-01 13:50:41 +0300 |
commit | 56660de3c6df7a4ff8667ef4047d30d0de169935 (patch) | |
tree | dd1e526075687b4b24e089cee50eabc21a6143cc /lib/rubygems/remote_fetcher.rb | |
parent | 560cd5b1f04f30542a294b3d77527d3b12f7cc15 (diff) | |
download | ruby-56660de3c6df7a4ff8667ef4047d30d0de169935.tar.gz |
Merge rubygems master from upstream.
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
Diffstat (limited to 'lib/rubygems/remote_fetcher.rb')
-rw-r--r-- | lib/rubygems/remote_fetcher.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb index 32c65eada8..a40ee55273 100644 --- a/lib/rubygems/remote_fetcher.rb +++ b/lib/rubygems/remote_fetcher.rb @@ -173,7 +173,7 @@ class Gem::RemoteFetcher path = source_uri.path path = File.dirname(path) if File.extname(path) == '.gem' - remote_gem_path = correct_for_windows_path(File.join(path, 'gems', gem_file_name)) + remote_gem_path = Gem::Util.correct_for_windows_path(File.join(path, 'gems', gem_file_name)) FileUtils.cp(remote_gem_path, local_gem_path) rescue Errno::EACCES @@ -210,7 +210,7 @@ class Gem::RemoteFetcher # File Fetcher. Dispatched by +fetch_path+. Use it instead. def fetch_file(uri, *_) - Gem.read_binary correct_for_windows_path uri.path + Gem.read_binary Gem::Util.correct_for_windows_path uri.path end ## @@ -317,14 +317,6 @@ class Gem::RemoteFetcher response['content-length'].to_i end - def correct_for_windows_path(path) - if path[0].chr == '/' && path[1].chr =~ /[a-z]/i && path[2].chr == ':' - path[1..-1] - else - path - end - end - ## # Performs a Net::HTTP request of type +request_class+ on +uri+ returning # a Net::HTTP response object. request maintains a table of persistent |