summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler.rb1
-rw-r--r--lib/bundler/incomplete_specification.rb24
-rw-r--r--lib/bundler/resolver/base.rb8
-rw-r--r--lib/bundler/spec_set.rb19
4 files changed, 13 insertions, 39 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index c46b835661..9e6a91c188 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -62,7 +62,6 @@ module Bundler
autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
autoload :Graph, File.expand_path("bundler/graph", __dir__)
- autoload :IncompleteSpecification, File.expand_path("bundler/incomplete_specification", __dir__)
autoload :Index, File.expand_path("bundler/index", __dir__)
autoload :Injector, File.expand_path("bundler/injector", __dir__)
autoload :Installer, File.expand_path("bundler/installer", __dir__)
diff --git a/lib/bundler/incomplete_specification.rb b/lib/bundler/incomplete_specification.rb
deleted file mode 100644
index addf7554d8..0000000000
--- a/lib/bundler/incomplete_specification.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- #
- # Represents a package name that was found to be incomplete when trying to
- # materialize a fresh resolution or the lockfile.
- #
- # Holds the actual partially complete set of specifications for the name.
- # These are used so that they can be unlocked in a future resolution, and fix
- # the situation.
- #
- class IncompleteSpecification
- attr_reader :name, :partially_complete_specs
-
- def initialize(name, partially_complete_specs = [])
- @name = name
- @partially_complete_specs = partially_complete_specs
- end
-
- def ==(other)
- partially_complete_specs == other.partially_complete_specs
- end
- end
-end
diff --git a/lib/bundler/resolver/base.rb b/lib/bundler/resolver/base.rb
index e9ff43960c..c6afa82056 100644
--- a/lib/bundler/resolver/base.rb
+++ b/lib/bundler/resolver/base.rb
@@ -34,11 +34,9 @@ module Bundler
@base[name]
end
- def delete(incomplete_specs)
- incomplete_specs.each do |incomplete_spec|
- incomplete_spec.partially_complete_specs.each do |spec|
- @base.delete(spec)
- end
+ def delete(specs)
+ specs.each do |spec|
+ @base.delete(spec)
end
end
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
index 2361fc356c..cf63c16a70 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -7,8 +7,11 @@ module Bundler
include Enumerable
include TSort
- def initialize(specs)
+ attr_reader :incomplete_specs
+
+ def initialize(specs, incomplete_specs = [])
@specs = specs
+ @incomplete_specs = incomplete_specs
end
def for(dependencies, check = false, platforms = [nil])
@@ -42,7 +45,7 @@ module Bundler
end
if incomplete && check
- specs << IncompleteSpecification.new(name, lookup[name])
+ @incomplete_specs += lookup[name].any? ? lookup[name] : [LazySpecification.new(name, nil, nil)]
end
end
@@ -81,7 +84,7 @@ module Bundler
def materialize(deps)
materialized = self.for(deps, true)
- SpecSet.new(materialized)
+ SpecSet.new(materialized, incomplete_specs)
end
# Materialize for all the specs in the spec set, regardless of what platform they're for
@@ -100,19 +103,17 @@ module Bundler
def incomplete_ruby_specs?(deps)
return false if @specs.empty?
- materialized = self.for(deps, true, [Gem::Platform::RUBY])
+ @incomplete_specs = []
+
+ self.for(deps, true, [Gem::Platform::RUBY])
- SpecSet.new(materialized).incomplete_specs.any?
+ @incomplete_specs.any?
end
def missing_specs
@specs.select {|s| s.is_a?(LazySpecification) }
end
- def incomplete_specs
- @specs.select {|s| s.is_a?(IncompleteSpecification) }
- end
-
def merge(set)
arr = sorted.dup
set.each do |set_spec|