versionaire 10.3.0 → 10.4.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/README.adoc +29 -5
- data/lib/versionaire/cast.rb +1 -1
- data/lib/versionaire/version.rb +4 -1
- data/versionaire.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: bc07507e3fb5fc47c7c5f5522784b9a12b2088fa6eb91d2e3f3b4a5f0fe68923
|
4
|
+
data.tar.gz: 31ad3924066f9040fab56d07a21d69ac87ec8c32d5648c6c64c2ea46ee42cbed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26d9c06096b481d81441d7ae00accd2ebcac2140695c14935a58ef69b8a04e73aba6248bd96e88b64d94004dfd85322c839bedae9cf5519370331010f5d5da40
|
7
|
+
data.tar.gz: c3d50cd0ffbe8997251e5270cd979199238a306d57120459c7fbbd568f300aee915249663b664cc3a1b9c6472a00bd0e826ea23a3c8cc2c1077591ba6bcdc35e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -150,7 +150,7 @@ approach to casting like any other primitive.
|
|
150
150
|
|
151
151
|
==== Implicit
|
152
152
|
|
153
|
-
Implicit conversion to a
|
153
|
+
Implicit conversion to a `String` is supported:
|
154
154
|
|
155
155
|
[source,ruby]
|
156
156
|
----
|
@@ -159,15 +159,39 @@ Implicit conversion to a `+String+` is supported:
|
|
159
159
|
|
160
160
|
==== Explicit
|
161
161
|
|
162
|
-
Explicit conversion to a `String`, `Array`, or `
|
162
|
+
Explicit conversion to a `String`, `Array`, `Hash`, or `Proc` is supported:
|
163
163
|
|
164
164
|
[source,ruby]
|
165
165
|
----
|
166
166
|
version = Versionaire::Version.new
|
167
167
|
|
168
|
-
version.to_s
|
169
|
-
version.to_a
|
170
|
-
version.to_h
|
168
|
+
version.to_s # "0.0.0"
|
169
|
+
version.to_a # [0, 0, 0]
|
170
|
+
version.to_h # {major: 0, minor: 0, patch: 0}
|
171
|
+
version.to_proc # #<Proc:0x000000010b015b88 (lambda)>
|
172
|
+
----
|
173
|
+
|
174
|
+
To elaborate on procs further, this means the following is possible:
|
175
|
+
|
176
|
+
[source,ruby]
|
177
|
+
----
|
178
|
+
using Versionaire::Cast
|
179
|
+
|
180
|
+
version = Version "1.2.3"
|
181
|
+
|
182
|
+
version.to_proc.call :major # 1
|
183
|
+
[version, version, version].map(&:minor) # [2, 2, 2]
|
184
|
+
----
|
185
|
+
|
186
|
+
=== Inspections
|
187
|
+
|
188
|
+
You can inspect a version which is the equivalent of an escaped string representation. Example:
|
189
|
+
|
190
|
+
[source,ruby]
|
191
|
+
----
|
192
|
+
using Versionaire::Cast
|
193
|
+
|
194
|
+
Version("1.2.3").inspect # "\"1.2.3\""
|
171
195
|
----
|
172
196
|
|
173
197
|
=== Comparisons
|
data/lib/versionaire/cast.rb
CHANGED
data/lib/versionaire/version.rb
CHANGED
@@ -48,10 +48,13 @@ module Versionaire
|
|
48
48
|
|
49
49
|
def up(key, value = 1) = revalue(key => value) { |previous, current| previous + current }
|
50
50
|
|
51
|
+
def inspect = to_s.inspect
|
52
|
+
|
53
|
+
def to_proc = method(:[]).to_proc
|
54
|
+
|
51
55
|
def to_s = to_a.join(self.class.delimiter)
|
52
56
|
|
53
57
|
alias_method :to_str, :to_s
|
54
|
-
alias_method :values, :to_a
|
55
58
|
|
56
59
|
private
|
57
60
|
|
data/versionaire.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
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: 10.
|
4
|
+
version: 10.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
|
29
29
|
RFE=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2022-05-
|
31
|
+
date: 2022-05-28 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: refinements
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
|
-
rubygems_version: 3.3.
|
91
|
+
rubygems_version: 3.3.14
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Provides an immutable, thread-safe, and semantic version type.
|
metadata.gz.sig
CHANGED
Binary file
|