зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Extract some common code into a private method
https://github.com/rubygems/rubygems/commit/d1be8cdb3a
This commit is contained in:
Родитель
d5b5a7ab31
Коммит
1260d22cae
|
@ -1006,9 +1006,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
# Return currently unresolved specs that contain the file matching +path+.
|
# Return currently unresolved specs that contain the file matching +path+.
|
||||||
|
|
||||||
def self.find_in_unresolved(path)
|
def self.find_in_unresolved(path)
|
||||||
specs = unresolved_deps.values.map {|dep| dep.to_specs }.flatten
|
unresolved_specs.find_all {|spec| spec.contains_requirable_file? path }
|
||||||
|
|
||||||
specs.find_all {|spec| spec.contains_requirable_file? path }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -1016,9 +1014,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
# specs that contain the file matching +path+.
|
# specs that contain the file matching +path+.
|
||||||
|
|
||||||
def self.find_in_unresolved_tree(path)
|
def self.find_in_unresolved_tree(path)
|
||||||
specs = unresolved_deps.values.map {|dep| dep.to_specs }.flatten
|
unresolved_specs.each do |spec|
|
||||||
|
|
||||||
specs.each do |spec|
|
|
||||||
spec.traverse do |from_spec, dep, to_spec, trail|
|
spec.traverse do |from_spec, dep, to_spec, trail|
|
||||||
if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail)
|
if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail)
|
||||||
:next
|
:next
|
||||||
|
@ -1031,6 +1027,11 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.unresolved_specs
|
||||||
|
unresolved_deps.values.map {|dep| dep.to_specs }.flatten
|
||||||
|
end
|
||||||
|
private_class_method :unresolved_specs
|
||||||
|
|
||||||
##
|
##
|
||||||
# Special loader for YAML files. When a Specification object is loaded
|
# Special loader for YAML files. When a Specification object is loaded
|
||||||
# from a YAML file, it bypasses the normal Ruby object initialization
|
# from a YAML file, it bypasses the normal Ruby object initialization
|
||||||
|
|
Загрузка…
Ссылка в новой задаче