aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/version.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/version.rb')
-rw-r--r--lib/rubygems/version.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb
index 20663326ef..8335ebe182 100644
--- a/lib/rubygems/version.rb
+++ b/lib/rubygems/version.rb
@@ -143,6 +143,10 @@
# "~> 3.0.0" 3.0.0 ... 3.1
# "~> 3.5" 3.5 ... 4.0
# "~> 3.5.0" 3.5.0 ... 3.6
+# "~> 3" 3.0 ... 4.0
+#
+# For the last example, single-digit versions are automatically extended with
+# a zero to give a sensible result.
class Gem::Version
autoload :Requirement, 'rubygems/requirement'
@@ -189,7 +193,7 @@ class Gem::Version
@@all = {}
def self.new version # :nodoc:
- return super unless Gem::VERSION == self.class
+ return super unless Gem::Version == self
@@all[version] ||= super
end