versionaire 13.8.0 → 13.9.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/lib/versionaire/function.rb +4 -4
- data/lib/versionaire/version.rb +1 -1
- data/versionaire.gemspec +2 -2
- data.tar.gz.sig +2 -1
- metadata +5 -5
- 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: 60c41d704fef2f557a5aeda8453545ef278e2d1215425fc374a26ea992135b14
|
4
|
+
data.tar.gz: cccf09924c08906d6bc3537153746014d38d55cfe60e37c6e235519135b903f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8be6c106d8efb84979c93d1d253b80e58b71c3047c3f878c96b3de79aeb78bbdc31ecb856e70a129a8e32c3a5212cc7987a38b12bfe55077e7cb9e52cd56fb2e
|
7
|
+
data.tar.gz: 676f3d76f1cd3dde7310cab399bac056cbb005c6c7499d44683149c92021fdf8341e2efdd0cd347746a4eaa366d5862612bc0a469d27cd60e46e0215811ba8c6
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/versionaire/function.rb
CHANGED
@@ -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.
|
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 { |
|
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}"
|
data/lib/versionaire/version.rb
CHANGED
@@ -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
|
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.
|
5
|
+
spec.version = "13.9.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.
|
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
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
z���?g828��h����(��{Q�#���O��_x5�[ޖ����2�ch
|
2
|
+
�
|
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.
|
4
|
+
version: 13.9.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-
|
38
|
+
date: 2024-10-22 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.
|
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.
|
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.
|
101
|
+
rubygems_version: 3.5.22
|
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
|