summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2025-03-13 19:00:35 +0100
committerHiroshi SHIBATA <[email protected]>2025-03-24 13:25:07 +0900
commit192e57db31911af68e0033c59b0c58139ef237d6 (patch)
tree33e2e2ff93e151c27375e20f52aee16c82a6565e /lib/bundler
parent000f01977204ba677a4208a6682d12d2f1375e5d (diff)
[rubygems/rubygems] Remove `spec.source` duplication
https://github.com/rubygems/rubygems/commit/24523a839e
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12968
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/runtime.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index 1225eb9f50..444b085bed 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -130,11 +130,14 @@ module Bundler
specs_to_cache.each do |spec|
next if spec.name == "bundler"
- next if spec.source.is_a?(Source::Gemspec)
- if spec.source.respond_to?(:migrate_cache)
- spec.source.migrate_cache(custom_path, local: local)
- elsif spec.source.respond_to?(:cache)
- spec.source.cache(spec, custom_path)
+
+ source = spec.source
+ next if source.is_a?(Source::Gemspec)
+
+ if source.respond_to?(:migrate_cache)
+ source.migrate_cache(custom_path, local: local)
+ elsif source.respond_to?(:cache)
+ source.cache(spec, custom_path)
end
end