lib/gem/release/version/number.rb in gem-release-2.1.1 vs lib/gem/release/version/number.rb in gem-release-2.2.0
- old
+ new
@@ -1,10 +1,11 @@
module Gem
module Release
module Version
class Number < Struct.new(:number, :target)
NUMBER = /^(\d+)\.?(\d+)?\.?(\d+)?(\-|\.)?(\w+)?\.?(\d+)?$/
+ PRE_RELEASE = /^(\d+)\.(\d+)\.(\d+)\.?(.*)(\d+)$/
STAGES = %i(alpha beta pre rc)
def bump
return target if specific?
@@ -19,10 +20,10 @@
end
private
def specific?
- target =~ NUMBER
+ target =~ NUMBER || target =~ PRE_RELEASE
end
def major
part = parts[0]
part += 1 if to?(:major)