instance method
Gem::Resolver::InstallerSet#find_all
find_all(req)
lib/rubygems/resolver/installer_set.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/resolver/installer_set.rb, line 135
def find_all(req)
res = []
dep = req.dependency
return res if @ignore_dependencies &&
@always_install.none? {|spec| dep.match? spec }
name = dep.name
dep.matching_specs.each do |gemspec|
next if @always_install.any? {|spec| spec.name == gemspec.name }
res << Gem::Resolver::InstalledSpecification.new(self, gemspec)
end unless @ignore_installed
matching_local = []
if consider_local?
matching_local = @local.values.select do |spec, _|
req.match? spec
end.map do |spec, source|
Gem::Resolver::LocalSpecification.new self, spec, source
end
res.concat matching_local
begin
if local_spec = @local_source.find_gem(name, dep.requirement)
res << Gem::Resolver::IndexSpecification.new(
self, local_spec.name, local_spec.version,
@local_source, local_spec.platform
)
end
rescue Gem::Package::FormatError
# ignore
end
end
res.concat @remote_set.find_all req if consider_remote? && matching_local.empty?
res
end
Returns an array of IndexSpecification objects matching DependencyRequest req.
See also
#errors
#metadata_satisfied?
#add_local
#prefetch
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0