lib/solve/ruby_solver.rb in solve-4.0.2 vs lib/solve/ruby_solver.rb in solve-4.0.3

- old
+ new

@@ -169,12 +169,14 @@ # @return [Boolean] whether `requirement` is satisfied by `spec` in the # context of the current `activated` dependency graph. def requirement_satisfied_by?(requirement, activated, spec) version = spec.version return false unless requirement.constraint.satisfies?(version) + shared_possibility_versions = possibility_versions(requirement, activated) return false if !shared_possibility_versions.empty? && !shared_possibility_versions.include?(version) + true end # Searches the current dependency graph to find previously activated # requirements for the current artifact. @@ -259,10 +261,10 @@ rescue Molinillo::VersionConflict, Molinillo::CircularDependencyError => e raise Solve::Errors::NoSolutionError.new(e.message) end def build_sorted_solution(unsorted_solution) - nodes = Hash.new + nodes = {} unsorted_solution.each do |name, version| nodes[name] = @graph.artifact(name, version).dependencies.map(&:name) end # Modified from http://ruby-doc.org/stdlib-1.9.3/libdoc/tsort/rdoc/TSort.html