lib/versionomy/format/standard.rb in versionomy-0.2.2 vs lib/versionomy/format/standard.rb in versionomy-0.2.3

- old
+ new

@@ -245,13 +245,14 @@ # The following is the definition of the standard format. It # understands the standard schema defined above. format_ = Format::Delimiter.new(schema_) do # All version number strings must start with the major version. - # Unlike other fields, it is not preceded by any delimiter. + # Unlike other fields, it is not preceded by the usual "dot" + # delimiter, but it can be preceded by a "v" indicator. field(:major) do - recognize_number(:delimiter_regexp => '', :default_delimiter => '') + recognize_number(:delimiter_regexp => '(v\s?)?', :default_delimiter => '') end # The remainder of the core version number are represented as # integers delimited by periods by default. Each is also dependent # on the presence of the previous field, so :requires_previous_field @@ -367,10 +368,10 @@ # release_type). Here we also set up two styles: a numeric style and # a letter style. So "1.0a" and "1.0-1" are equivalent. field(:patchlevel, :requires_previous_field => false, :default_value_optional => true, :default_style => :number) do recognize_number(:style => :number, :default_delimiter => '-', - :delimiter_regexp => '(-|\.|\s?)p|-') + :delimiter_regexp => '(-|\.|\s?)(p|u)|-|_') recognize_letter(:style => :letter, :default_delimiter => '', :delimiter_regexp => '-|\.|\s?', :expected_follower_regexp => '\z') end field(:patchlevel_minor) do