aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/install_update_options.rb2
-rw-r--r--lib/rubygems/requirement.rb17
3 files changed, 18 insertions, 3 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 118268dce2..e114c5abd4 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -9,7 +9,7 @@
require 'rbconfig'
module Gem
- VERSION = "3.0.1".freeze
+ VERSION = "3.0.2".freeze
end
# Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb
index f05491a31c..38a0682958 100644
--- a/lib/rubygems/install_update_options.rb
+++ b/lib/rubygems/install_update_options.rb
@@ -30,7 +30,7 @@ module Gem::InstallUpdateOptions
options[:bin_dir] = File.expand_path(value)
end
- add_option(:"Install/Update", '--[no-]document [TYPES]', Array,
+ add_option(:"Install/Update", '--document [TYPES]', Array,
'Generate documentation for installed gems',
'List the documentation types you wish to',
'generate. For example: rdoc,ri') do |value, options|
diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb
index 1a73274c01..48f4b00d63 100644
--- a/lib/rubygems/requirement.rb
+++ b/lib/rubygems/requirement.rb
@@ -267,7 +267,22 @@ class Gem::Requirement
def ==(other) # :nodoc:
return unless Gem::Requirement === other
- requirements == other.requirements
+
+ # An == check is always necessary
+ return false unless requirements == other.requirements
+
+ # An == check is sufficient unless any requirements use ~>
+ return true unless _tilde_requirements.any?
+
+ # If any requirements use ~> we use the stricter `#eql?` that also checks
+ # that version precision is the same
+ _tilde_requirements.eql?(other._tilde_requirements)
+ end
+
+ protected
+
+ def _tilde_requirements
+ requirements.select { |r| r.first == "~>" }
end
private