add_always_install(dependency)
public
Looks up the latest specification for dependency and adds it to
the always_install list.
# File lib/rubygems/resolver/installer_set.rb, line 53
def add_always_install(dependency)
request = Gem::Resolver::DependencyRequest.new dependency, nil
found = find_all request
found.delete_if { |s|
s.version.prerelease? and not s.local?
} unless dependency.prerelease?
found = found.select do |s|
Gem::Source::SpecificFile === s.source or
Gem::Platform::RUBY == s.platform or
Gem::Platform.local === s.platform
end
if found.empty?
exc = Gem::UnsatisfiableDependencyError.new request
exc.errors = errors
raise exc
end
newest = found.max_by do |s|
[s.version, s.platform == Gem::Platform::RUBY ? -1 : 1]
end
@always_install << newest.spec
end