diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-24 02:38:57 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-24 02:38:57 +0000 |
commit | 5d438215365e1a5dc3da7172a511a335aa58a5b4 (patch) | |
tree | 72ac80942856be3a5370dea6458f3b6dfce671e4 /lib/rubygems/version.rb | |
parent | 6219b68fb53a77a221f615d47dde83fea0a7e7c8 (diff) | |
download | ruby-5d438215365e1a5dc3da7172a511a335aa58a5b4.tar.gz |
Update Rubygems 2.6.10
* https://github.com/rubygems/rubygems/commit/2ee5bf9fd3bd7649d3e244bc40107ff32070ef47
* https://github.com/rubygems/rubygems/commit/be510dd4097e65c6a256a6e173d6b724a3a96472
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/version.rb')
-rw-r--r-- | lib/rubygems/version.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb index 2f6cfae6ed..17dd7b0795 100644 --- a/lib/rubygems/version.rb +++ b/lib/rubygems/version.rb @@ -204,8 +204,12 @@ class Gem::Version # series of digits or ASCII letters separated by dots. def initialize version - raise ArgumentError, "Malformed version number string #{version}" unless - self.class.correct?(version) + unless self.class.correct?(version) + raise ArgumentError, "Malformed version number string #{version}" + end + + # If version is an empty string convert it to 0 + version = 0 if version =~ /\A\s*\Z/ @version = version.to_s.strip.gsub("-",".pre.") @segments = nil |