aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/requirement.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/requirement.rb')
-rw-r--r--lib/rubygems/requirement.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb
index 35f7d0809a..f7bda10cf7 100644
--- a/lib/rubygems/requirement.rb
+++ b/lib/rubygems/requirement.rb
@@ -141,6 +141,18 @@ class Gem::Requirement
requirements.all? { |op, rv| (OPS[op] || OPS["="]).call version, rv }
end
+ alias :=== :satisfied_by?
+ alias :=~ :satisfied_by?
+
+ ##
+ # True if the requirement will not always match the latest version.
+
+ def specific?
+ return true if @requirements.length > 1 # GIGO, > 1, > 2 is silly
+
+ not %w[> >=].include? @requirements.first.first # grab the operator
+ end
+
def to_s # :nodoc:
as_list.join ", "
end