summaryrefslogtreecommitdiff
path: root/lib/bundler/vendor/pub_grub
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2023-02-07 17:55:46 -0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-02-21 19:28:12 +0900
commit4064e3e7769d7cac03f817ede1c4a7d0f97b1ae0 (patch)
tree67a41183a16ce6a68320ab03a84944ecbd44ef7c /lib/bundler/vendor/pub_grub
parent80389915838fe235b5691391ba00e2733e31d93b (diff)
[rubygems/rubygems] Update pub_grub
* Replaces the wording of "is forbidden" with "cannot be used" * Fixes the method signature of VersionRange::Empty#eql? https://github.com/rubygems/rubygems/commit/8c6b3f130b Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7345
Diffstat (limited to 'lib/bundler/vendor/pub_grub')
-rw-r--r--lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb8
-rw-r--r--lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb6
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb b/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb
index dab58ecdf7..0d96cef23b 100644
--- a/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb
+++ b/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb
@@ -76,9 +76,13 @@ module Bundler::PubGrub
elsif terms.length == 1
term = terms[0]
if term.positive?
- "#{terms[0].to_s(allow_every: true)} is forbidden"
+ if term.constraint.any?
+ "#{term.package} cannot be used"
+ else
+ "#{term.to_s(allow_every: true)} cannot be used"
+ end
else
- "#{terms[0].invert} is required"
+ "#{term.invert} is required"
end
else
if terms.all?(&:positive?)
diff --git a/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb b/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb
index 506b447b36..8d73c3f7b5 100644
--- a/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb
+++ b/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb
@@ -19,7 +19,7 @@ module Bundler::PubGrub
true
end
- def eql?
+ def eql?(other)
other.empty?
end
@@ -65,6 +65,7 @@ module Bundler::PubGrub
end
EMPTY = Empty.new
+ Empty.singleton_class.undef_method(:new)
def self.empty
EMPTY
@@ -88,7 +89,8 @@ module Bundler::PubGrub
def eql?(other)
if other.is_a?(VersionRange)
- min.eql?(other.min) &&
+ !other.empty? &&
+ min.eql?(other.min) &&
max.eql?(other.max) &&
include_min.eql?(other.include_min) &&
include_max.eql?(other.include_max)