versionaire 10.2.3 → 10.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd6b5378516a4e79af9aebf1de84f272db83af38ec45d1fdf8ad7b0c96db0fe3
4
- data.tar.gz: e935fdbb6f50d43345a9df3bda43a25c3b539ef34b3fcc92eda5f3aac31c8bb9
3
+ metadata.gz: f17a50efda09cafe9d5d2416d3ffe07ede58a1dd463f4355536075ad2c1b60af
4
+ data.tar.gz: 81b1567024ff03840b9bd878efc2fed81e87bae23c2373d13298ddd91a28872e
5
5
  SHA512:
6
- metadata.gz: 3fee8fe24c0302b0c6146c5fca0f515966d44d34e7a904c26cb8bdd464ad92feb41cde2f4c56af7d1853d3bba8ec2e6853adb4d5804bc4d9b830be73833ebece
7
- data.tar.gz: e0a399e2cf88484674214939d43c7eedf65b3e249e828355054290e433f48bdf98f58b2ae3944d629cae3397ff499340b1dd44923ecf9c73156e02fc7b90b3f3
6
+ metadata.gz: 510a8a2d9f4e086380c22702fc106555b74d574adc4653c7a08f441fe6b3dc10adff70bc60fd1d54664bd35b4479fc9452d40657813bd70526f3c82595a10cfc
7
+ data.tar.gz: 2a20ee6de5a824b08629c80285d166b2156b58c2335e03c65a5b0f58dc5193bcd73feff936a60919ce5258bc2c01448908c6d523c26397919cc2e44d3de6fbea
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 `+String+` is supported:
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 `Hash` is supported:
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 # "0.0.0"
169
- version.to_a # [0, 0, 0]
170
- version.to_h # {major: 0, minor: 0, patch: 0}
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
@@ -4,7 +4,7 @@ module Versionaire
4
4
  # Refines Kernel in order to provide a top-level Version conversion function.
5
5
  module Cast
6
6
  refine Kernel do
7
- def Version(object) = Versionaire::Version(object)
7
+ def Version(object) = Versionaire::Version object
8
8
  end
9
9
  end
10
10
  end
@@ -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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "versionaire"
5
- spec.version = "10.2.3"
5
+ spec.version = "10.5.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://www.alchemists.io/projects/versionaire"
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
13
13
  "bug_tracker_uri" => "https://github.com/bkuhlmann/versionaire/issues",
14
14
  "changelog_uri" => "https://www.alchemists.io/projects/versionaire/versions",
15
15
  "documentation_uri" => "https://www.alchemists.io/projects/versionaire",
16
+ "funding_uri" => "https://github.com/sponsors/bkuhlmann",
16
17
  "label" => "Versionaire",
17
18
  "rubygems_mfa_required" => "true",
18
19
  "source_code_uri" => "https://github.com/bkuhlmann/versionaire"
@@ -22,7 +23,7 @@ Gem::Specification.new do |spec|
22
23
  spec.cert_chain = [Gem.default_cert_path]
23
24
 
24
25
  spec.required_ruby_version = "~> 3.1"
25
- spec.add_dependency "refinements", "~> 9.2"
26
+ spec.add_dependency "refinements", "~> 9.6"
26
27
 
27
28
  spec.files = Dir["*.gemspec", "lib/**/*"]
28
29
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ��ݡ�͏9�ȊCܧ���^7���Uɘ�I�&�g��(���A iKp#-�؇S;�j�FS��#�>�E��'qN�r'(��
2
- nޜ0��z�V>�J��>�8;�yNI���U����c��g�3���g��Y�.���q�*���!re/
1
+ b�W�:�Zb͆����T���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: 10.2.3
4
+ version: 10.5.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-04-23 00:00:00.000000000 Z
31
+ date: 2022-07-17 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: refinements
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '9.2'
39
+ version: '9.6'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '9.2'
46
+ version: '9.6'
47
47
  description:
48
48
  email:
49
49
  - brooke@alchemists.io
@@ -69,6 +69,7 @@ metadata:
69
69
  bug_tracker_uri: https://github.com/bkuhlmann/versionaire/issues
70
70
  changelog_uri: https://www.alchemists.io/projects/versionaire/versions
71
71
  documentation_uri: https://www.alchemists.io/projects/versionaire
72
+ funding_uri: https://github.com/sponsors/bkuhlmann
72
73
  label: Versionaire
73
74
  rubygems_mfa_required: 'true'
74
75
  source_code_uri: https://github.com/bkuhlmann/versionaire
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  - !ruby/object:Gem::Version
88
89
  version: '0'
89
90
  requirements: []
90
- rubygems_version: 3.3.12
91
+ rubygems_version: 3.3.18
91
92
  signing_key:
92
93
  specification_version: 4
93
94
  summary: Provides an immutable, thread-safe, and semantic version type.
metadata.gz.sig CHANGED
Binary file