1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Extract SourceList#get_with_fallback

https://github.com/rubygems/rubygems/commit/9dbc4757a8
This commit is contained in:
David Rodríguez 2022-01-17 21:47:32 +01:00 committed by git
parent 27173e3735
commit af40af45b2
2 changed files with 5 additions and 1 deletions

View file

@ -743,7 +743,7 @@ module Bundler
# Replace the locked dependency's source with the equivalent source from the Gemfile
dep = @dependencies.find {|d| s.satisfies?(d) }
s.source = (dep && dep.source) || sources.get(s.source) || sources.default_source
s.source = (dep && dep.source) || sources.get_with_fallback(s.source)
next if @unlock[:sources].include?(s.source.name)

View file

@ -101,6 +101,10 @@ module Bundler
source_list_for(source).find {|s| equivalent_source?(source, s) }
end
def get_with_fallback(source)
get(source) || default_source
end
def lock_sources
lock_other_sources + lock_rubygems_sources
end