u-attributes 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/micro/attributes/features.rb +11 -11
- data/lib/micro/attributes/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: 854cdfcbae1f568640947a0bbfdf5fa26493a1e47ebf29ce91d7d287f6388050
         | 
| 4 | 
            +
              data.tar.gz: df775cef424add3e18672d03b6522d5e625b6e211b6891078b7bfb31e2ba996a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6541f9295ae0cc88fec1fcc05d8307feb05769de3aadfb597710517aa76e80dacaef7fd2d165491319ef2b0e701c20ebd025459befa2e5c92f07da43f5df6f3b
         | 
| 7 | 
            +
              data.tar.gz: 04e200e16d8c6258e819baa9b3f0ef00c86fc1715d6a866c6dc05fcefde54ceb7fd4746fa050e4e7b50ae7360dcd4639a2397ffe837593107368e19bfcef0dad
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
| @@ -32,8 +32,7 @@ module Micro | |
| 32 32 | 
             
                    'activemodel_validations:initialize' => With::ActiveModelValidationsAndInitialize,
         | 
| 33 33 | 
             
                    'activemodel_validations:strict_initialize' => With::ActiveModelValidationsAndStrictInitialize,
         | 
| 34 34 | 
             
                    'activemodel_validations:diff:initialize' => With::ActiveModelValidationsAndDiffAndInitialize,
         | 
| 35 | 
            -
                    'activemodel_validations:diff:strict_initialize' => With::ActiveModelValidationsAndDiffAndStrictInitialize | 
| 36 | 
            -
                    ALL.join(':') => With::ActiveModelValidationsAndDiffAndStrictInitialize
         | 
| 35 | 
            +
                    'activemodel_validations:diff:strict_initialize' => With::ActiveModelValidationsAndDiffAndStrictInitialize
         | 
| 37 36 | 
             
                  }.freeze
         | 
| 38 37 |  | 
| 39 38 | 
             
                  private_constant :OPTIONS, :INVALID_NAME
         | 
| @@ -44,6 +43,8 @@ module Micro | |
| 44 43 |  | 
| 45 44 | 
             
                  def with(args)
         | 
| 46 45 | 
             
                    valid_names!(args) do |names|
         | 
| 46 | 
            +
                      delete_initialize_if_has_strict_initialize(names)
         | 
| 47 | 
            +
             | 
| 47 48 | 
             
                      OPTIONS.fetch(names.sort.join(':'))
         | 
| 48 49 | 
             
                    end
         | 
| 49 50 | 
             
                  end
         | 
| @@ -80,22 +81,21 @@ module Micro | |
| 80 81 | 
             
                    yield(names)
         | 
| 81 82 | 
             
                  end
         | 
| 82 83 |  | 
| 83 | 
            -
                  def  | 
| 84 | 
            -
                     | 
| 84 | 
            +
                  def an_initialize?(name)
         | 
| 85 | 
            +
                    name == INITIALIZE || name == STRICT_INITIALIZE
         | 
| 85 86 | 
             
                  end
         | 
| 86 87 |  | 
| 87 | 
            -
                  def  | 
| 88 | 
            -
                    names.include?( | 
| 89 | 
            -
                  end
         | 
| 88 | 
            +
                  def delete_initialize_if_has_strict_initialize(names)
         | 
| 89 | 
            +
                    return unless names.include?(STRICT_INITIALIZE)
         | 
| 90 90 |  | 
| 91 | 
            -
             | 
| 92 | 
            -
                    name == INITIALIZE || name == STRICT_INITIALIZE
         | 
| 91 | 
            +
                    names.delete_if { |name| name == INITIALIZE }
         | 
| 93 92 | 
             
                  end
         | 
| 94 93 |  | 
| 95 94 | 
             
                  def except_options(names_to_exclude)
         | 
| 96 95 | 
             
                    (ALL - names_to_exclude).tap do |names|
         | 
| 97 | 
            -
                      names.delete_if { |name| an_initialize?(name) } if  | 
| 98 | 
            -
             | 
| 96 | 
            +
                      names.delete_if { |name| an_initialize?(name) } if names_to_exclude.include?(INITIALIZE)
         | 
| 97 | 
            +
             | 
| 98 | 
            +
                      delete_initialize_if_has_strict_initialize(names)
         | 
| 99 99 | 
             
                    end
         | 
| 100 100 | 
             
                  end
         | 
| 101 101 | 
             
                end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: u-attributes
         | 
| 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 | 
             
            - Rodrigo Serradura
         | 
| @@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 75 75 | 
             
                - !ruby/object:Gem::Version
         | 
| 76 76 | 
             
                  version: '0'
         | 
| 77 77 | 
             
            requirements: []
         | 
| 78 | 
            -
            rubygems_version: 3.0. | 
| 78 | 
            +
            rubygems_version: 3.0.1
         | 
| 79 79 | 
             
            signing_key: 
         | 
| 80 80 | 
             
            specification_version: 4
         | 
| 81 81 | 
             
            summary: Define read-only attributes
         |