Skip to content

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)

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.