dry-mutations 0.8.92 → 0.8.93
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dry/mutations.rb +1 -1
- data/lib/dry/mutations/dsl/weirdo.rb +1 -1
- data/lib/dry/mutations/extensions/dummy.rb +24 -1
- data/lib/dry/mutations/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1759720e362dcbe20461c07691459b2d4205037
|
4
|
+
data.tar.gz: bc03a2102a137b5a8cebd7cee53088b172cf2c7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d6627239412c2f4036b0d68bdfc8d21e9473b3b621ce127bcbfcad8a74f3208f5cce41511f5cc8bc6799ef1bdc078b6f69ec3a4af1dcacc7b3e8eed1d589507
|
7
|
+
data.tar.gz: 4fe798defef2109b81c04ebd0542f830c588a0e994888f79fd3ea2e45301e73faabc83a3e0b1541098ebc113239a47b7f9669efa68d00da7dcb58ba65286b33e
|
data/lib/dry/mutations.rb
CHANGED
@@ -27,7 +27,7 @@ module Dry
|
|
27
27
|
# schemas moight be used to describe validation rules.
|
28
28
|
module Mutations
|
29
29
|
def self.inject target
|
30
|
-
|
30
|
+
DSL::BRICKS.each do |mod|
|
31
31
|
target.singleton_class.prepend ::Dry::Mutations::DSL.const_get(mod)
|
32
32
|
end
|
33
33
|
end
|
@@ -1,11 +1,34 @@
|
|
1
1
|
module Dry
|
2
2
|
module Mutations
|
3
3
|
module Extensions
|
4
|
-
module
|
4
|
+
module Sieve # :nodoc:
|
5
5
|
def execute
|
6
6
|
inputs
|
7
7
|
end
|
8
8
|
end
|
9
|
+
|
10
|
+
module Pipe # :nodoc:
|
11
|
+
def execute
|
12
|
+
case
|
13
|
+
when respond_to?(:raw_inputs) then raw_inputs
|
14
|
+
when instance_variable_defined?(:@raw_inputs) then instance_variable_get(:@raw_inputs)
|
15
|
+
else inputs
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# rubocop:disable Style/ConstantName
|
21
|
+
Dummy = ENV['USE_SIEVE_AS_DUMMY'] ? Sieve : Pipe
|
22
|
+
# rubocop:enable Style/ConstantName
|
23
|
+
|
24
|
+
module Wrapper # :nodoc:
|
25
|
+
include Dummy
|
26
|
+
prepend(Module.new do
|
27
|
+
def execute
|
28
|
+
{ Utils.Snake(self.class, short: true, symbolize: true) => super }
|
29
|
+
end
|
30
|
+
end)
|
31
|
+
end
|
9
32
|
end
|
10
33
|
end
|
11
34
|
end
|