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.
- data/lib/versionub/types/standard.rb +20 -8
- 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['
|
24
|
+
rule(:separator) { match['.\-_\s'] }
|
25
25
|
|
26
26
|
rule(:version) {
|
27
|
-
part.as(:major) >>
|
28
|
-
|
29
|
-
part.
|
30
|
-
|
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('
|
41
|
+
((str('alpha') | str('alfa') | str('a')) >>
|
34
42
|
(part.as(:alpha) | any.as(:alpha))) |
|
35
43
|
|
36
|
-
((str('
|
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
|