зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Extract `SourceList#get_with_fallback`
https://github.com/rubygems/rubygems/commit/9dbc4757a8
This commit is contained in:
Родитель
27173e3735
Коммит
af40af45b2
|
@ -743,7 +743,7 @@ module Bundler
|
||||||
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
||||||
dep = @dependencies.find {|d| s.satisfies?(d) }
|
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)
|
next if @unlock[:sources].include?(s.source.name)
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,10 @@ module Bundler
|
||||||
source_list_for(source).find {|s| equivalent_source?(source, s) }
|
source_list_for(source).find {|s| equivalent_source?(source, s) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_with_fallback(source)
|
||||||
|
get(source) || default_source
|
||||||
|
end
|
||||||
|
|
||||||
def lock_sources
|
def lock_sources
|
||||||
lock_other_sources + lock_rubygems_sources
|
lock_other_sources + lock_rubygems_sources
|
||||||
end
|
end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче