lib/semantic/version.rb in semantic-1.2.0 vs lib/semantic/version.rb in semantic-1.2.1
- old
+ new
@@ -1,8 +1,8 @@
# See: http://semver.org
module Semantic
class Version
- SemVerRegexp = /^(\d+\.\d+\.\d+)(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$/
+ SemVerRegexp = /\A(\d+\.\d+\.\d+)(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?\Z/
attr_accessor :major, :minor, :patch, :pre, :build
def initialize version_str
raise ArgumentError.new("#{version_str} is not a valid SemVer Version (http://semver.org)") unless version_str =~ SemVerRegexp