End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Resolver::Molinillo::SpecificationProvider#sort_dependencies
sort_dependencies(dependencies, activated, conflicts)
lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb, line 93
def sort_dependencies(dependencies, activated, conflicts)
dependencies.sort_by do |dependency|
name = name_for(dependency)
[
activated.vertex_named(name).payload ? 0 : 1,
conflicts[name] ? 0 : 1,
]
end
end
Sort dependencies so that the ones that are easiest to resolve are first. Easiest to resolve is (usually) defined by:
1) Is this dependency already activated? 2) How relaxed are the requirements? 3) Are there any conflicts for this dependency? 4) How many possibilities are there to satisfy this dependency?
@param [Array<Object>] dependencies @param [DependencyGraph] activated the current dependency graph in the
resolution process.
@param [{String => Array<Conflict>}] conflicts @return [Array<Object>] a sorted copy of dependencies.