versionaire 5.2.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +2 -2
- data/lib/versionaire/conversion.rb +2 -2
- data/lib/versionaire/identity.rb +1 -1
- data/lib/versionaire/version.rb +7 -13
- metadata +23 -9
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfa5b237d69c1fa2dba5f0a2bb8b06114cd36cca57a053152b4f2e56cba15cfd
|
4
|
+
data.tar.gz: a68fa46cee6a0b88372df70bda2c47b103ca2f04c154f0d20af6637853c1752a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5b71ce12b3981e2b1cc5fe7862a232bce7f709f36cdcb888ee34332f89b6d73d9af1e8ca007edbaef07dda01102a14b31f00c0984c661ca56a05e3b3a6698b6
|
7
|
+
data.tar.gz: 48be6d961d260f49b5d42ef3cb6682fba1f0b24d39f3f9058196cd5831b2ae84e03dc648025f70525a98b86571728d2df7e0f5980ac617ba81ffa8dc9263cf39
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -42,7 +42,7 @@ Provides immutable, thread-safe, semantic versioning.
|
|
42
42
|
|
43
43
|
## Features
|
44
44
|
|
45
|
-
- Provides [Semantic Versioning](
|
45
|
+
- Provides [Semantic Versioning](https://semver.org).
|
46
46
|
- Provides immutable, thread-safe version instances.
|
47
47
|
- Provides conversions (casts) from a `String`, `Array`, `Hash`, or `Version` to a `Version`.
|
48
48
|
|
@@ -192,7 +192,7 @@ To test, run:
|
|
192
192
|
|
193
193
|
## Versioning
|
194
194
|
|
195
|
-
Read [Semantic Versioning](
|
195
|
+
Read [Semantic Versioning](https://semver.org) for details. Briefly, it means:
|
196
196
|
|
197
197
|
- Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
198
198
|
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
@@ -26,7 +26,7 @@ module Versionaire
|
|
26
26
|
|
27
27
|
def from_string
|
28
28
|
body = %(Use: "<major>.<minor>.<maintenance>" or "v<major>.<minor>.<maintenance>".)
|
29
|
-
fail(Errors::Conversion, error_message(value, body)) unless Version.
|
29
|
+
fail(Errors::Conversion, error_message(value, body)) unless Version.regex.match? value
|
30
30
|
Version.new string_to_arguments
|
31
31
|
end
|
32
32
|
|
@@ -61,7 +61,7 @@ module Versionaire
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def required_keys?
|
64
|
-
value.keys.all? { |key| Version.
|
64
|
+
value.keys.all? { |key| Version::KEYS.include? key }
|
65
65
|
end
|
66
66
|
|
67
67
|
def error_message object, body
|
data/lib/versionaire/identity.rb
CHANGED
data/lib/versionaire/version.rb
CHANGED
@@ -4,31 +4,25 @@ module Versionaire
|
|
4
4
|
# An immutable, semantic version value object.
|
5
5
|
class Version
|
6
6
|
include Comparable
|
7
|
-
|
8
7
|
attr_reader :major, :minor, :maintenance
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.delimiter
|
15
|
-
"."
|
16
|
-
end
|
9
|
+
KEYS = %i[major minor maintenance].freeze
|
10
|
+
DELIMITER = "."
|
17
11
|
|
18
|
-
def self.
|
12
|
+
def self.regex
|
19
13
|
/
|
20
14
|
\A # Start of string.
|
21
15
|
\d{1,} # Major version.
|
22
|
-
#{
|
16
|
+
#{DELIMITER} # Delimiter.
|
23
17
|
\d{1,} # Minor version.
|
24
|
-
#{
|
18
|
+
#{DELIMITER} # Delimiter.
|
25
19
|
\d{1,} # Maintenance version.
|
26
20
|
\z # End of string.
|
27
21
|
/x
|
28
22
|
end
|
29
23
|
|
30
24
|
def self.arguments major, minor, maintenance
|
31
|
-
Hash[
|
25
|
+
Hash[KEYS.zip [major, minor, maintenance]]
|
32
26
|
end
|
33
27
|
|
34
28
|
def initialize major: 0, minor: 0, maintenance: 0
|
@@ -64,7 +58,7 @@ module Versionaire
|
|
64
58
|
end
|
65
59
|
|
66
60
|
def to_s
|
67
|
-
[major, minor, maintenance].join self.class
|
61
|
+
[major, minor, maintenance].join self.class::DELIMITER
|
68
62
|
end
|
69
63
|
|
70
64
|
alias to_str to_s
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: versionaire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
4Zrsxi713z6sndd9JBAm4G7mJiV93MsuCM5N4ZDY7XaxIhvctNSNhX/Yn8LLdtGI
|
30
30
|
b4jw5t40FKyNUvLPPXYAvQALBtk=
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2018-
|
32
|
+
date: 2018-07-01 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: awesome_print
|
@@ -87,20 +87,34 @@ dependencies:
|
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.0'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: gemsmith
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '12.0'
|
97
|
+
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '12.0'
|
90
104
|
- !ruby/object:Gem::Dependency
|
91
105
|
name: git-cop
|
92
106
|
requirement: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '2.
|
110
|
+
version: '2.2'
|
97
111
|
type: :development
|
98
112
|
prerelease: false
|
99
113
|
version_requirements: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '2.
|
117
|
+
version: '2.2'
|
104
118
|
- !ruby/object:Gem::Dependency
|
105
119
|
name: guard-rspec
|
106
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,14 +191,14 @@ dependencies:
|
|
177
191
|
requirements:
|
178
192
|
- - "~>"
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
194
|
+
version: '5.0'
|
181
195
|
type: :development
|
182
196
|
prerelease: false
|
183
197
|
version_requirements: !ruby/object:Gem::Requirement
|
184
198
|
requirements:
|
185
199
|
- - "~>"
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
201
|
+
version: '5.0'
|
188
202
|
- !ruby/object:Gem::Dependency
|
189
203
|
name: rspec
|
190
204
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,14 +219,14 @@ dependencies:
|
|
205
219
|
requirements:
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0.
|
222
|
+
version: '0.57'
|
209
223
|
type: :development
|
210
224
|
prerelease: false
|
211
225
|
version_requirements: !ruby/object:Gem::Requirement
|
212
226
|
requirements:
|
213
227
|
- - "~>"
|
214
228
|
- !ruby/object:Gem::Version
|
215
|
-
version: '0.
|
229
|
+
version: '0.57'
|
216
230
|
- !ruby/object:Gem::Dependency
|
217
231
|
name: wirb
|
218
232
|
requirement: !ruby/object:Gem::Requirement
|
@@ -269,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
283
|
version: '0'
|
270
284
|
requirements: []
|
271
285
|
rubyforge_project:
|
272
|
-
rubygems_version: 2.7.
|
286
|
+
rubygems_version: 2.7.7
|
273
287
|
signing_key:
|
274
288
|
specification_version: 4
|
275
289
|
summary: Provides immutable, thread-safe, semantic versioning.
|
metadata.gz.sig
CHANGED
Binary file
|