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:
parent
27173e3735
commit
af40af45b2
2 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue