versionub 0.0.2.1 → 0.0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/versionub/types/standard.rb +20 -8
  2. metadata +1 -1
@@ -21,24 +21,32 @@ Versionub.register :standard do
21
21
  parser do
22
22
  rule(:part) { match['0-9'].repeat }
23
23
 
24
- rule(:separator) { match['.-_\s'] }
24
+ rule(:separator) { match['.\-_\s'] }
25
25
 
26
26
  rule(:version) {
27
- part.as(:major) >> separator.maybe >>
28
- part.maybe.as(:minor) >> separator.maybe >>
29
- part.maybe.as(:bugfix) >> separator.maybe >> (
30
- ((str('d') | str('development') | str('dev')) >>
27
+ part.as(:major) >>
28
+
29
+ (separator >> part.as(:minor)).maybe >>
30
+ (separator >> part.as(:tiny)).maybe >>
31
+
32
+ (separator.maybe >> (match['a-z'] >> match['0-9a-z'].absent? | part).as(:bugfix)).maybe >>
33
+
34
+ (separator.maybe >> (
35
+ ((str('patch') | str('p')) >>
36
+ (part.as(:patch) | any.as(:patch))) |
37
+
38
+ ((str('development') | str('dev') | str('d')) >>
31
39
  (part.as(:development) | any.as(:development))) |
32
40
 
33
- ((str('a') | str('alpha') | str('alfa')) >>
41
+ ((str('alpha') | str('alfa') | str('a')) >>
34
42
  (part.as(:alpha) | any.as(:alpha))) |
35
43
 
36
- ((str('b') | str('beta')) >>
44
+ ((str('beta') | str('b')) >>
37
45
  (part.as(:beta) | any.as(:beta))) |
38
46
 
39
47
  ((str('rc')) >>
40
48
  (part.as(:rc) | any.as(:rc)))
41
- ).maybe
49
+ ).maybe)
42
50
  }
43
51
 
44
52
  root :version
@@ -52,6 +60,10 @@ Versionub.register :standard do
52
60
  @data[:minor].to_s if @data[:minor]
53
61
  end
54
62
 
63
+ def tiny
64
+ @data[:tiny].to_s if @data[:tiny]
65
+ end
66
+
55
67
  def bugfix
56
68
  @data[:bugfix].to_s if @data[:bugfix]
57
69
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: versionub
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2.1
5
+ version: 0.0.2.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - meh.