dry-transaction 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/dry/transaction/callable.rb +14 -1
- data/lib/dry/transaction/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: 625617cfd08882549ed80e2c6f9fca647b433b3c9b01f141722dd8e5e350ca93
|
4
|
+
data.tar.gz: 4c4eab3625d39e43ad4d8e867e07d161af1397220cae2ac95022e660f5120149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 400e487b067363922f1c03a218b6d3b078d3a43cecbf47d0d3f8419373c0007926aae5d71848927f8dd17fdb9db9abc398922d968aebee4af16f7a7ccd80307a
|
7
|
+
data.tar.gz: 1b577f303186b90200f292eca519f4de03b08ab67d5c15ead11f435d9c5a7319be49075f5b253907b05a0595b1cf40d8e4d17036638b323c35100e9774481688
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 0.13.1 2021-01-31
|
4
|
+
|
5
|
+
|
6
|
+
### Changed
|
7
|
+
|
8
|
+
- Resolve Ruby 2.7 deprecation warnings and support Ruby 3.0 (@robbl-as in PR #134)
|
9
|
+
|
10
|
+
[Compare v0.13.0...v0.13.1](https://github.com/dry-rb/dry-transaction/compare/v0.13.0...v0.13.1)
|
11
|
+
|
3
12
|
## 0.13.0 2018-06-13
|
4
13
|
|
5
14
|
|
@@ -31,13 +31,26 @@ module Dry
|
|
31
31
|
def call(*args, &block)
|
32
32
|
if arity.zero?
|
33
33
|
operation.(&block)
|
34
|
-
elsif
|
34
|
+
elsif ruby_27_last_arg_hash?(args)
|
35
35
|
*prefix, last = args
|
36
36
|
operation.(*prefix, **last, &block)
|
37
37
|
else
|
38
38
|
operation.(*args, &block)
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
# Ruby 2.7 gives a deprecation warning about passing a hash of parameters as the last argument
|
45
|
+
# to a method. Ruby 3.0 outright disallows it. This checks for that condition, but explicitly
|
46
|
+
# uses instance_of? rather than is_a? or kind_of?, because Hash like objects, specifically
|
47
|
+
# HashWithIndifferentAccess objects are provided by Rails as controller parameters, and often
|
48
|
+
# passed to dry-rb validators.
|
49
|
+
# In this case, it's better to leave the object as it's existing type, rather than implicitly
|
50
|
+
# convert it in to a hash with the double-splat (**) operator.
|
51
|
+
def ruby_27_last_arg_hash?(args)
|
52
|
+
args.last.instance_of?(Hash) && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0")
|
53
|
+
end
|
41
54
|
end
|
42
55
|
end
|
43
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-transaction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-container
|