versionaire 13.8.0 → 13.10.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: b94df8c6d8b84444260a215a75a7721c03eca5069befdc967a3edba4720cd54a
4
- data.tar.gz: bbf95af603ec940d40ac2a32d3aacc57925d9224feb7d2fb60af5c8cf828d153
3
+ metadata.gz: 310b9fd7d0ef45f5fb9726503c7da4fe4174986bad951bcf38b1eb24abe4cb40
4
+ data.tar.gz: 5ae0688460dc427533c9f1a6f79d72f00bf1411ab921cdae08f125e15e32f477
5
5
  SHA512:
6
- metadata.gz: 31186072c8998939914f8599b50d78ee2a0649fafdfd84392038426cf9c0f992a3babbc780a891042ab7d4d0687990624f43fdfa409f8dde25ed544666cd5b27
7
- data.tar.gz: 57841c689e4741e921fa0104c24cfda86f6d06f6bf2f334bad622c53f30d50d6e27570df44bdf5592b75b124e306743bd6fc67dc872342b4c11b36dcecba4b49
6
+ metadata.gz: f874ba10a6eccfd4aaee2e8ca1ad246ae596771dca1f40c366aff4d477ee065d0d288aafacf634037459718f0fe9d3f5924bfd21db0aca593f300fd937ac2705
7
+ data.tar.gz: 8bd4dbdc3f1741d5583bf21150e67b01e0fcd7bc8bcc63edbae41454d5444cf289479dc7b3efd11e6cb8e1510efbeeed18aeeb80aaf53c0c1177e8bc1f9826f0
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "refinements/array"
4
- require "refinements/struct"
5
4
 
6
5
  # The gem namespace.
7
6
  module Versionaire
@@ -23,7 +22,6 @@ module Versionaire
23
22
  # Aids with converting objects into valid versions.
24
23
  class Converter
25
24
  using Refinements::Array
26
- using Refinements::Struct
27
25
 
28
26
  def initialize object, model: Version
29
27
  @object = object
@@ -41,7 +39,7 @@ module Versionaire
41
39
  body = "Use: [<major>, <minor>, <patch>], [<major>, <minor>], [<major>], or []."
42
40
  fail Error, error_message(object, body) unless (0..3).cover? object.size
43
41
 
44
- model.with_positions(*object.pad(0, 3))
42
+ model.new(**attributes_for(object.pad(0, 3)))
45
43
  end
46
44
 
47
45
  def from_hash
@@ -64,9 +62,11 @@ module Versionaire
64
62
  object.split(DELIMITER)
65
63
  .map(&:to_i)
66
64
  .then { |numbers| numbers.pad 0, 3 }
67
- .then { |arguments| model.with_positions(*arguments) }
65
+ .then { |values| model.new(**attributes_for(values)) }
68
66
  end
69
67
 
68
+ def attributes_for(values) = model.members.zip(values).to_h
69
+
70
70
  def required_keys? = object.keys.all? { |key| model.members.include? key }
71
71
 
72
72
  def error_message(object, body) = "Invalid version conversion: #{object}. #{body}"
@@ -5,7 +5,7 @@ require "refinements/struct"
5
5
 
6
6
  module Versionaire
7
7
  # An immutable, semantic version value object.
8
- Version = Struct.new :major, :minor, :patch, keyword_init: true do
8
+ Version = Struct.new :major, :minor, :patch do
9
9
  include Comparable
10
10
 
11
11
  using Refinements::Array
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 = "13.8.0"
5
+ spec.version = "13.10.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/versionaire"
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
25
  spec.required_ruby_version = ">= 3.3", "<= 3.4"
26
- spec.add_dependency "refinements", "~> 12.9"
26
+ spec.add_dependency "refinements", "~> 12.10"
27
27
 
28
28
  spec.files = Dir["*.gemspec", "lib/**/*"]
29
29
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
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: 13.8.0
4
+ version: 13.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-10-07 00:00:00.000000000 Z
38
+ date: 2024-11-09 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: refinements
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '12.9'
46
+ version: '12.10'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '12.9'
53
+ version: '12.10'
54
54
  description:
55
55
  email:
56
56
  - brooke@alchemists.io
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.5.21
101
+ rubygems_version: 3.5.23
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: An immutable, thread-safe, and strict semantic version type.
metadata.gz.sig CHANGED
Binary file