lib/rubygems/resolver.rb in rubygems-update-3.4.22 vs lib/rubygems/resolver.rb in rubygems-update-3.5.0
- old
+ new
@@ -36,23 +36,20 @@
attr_accessor :ignore_dependencies
##
# List of dependencies that could not be found in the configured sources.
- attr_reader :missing
-
attr_reader :stats
##
# Hash of gems to skip resolution. Keyed by gem name, with arrays of
# gem specifications as values.
attr_accessor :skip_gems
##
- # When a missing dependency, don't stop. Just go on and record what was
- # missing.
+ #
attr_accessor :soft_missing
##
# Combines +sets+ into a ComposedSet that allows specification lookup in a
@@ -104,20 +101,19 @@
@needed = needed
@development = false
@development_shallow = false
@ignore_dependencies = false
- @missing = []
@skip_gems = {}
@soft_missing = false
@stats = Gem::Resolver::Stats.new
end
def explain(stage, *data) # :nodoc:
return unless DEBUG_RESOLVER
- d = data.map {|x| x.pretty_inspect }.join(", ")
+ d = data.map(&:pretty_inspect).join(", ")
$stderr.printf "%10s %s\n", stage.to_s.upcase, d
end
def explain_list(stage) # :nodoc:
return unless DEBUG_RESOLVER
@@ -185,12 +181,11 @@
##
# Proceed with resolution! Returns an array of ActivationRequest objects.
def resolve
- locking_dg = Molinillo::DependencyGraph.new
- Molinillo::Resolver.new(self, self).resolve(@needed.map {|d| DependencyRequest.new d, nil }, locking_dg).tsort.map(&:payload).compact
+ Molinillo::Resolver.new(self, self).resolve(@needed.map {|d| DependencyRequest.new d, nil }).tsort.map(&:payload).compact
rescue Molinillo::VersionConflict => e
conflict = e.conflicts.values.first
raise Gem::DependencyResolutionError, Conflict.new(conflict.requirement_trees.first.first, conflict.existing, conflict.requirement)
ensure
@output.close if defined?(@output) && !debug?
@@ -226,11 +221,10 @@
end
def search_for(dependency)
possibles, all = find_possible(dependency)
if !@soft_missing && possibles.empty?
- @missing << dependency
exc = Gem::UnsatisfiableDependencyError.new dependency, all
exc.errors = @set.errors
raise exc
end
@@ -273,10 +267,9 @@
def name_for(dependency)
dependency.name
end
def allow_missing?(dependency)
- @missing << dependency
@soft_missing
end
def sort_dependencies(dependencies, activated, conflicts)
dependencies.sort_by.with_index do |dependency, i|