dry-mutations 1.1.0 → 1.1.1
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/Gemfile.lock +1 -1
 - data/lib/dry/mutations/dsl/types.rb +5 -1
 - data/lib/dry/mutations/extensions/command.rb +3 -3
 - data/lib/dry/mutations/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3a75d0a0c9aee462be75310c21f148745b72ffdb
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a342fb6f615e09c1a1be1209a0e3b8e535c656b2
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 73fd6cacb9b2c24adcb03133745260a4db87962b57f5b2def7faa1af6e22b2c76232d5459649da4f962deee5f244375568e31839336000768b8241973fdaf64a
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3eb8c0ff3ba03121948eac99d82a17d7da17f2d96664066618c428afea789eb2f98e709f6010b630fa428adc028a420b51f368c4ce73cec5048928923babd0c6
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
| 
         @@ -20,7 +20,9 @@ module Dry 
     | 
|
| 
       20 
20 
     | 
    
         
             
                    ########################################################################
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
                    # FIXME: errors in double+ nested hashes are not nested! dry-rb glitch?
         
     | 
| 
       23 
     | 
    
         
            -
                    def hash name, **params, &cb
         
     | 
| 
      
 23 
     | 
    
         
            +
                    def hash name = nil, **params, &cb
         
     | 
| 
      
 24 
     | 
    
         
            +
                      return super() if name.nil? # HACK: for method name collision
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
       24 
26 
     | 
    
         
             
                      current = @current # closure scope
         
     | 
| 
       25 
27 
     | 
    
         | 
| 
       26 
28 
     | 
    
         
             
                      schema { __send__(current, name).schema(Nested.!(current, &cb)) }
         
     | 
| 
         @@ -126,11 +128,13 @@ module Dry 
     | 
|
| 
       126 
128 
     | 
    
         
             
                    end
         
     | 
| 
       127 
129 
     | 
    
         | 
| 
       128 
130 
     | 
    
         
             
                    def define_helper_methods name
         
     | 
| 
      
 131 
     | 
    
         
            +
                      # rubocop:disable Style/GuardClause
         
     | 
| 
       129 
132 
     | 
    
         
             
                      unless Nested === self
         
     | 
| 
       130 
133 
     | 
    
         
             
                        define_method(name) { @inputs[name] }
         
     | 
| 
       131 
134 
     | 
    
         
             
                        define_method(:"#{name}_present?") { @inputs.key?(name) }
         
     | 
| 
       132 
135 
     | 
    
         
             
                        define_method(:"#{name}=") { |value| @inputs[name] = value }
         
     | 
| 
       133 
136 
     | 
    
         
             
                      end
         
     | 
| 
      
 137 
     | 
    
         
            +
                      # rubocop:enable Style/GuardClause
         
     | 
| 
       134 
138 
     | 
    
         
             
                    end
         
     | 
| 
       135 
139 
     | 
    
         
             
                  end
         
     | 
| 
       136 
140 
     | 
    
         
             
                end
         
     | 
| 
         @@ -111,10 +111,10 @@ module Dry 
     | 
|
| 
       111 
111 
     | 
    
         
             
                      #            path=[:maturity_set, :maturity_days_set, :days],
         
     | 
| 
       112 
112 
     | 
    
         
             
                      #            text=\"must be an integer\",
         
     | 
| 
       113 
113 
     | 
    
         
             
                      #            options={:args=>[], :rule=>:days, :each=>false}>"
         
     | 
| 
       114 
     | 
    
         
            -
                      dry_message ||= ::Dry::Validation::Message.new(kind, key, message, rule: :♻)
         
     | 
| 
       115 
     | 
    
         
            -
                      atom = Errors::ErrorAtom.new(key, kind, dry_message, message: message)
         
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
       117 
114 
     | 
    
         
             
                      last = path.pop
         
     | 
| 
      
 115 
     | 
    
         
            +
                      dry_message ||= ::Dry::Validation::Message.new(kind, last, message, rule: :♻)
         
     | 
| 
      
 116 
     | 
    
         
            +
                      atom = Errors::ErrorAtom.new(last, kind, dry_message, message: message)
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
       118 
118 
     | 
    
         
             
                      (@errors ||= ::Mutations::ErrorHash.new).tap do |errs|
         
     | 
| 
       119 
119 
     | 
    
         
             
                        path.inject(errs) do |cur_errors, part|
         
     | 
| 
       120 
120 
     | 
    
         
             
                          cur_errors[part.to_sym] ||= ::Mutations::ErrorHash.new
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: dry-mutations
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Aleksei Matiushkin
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2017-06- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-06-26 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |