dry-mutations 0.8.91 → 0.8.92

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6143037e21a1bb5f04fb77c273d64dc79927f9ec
4
- data.tar.gz: 57aa79569a7de52043e4c8bce588289cad21ed53
3
+ metadata.gz: 931ff7712119f2fa2f5734361b6325eff9a59619
4
+ data.tar.gz: 11b884893ec200eb72db680530af903089b5b0b2
5
5
  SHA512:
6
- metadata.gz: a197a4ecc6fabece190b2ef03bd793f5dd314fe87dd9ecca045e0fb145281d7c7af2675b6746d670a432247c2b726efa984d4707408e8dd726e1dd73d4a181fe
7
- data.tar.gz: 7572ba3568ec673d75471c02b9c6da2a0aad9855655070a59e1e70b58c51a2e597e552fada078685b96fbdcf5d27c1684cdaa1e17cd5fc019859a3d4c59b3439
6
+ metadata.gz: f85613e22558ab9294242608aed371ff4b602ebd0d9412de576ddf42463afcec86849c7cc6e1ed9f58a14ad164405abae4dc1ec7eff191ebf502da224eaad830
7
+ data.tar.gz: 05e2c2d5d3b84bc13ccad4ac3c9cf3ba1af7009cf2d27bac8438b1078f5cfa06afb3dcea7cccb1af29e5f8a67eafff8f23ce7dff9664b403f1dffcfb84baf0d3
data/lib/dry/mutations.rb CHANGED
@@ -13,6 +13,7 @@ require 'dry/mutations/errors'
13
13
  require 'dry/mutations/dsl'
14
14
  require 'dry/mutations/extensions'
15
15
  require 'dry/mutations/transactions'
16
+ require 'dry/mutations/schema'
16
17
 
17
18
  require 'dry/mutations/globals'
18
19
 
@@ -31,6 +32,10 @@ module Dry
31
32
  end
32
33
  end
33
34
 
35
+ def self.Schema(options = {}, &block)
36
+ ::Dry::Validation.Schema(::Dry::Mutations::Schema, options, &block)
37
+ end
38
+
34
39
  DSL::Types::Nested.extend DSL::Module
35
40
  ::Mutations::Command.prepend Extensions::Command if Utils.Truthy?(ENV['GLOBAL_DRY_MUTATIONS'])
36
41
  end
@@ -1,19 +1,8 @@
1
1
  module Dry
2
2
  module Mutations
3
3
  module DSL # :nodoc:
4
- MESSAGES_FILE = (::File.join __dir__, '..', '..', '..', '..', 'config', 'messages.yml').freeze
5
-
6
4
  def self.Schema
7
- Validation.Schema do
8
- configure do
9
- # config.messages = :i18n
10
- config.messages_file = MESSAGES_FILE
11
- config.hash_type = :symbolized
12
- config.input_processor = :sanitizer
13
-
14
- predicates(Mutations::Predicates)
15
- end
16
- end
5
+ Dry::Mutations.Schema
17
6
  end
18
7
 
19
8
  module Schema # :nodoc:
@@ -0,0 +1,15 @@
1
+ module Dry
2
+ module Mutations
3
+ class Schema < ::Dry::Validation::Schema
4
+ MESSAGES_FILE = (::File.join __dir__, '..', '..', '..', 'config', 'messages.yml').freeze
5
+
6
+ configure do |config|
7
+ config.messages_file = MESSAGES_FILE
8
+ config.hash_type = :symbolized
9
+ config.input_processor = :sanitizer
10
+
11
+ predicates(::Dry::Mutations::Predicates)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Mutations
3
- VERSION = '0.8.91'.freeze
3
+ VERSION = '0.8.92'.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.91
4
+ version: 0.8.92
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksei Matiushkin
@@ -220,6 +220,7 @@ files:
220
220
  - lib/dry/mutations/globals.rb
221
221
  - lib/dry/mutations/monkeypatches.rb
222
222
  - lib/dry/mutations/predicates.rb
223
+ - lib/dry/mutations/schema.rb
223
224
  - lib/dry/mutations/transactions.rb
224
225
  - lib/dry/mutations/transactions/container.rb
225
226
  - lib/dry/mutations/transactions/dsl.rb