This method is only available on newer versions.
The first available version (v2_6_3) is shown here.
amount_constrained(dependency)
private
returns an integer in (-infty, 0] a number closer to 0 means the dependency
is less constraining
dependencies w/ 0 or 1 possibilities (ignoring version requirements) are
given very negative values, so they always sort first, before
dependencies that are unconstrained
# File lib/bundler/resolver.rb, line 235
def amount_constrained(dependency)
@amount_constrained ||= {}
@amount_constrained[dependency.name] ||= begin
if (base = @base[dependency.name]) && !base.empty?
dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
else
all = index_for(dependency).search(dependency.name).size
if all <= 1
all - 1_000_000
else
search = search_for(dependency)
search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? }
search - all
end
end
end
end