diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-01 04:53:52 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-01 04:53:52 +0000 |
commit | 6e7213f427c8030396c2de6cc488cae5d8dd5ff9 (patch) | |
tree | 690a8520ec62d18b56e433e7a35f1c49603c1ea5 /lib | |
parent | f77d381159419434b3c1f1a63839706967f348f9 (diff) |
Merge rubygems-3.0.2.
https://blog.rubygems.org/2019/01/01/3.0.2-released.html
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/install_update_options.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/requirement.rb | 17 |
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 |