dry-types 1.8.0 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/lib/dry/types/composition.rb +1 -1
- data/lib/dry/types/constrained/coercible.rb +3 -3
- data/lib/dry/types/constructor/function.rb +1 -1
- data/lib/dry/types/default.rb +3 -3
- data/lib/dry/types/enum.rb +1 -1
- data/lib/dry/types/extensions/maybe.rb +1 -1
- data/lib/dry/types/implication.rb +2 -2
- data/lib/dry/types/lax.rb +1 -1
- data/lib/dry/types/nominal.rb +2 -2
- data/lib/dry/types/printable.rb +1 -1
- data/lib/dry/types/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb0a9688e1ae1fe5305d551dcedccbfa0dfca45a7949e5d357ad98edf0f4c8ef
|
4
|
+
data.tar.gz: a7dd52e7ff33aa2a1de7249bd2f03445db8b4632894e65cb8a70c1bc06dacbc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb5a3673334cddda6541c1ec24a91343ce3eb4f50d4ccf4ca625350d5b0a81863fc2a75429995ff3332e89f1ac5c4eda183c5cee1b9522c8eb35828e718d309a
|
7
|
+
data.tar.gz: 217af029ec68360e982181764399ff9720ed0f2315aac2f671249ae9e91e4c0e18f3341a0580abdaf5e06bd490fab744dbafcffc1528fbc59587e869d487d7b7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.8.2 2025-01-31
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Syntax errors on 3.3.0 (@flash-gordon, see #478)
|
9
|
+
|
10
|
+
|
11
|
+
[Compare v1.8.1...v1.8.2](https://github.com/dry-rb/dry-types/compare/v1.8.1...v1.8.2)
|
12
|
+
|
13
|
+
## 1.8.1 2025-01-21
|
14
|
+
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Warnings about unused block arguments (@flash-gordon, #477)
|
19
|
+
|
20
|
+
|
21
|
+
[Compare v1.8.0...v1.8.1](https://github.com/dry-rb/dry-types/compare/v1.8.0...v1.8.1)
|
22
|
+
|
3
23
|
## 1.8.0 2025-01-06
|
4
24
|
|
5
25
|
|
@@ -37,7 +37,7 @@ module Dry
|
|
37
37
|
# @see Dry::Types::Constrained#try
|
38
38
|
#
|
39
39
|
# @api public
|
40
|
-
def try(input, &
|
40
|
+
def try(input, &)
|
41
41
|
result = type.try(input)
|
42
42
|
|
43
43
|
if result.success?
|
@@ -47,10 +47,10 @@ module Dry
|
|
47
47
|
result
|
48
48
|
else
|
49
49
|
failure = failure(result.input, ConstraintError.new(validation, input))
|
50
|
-
|
50
|
+
block_given? ? yield(failure) : failure
|
51
51
|
end
|
52
52
|
else
|
53
|
-
|
53
|
+
block_given? ? yield(result) : result
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
data/lib/dry/types/default.rb
CHANGED
@@ -74,7 +74,7 @@ module Dry
|
|
74
74
|
# @return [Result::Success]
|
75
75
|
#
|
76
76
|
# @api public
|
77
|
-
def try(input = Undefined)
|
77
|
+
def try(input = Undefined, &)
|
78
78
|
if input.equal?(Undefined)
|
79
79
|
success(evaluate)
|
80
80
|
else
|
@@ -105,11 +105,11 @@ module Dry
|
|
105
105
|
# @return [Object] value passed through {#type} or {#default} value
|
106
106
|
#
|
107
107
|
# @api private
|
108
|
-
def call_safe(input = Undefined, &
|
108
|
+
def call_safe(input = Undefined, &)
|
109
109
|
if input.equal?(Undefined)
|
110
110
|
evaluate
|
111
111
|
else
|
112
|
-
Undefined.default(type.call_safe(input, &
|
112
|
+
Undefined.default(type.call_safe(input, &)) { evaluate }
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
data/lib/dry/types/enum.rb
CHANGED
data/lib/dry/types/lax.rb
CHANGED
data/lib/dry/types/nominal.rb
CHANGED
@@ -77,7 +77,7 @@ module Dry
|
|
77
77
|
# @return [BasicObject]
|
78
78
|
#
|
79
79
|
# @api private
|
80
|
-
def call_safe(input) = input
|
80
|
+
def call_safe(input, &) = input
|
81
81
|
|
82
82
|
# @param [Object] input
|
83
83
|
#
|
@@ -88,7 +88,7 @@ module Dry
|
|
88
88
|
# @return [nil] otherwise
|
89
89
|
#
|
90
90
|
# @api public
|
91
|
-
def try(input) = success(input)
|
91
|
+
def try(input, &) = success(input)
|
92
92
|
|
93
93
|
# @param (see Dry::Types::Success#initialize)
|
94
94
|
#
|
data/lib/dry/types/printable.rb
CHANGED
data/lib/dry/types/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|