aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/source/rubygems.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-01-04 10:11:34 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-01-04 13:14:43 +0900
commit69ed64949b0c02d4b195809fa104ff23dd100093 (patch)
treec07abfd061a2da7610e252960c06a64e8b17e6c3 /lib/bundler/source/rubygems.rb
parent5537adf719a37a30b17d39111cc03700f353aa2d (diff)
downloadruby-69ed64949b0c02d4b195809fa104ff23dd100093.tar.gz
Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20
Diffstat (limited to 'lib/bundler/source/rubygems.rb')
-rw-r--r--lib/bundler/source/rubygems.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 97f9808578..79ad278da3 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -487,8 +487,15 @@ module Bundler
uri = spec.remote.uri
Bundler.ui.confirm("Fetching #{version_message(spec)}")
rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
+
+ # older rubygems return varying file:// variants depending on version
+ rubygems_local_path = rubygems_local_path.gsub(/\Afile:/, "") unless Bundler.rubygems.provides?(">= 3.2.0.rc.2")
+ rubygems_local_path = rubygems_local_path.gsub(%r{\A//}, "") if Bundler.rubygems.provides?("< 3.1.0")
+
if rubygems_local_path != local_path
- FileUtils.mv(rubygems_local_path, local_path)
+ SharedHelpers.filesystem_access(local_path) do
+ FileUtils.mv(rubygems_local_path, local_path)
+ end
end
cache_globally(spec, local_path)
end