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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 931ff7712119f2fa2f5734361b6325eff9a59619
4
- data.tar.gz: 11b884893ec200eb72db680530af903089b5b0b2
3
+ metadata.gz: c1759720e362dcbe20461c07691459b2d4205037
4
+ data.tar.gz: bc03a2102a137b5a8cebd7cee53088b172cf2c7d
5
5
  SHA512:
6
- metadata.gz: f85613e22558ab9294242608aed371ff4b602ebd0d9412de576ddf42463afcec86849c7cc6e1ed9f58a14ad164405abae4dc1ec7eff191ebf502da224eaad830
7
- data.tar.gz: 05e2c2d5d3b84bc13ccad4ac3c9cf3ba1af7009cf2d27bac8438b1078f5cfa06afb3dcea7cccb1af29e5f8a67eafff8f23ce7dff9664b403f1dffcfb84baf0d3
6
+ metadata.gz: 3d6627239412c2f4036b0d68bdfc8d21e9473b3b621ce127bcbfcad8a74f3208f5cce41511f5cc8bc6799ef1bdc078b6f69ec3a4af1dcacc7b3e8eed1d589507
7
+ data.tar.gz: 4fe798defef2109b81c04ebd0542f830c588a0e994888f79fd3ea2e45301e73faabc83a3e0b1541098ebc113239a47b7f9669efa68d00da7dcb58ba65286b33e
@@ -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
- %i(Schema Blocks Types Weirdo).each do |mod|
30
+ DSL::BRICKS.each do |mod|
31
31
  target.singleton_class.prepend ::Dry::Mutations::DSL.const_get(mod)
32
32
  end
33
33
  end
@@ -15,7 +15,7 @@ module Dry
15
15
 
16
16
  __send__(current, name) { __send__ :"#{name}?" }
17
17
  end
18
- end
18
+ end if ENV['USE_WEIRDO_HANDLER']
19
19
  end
20
20
  end
21
21
  end
@@ -1,11 +1,34 @@
1
1
  module Dry
2
2
  module Mutations
3
3
  module Extensions
4
- module Dummy # :nodoc:
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
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Mutations
3
- VERSION = '0.8.92'.freeze
3
+ VERSION = '0.8.93'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-mutations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.92
4
+ version: 0.8.93
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksei Matiushkin