Skip to content

Commit 192e57d

Browse files
deivid-rodriguezhsbt
authored andcommitted
[rubygems/rubygems] Remove spec.source duplication
ruby/rubygems@24523a839e
1 parent 000f019 commit 192e57d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/bundler/runtime.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,14 @@ def cache(custom_path = nil, local = false)
130130

131131
specs_to_cache.each do |spec|
132132
next if spec.name == "bundler"
133-
next if spec.source.is_a?(Source::Gemspec)
134-
if spec.source.respond_to?(:migrate_cache)
135-
spec.source.migrate_cache(custom_path, local: local)
136-
elsif spec.source.respond_to?(:cache)
137-
spec.source.cache(spec, custom_path)
133+
134+
source = spec.source
135+
next if source.is_a?(Source::Gemspec)
136+
137+
if source.respond_to?(:migrate_cache)
138+
source.migrate_cache(custom_path, local: local)
139+
elsif source.respond_to?(:cache)
140+
source.cache(spec, custom_path)
138141
end
139142
end
140143

0 commit comments

Comments
 (0)