versionaire 7.0.0 → 7.1.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/lib/versionaire/conversion.rb +1 -1
- data/lib/versionaire/identity.rb +1 -1
- data/lib/versionaire/version.rb +17 -35
- metadata +32 -4
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee0ca3727b5bf31067191d7aa4be767dee8d3b7e6c2703d211aa6cc9927c4021
|
4
|
+
data.tar.gz: ea9ce213190cfe550585441125de1bbb4f327fa99263b06bc20ab7736fe4fc66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d151a766961b4a96d136ebaf66f6ca8b44dbaf50d5037f7d648f380d217e8bb8cf5d9c72def4fa6d234465aec5eb592ca3193b0d08ab9f7645daac4301c8662
|
7
|
+
data.tar.gz: 9a949b67e45eb87e856f2f256e63dfdb0ff274cd8696ea353d5b6f99f90b350c34e74407656764065533a493417b2303acb0300a762da51a209c8298cd06d064
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/versionaire/identity.rb
CHANGED
data/lib/versionaire/version.rb
CHANGED
@@ -1,34 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Versionaire
|
4
|
-
|
5
|
-
|
6
|
-
include Comparable
|
7
|
-
attr_reader :major, :minor, :maintenance
|
8
|
-
|
9
|
-
KEYS = %i[major minor maintenance].freeze
|
10
|
-
DELIMITER = "."
|
4
|
+
VERSION_ATTRIBUTES = %i[major minor maintenance].freeze
|
5
|
+
VERSION_DELIMITER = "."
|
11
6
|
|
7
|
+
# An immutable, semantic version value object.
|
8
|
+
# rubocop:disable Metrics/BlockLength
|
9
|
+
Version = Struct.new :major, :minor, :maintenance, keyword_init: true do
|
12
10
|
def self.regex
|
13
11
|
/
|
14
|
-
\A
|
15
|
-
\d{1,}
|
16
|
-
#{
|
17
|
-
\d{1,}
|
18
|
-
#{
|
19
|
-
\d{1,}
|
20
|
-
\z
|
12
|
+
\A # Start of string.
|
13
|
+
\d{1,} # Major version.
|
14
|
+
#{VERSION_DELIMITER} # Delimiter.
|
15
|
+
\d{1,} # Minor version.
|
16
|
+
#{VERSION_DELIMITER} # Delimiter.
|
17
|
+
\d{1,} # Maintenance version.
|
18
|
+
\z # End of string.
|
21
19
|
/x
|
22
20
|
end
|
23
21
|
|
24
22
|
def self.arguments major, minor, maintenance
|
25
|
-
Hash[
|
23
|
+
Hash[VERSION_ATTRIBUTES.zip [major, minor, maintenance]]
|
26
24
|
end
|
27
25
|
|
28
26
|
def initialize major: 0, minor: 0, maintenance: 0
|
29
|
-
|
30
|
-
@minor = minor
|
31
|
-
@maintenance = maintenance
|
27
|
+
super
|
32
28
|
validate
|
33
29
|
freeze
|
34
30
|
end
|
@@ -43,35 +39,20 @@ module Versionaire
|
|
43
39
|
klass.new klass.arguments(*reduce(other, :-))
|
44
40
|
end
|
45
41
|
|
46
|
-
# :reek:FeatureEnvy
|
47
|
-
def == other
|
48
|
-
other.is_a?(Version) && to_s == other.to_s
|
49
|
-
end
|
50
|
-
|
51
|
-
alias eql? ==
|
52
|
-
|
53
42
|
def <=> other
|
54
43
|
to_s <=> other.to_s
|
55
44
|
end
|
56
45
|
|
57
|
-
def hash
|
58
|
-
[major, minor, maintenance, self.class].hash
|
59
|
-
end
|
60
|
-
|
61
46
|
def to_s
|
62
|
-
[major, minor, maintenance].join
|
47
|
+
[major, minor, maintenance].join VERSION_DELIMITER
|
63
48
|
end
|
64
49
|
|
65
|
-
|
50
|
+
alias_method :to_str, :to_s
|
66
51
|
|
67
52
|
def to_a
|
68
53
|
[major, minor, maintenance]
|
69
54
|
end
|
70
55
|
|
71
|
-
def to_h
|
72
|
-
{major: major, minor: minor, maintenance: maintenance}
|
73
|
-
end
|
74
|
-
|
75
56
|
private
|
76
57
|
|
77
58
|
def validate
|
@@ -83,4 +64,5 @@ module Versionaire
|
|
83
64
|
to_a.zip(other.to_a).map { |pair| pair.reduce(action) }
|
84
65
|
end
|
85
66
|
end
|
67
|
+
# rubocop:enable Metrics/BlockLength
|
86
68
|
end
|
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: 7.
|
4
|
+
version: 7.1.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: 2019-
|
32
|
+
date: 2019-02-02 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: awesome_print
|
@@ -73,6 +73,34 @@ dependencies:
|
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.6'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: gemsmith
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '13.0'
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '13.0'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: git-cop
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
76
104
|
- !ruby/object:Gem::Dependency
|
77
105
|
name: guard-rspec
|
78
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,14 +205,14 @@ dependencies:
|
|
177
205
|
requirements:
|
178
206
|
- - "~>"
|
179
207
|
- !ruby/object:Gem::Version
|
180
|
-
version: '0.
|
208
|
+
version: '0.63'
|
181
209
|
type: :development
|
182
210
|
prerelease: false
|
183
211
|
version_requirements: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
213
|
- - "~>"
|
186
214
|
- !ruby/object:Gem::Version
|
187
|
-
version: '0.
|
215
|
+
version: '0.63'
|
188
216
|
- !ruby/object:Gem::Dependency
|
189
217
|
name: rubocop-rspec
|
190
218
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
��r��a^��?t���u_ ��V
|
1
|
+
l����\�o����%{��uܳ�yv���w���w����?���)n�K�M�z�$�ܨ\��}����h�$p�֭sP{j�~�f�5��۬�8+�,\��چ����������6}⮷���+Zq˧�����.8�x����������>c��\�K��J��i�=u���c�10� �6��I��3*D�0{�#d0[%�;r<�8D�f����Xk�ʥ߿a�[W�F��#��������C�M�L�>�'�
|