summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodriguez <deivid.rodriguez@riseup.net>2021-10-21 12:38:53 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-10-25 20:48:51 +0900
commit4fc29d17b36e12311c1fe1d2f63e463bbf8ad725 (patch)
tree347800f9ba56c7f349bd949f0133df51b25d5875
parent4edcda67b321de12d2fdc5005ff1230d8d0a0c3f (diff)
downloadruby-4fc29d17b36e12311c1fe1d2f63e463bbf8ad725.tar.gz
[rubygems/rubygems] Cached gem path resolution should consider default gems
https://github.com/rubygems/rubygems/commit/83b2b845b3
-rw-r--r--lib/bundler/source/rubygems.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index ae77f41753..a4587ac692 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -174,6 +174,7 @@ module Bundler
Bundler.ui.confirm message
path = cached_gem(spec)
+ raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
if requires_sudo?
install_path = Bundler.tmp(spec.full_name)
bin_path = install_path.join("bin")
@@ -233,11 +234,7 @@ module Bundler
end
def cache(spec, custom_path = nil)
- if spec.default_gem?
- cached_path = cached_built_in_gem(spec)
- else
- cached_path = cached_gem(spec)
- end
+ cached_path = cached_gem(spec)
raise GemNotFound, "Missing gem file '#{spec.file_name}'." unless cached_path
return if File.dirname(cached_path) == Bundler.app_cache.to_s
Bundler.ui.info " * #{File.basename(cached_path)}"
@@ -352,11 +349,11 @@ module Bundler
end
def cached_gem(spec)
- cached_gem = cached_path(spec)
- unless cached_gem
- raise Bundler::GemNotFound, "Could not find #{spec.file_name} for installation"
+ if spec.default_gem?
+ cached_built_in_gem(spec)
+ else
+ cached_path(spec)
end
- cached_gem
end
def cached_path(spec)