summaryrefslogtreecommitdiff
path: root/lib/rubygems/version.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/version.rb')
-rw-r--r--lib/rubygems/version.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb
index c581aa367f..e2ee59a0c2 100644
--- a/lib/rubygems/version.rb
+++ b/lib/rubygems/version.rb
@@ -232,11 +232,11 @@ class Gem::Version
# same precision. Version "1.0" is not the same as version "1".
def eql? other
- self.class === other and @version == other.version
+ self.class === other and @version == other._version
end
def hash # :nodoc:
- @hash ||= segments.hash
+ @version.hash
end
def init_with coder # :nodoc:
@@ -333,7 +333,7 @@ class Gem::Version
def <=> other
return unless Gem::Version === other
- return 0 if @version == other.version
+ return 0 if @version == other._version
lhsegments = segments
rhsegments = other.segments
@@ -357,4 +357,10 @@ class Gem::Version
return 0
end
+
+ protected
+
+ def _version
+ @version
+ end
end