summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-12-17 00:53:45 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-20 13:15:02 +0900
commit829348956476fc395f267b3f4a20ea67546551b2 (patch)
tree42dd39033300368ccf042f2f5d23d8907ba248eb /lib
parentbeef72965e8d3e23bfc37a6da553d171357ec7f3 (diff)
[rubygems/rubygems] Slight tweak to error message building
Let Pub Grub decide how the constraint should be displayed. https://github.com/rubygems/rubygems/commit/4f651b6429
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6966
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/resolver.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 9d334326d1..82cf66cc6d 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -117,7 +117,8 @@ module Bundler
cause = PubGrub::Incompatibility::NoVersions.new(unsatisfied_term)
name = package.name
constraint = unsatisfied_term.constraint
- requirement = Gem::Requirement.new(constraint.constraint_string.split(","))
+ constraint_string = constraint.constraint_string
+ requirement = Gem::Requirement.new(constraint_string.split(","))
if name == "bundler"
custom_explanation = "the current Bundler version (#{Bundler::VERSION}) does not satisfy #{constraint}"
@@ -128,8 +129,7 @@ module Bundler
platforms_explanation = specs_matching_other_platforms.any? ? " for any resolution platforms (#{package.platforms.join(", ")})" : ""
custom_explanation = "#{constraint} could not be found in #{repository_for(package)}#{platforms_explanation}"
- dependency = Dependency.new(name, requirement)
- label = SharedHelpers.pretty_dependency(dependency)
+ label = "#{name} (#{constraint_string})"
extended_explanation = other_specs_matching_message(specs_matching_other_platforms, label) if specs_matching_other_platforms.any?
end