attributor 3.0.1 → 4.0.0
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/CHANGELOG.md +7 -0
 - data/lib/attributor/attribute.rb +0 -3
 - data/lib/attributor/version.rb +1 -1
 - data/spec/attribute_spec.rb +3 -7
 - 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: 64d1a212c179718aacc7837f4484062a4987e4d3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5d2f971e22f191497e2f29bb95e8f84e73a8a52f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f33c468a57b20fd6e91bf58747513b19856d9c62b2c61ddf96e718a91bb0cfa9e3fa1f85c62442e5735df3280707d3adc70bf1b11c4f9c90b7ff5511668affe3
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 14084572c335799325e89195620520176ff57360bf1732a3eee9c86a00fce331a842ca8790a2aaa2743eccd49cc012a84bc7d5aec5f525659a108885ef54543e
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -3,6 +3,13 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            ## next
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         | 
| 
      
 6 
     | 
    
         
            +
            ## 4.0.0 next
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            * Changed the expectation of the value for an `:example` option of an attribute:
         
     | 
| 
      
 9 
     | 
    
         
            +
              * Before, passing an array of values would indicate that those were a few possible examples for it.
         
     | 
| 
      
 10 
     | 
    
         
            +
              * Now, any value (except the already existing special regexp or a proc) for an example will need to be of a native type (or coercible to it). This means that an attribute of type `Collection` can take an array example (and be taken as the whole thing)
         
     | 
| 
      
 11 
     | 
    
         
            +
              * If anybody wants to provide multiple examples for an attribute they can write a proc, and make it return the different ones.
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
       6 
13 
     | 
    
         
             
            ## 3.0.1
         
     | 
| 
       7 
14 
     | 
    
         | 
| 
       8 
15 
     | 
    
         
             
            * Fixed bug with example Hashes where `[]` with a key not in the hash would throw a `NoMethodError`.
         
     | 
    
        data/lib/attributor/attribute.rb
    CHANGED
    
    
    
        data/lib/attributor/version.rb
    CHANGED
    
    
    
        data/spec/attribute_spec.rb
    CHANGED
    
    | 
         @@ -316,14 +316,10 @@ describe Attributor::Attribute do 
     | 
|
| 
       316 
316 
     | 
    
         | 
| 
       317 
317 
     | 
    
         
             
                end
         
     | 
| 
       318 
318 
     | 
    
         | 
| 
       319 
     | 
    
         
            -
                context 'with an  
     | 
| 
      
 319 
     | 
    
         
            +
                context 'with an Collection (of Strings)' do
         
     | 
| 
      
 320 
     | 
    
         
            +
                  let(:type) { Attributor::Collection.of(String) }
         
     | 
| 
       320 
321 
     | 
    
         
             
                  let(:example) { ["one"] }
         
     | 
| 
       321 
     | 
    
         
            -
                   
     | 
| 
       322 
     | 
    
         
            -
                  it 'picks a random value' do
         
     | 
| 
       323 
     | 
    
         
            -
                    example.should_receive(:pick).and_call_original
         
     | 
| 
       324 
     | 
    
         
            -
                    example.should include example_result
         
     | 
| 
       325 
     | 
    
         
            -
                  end
         
     | 
| 
       326 
     | 
    
         
            -
             
     | 
| 
      
 322 
     | 
    
         
            +
                  it { should == example }
         
     | 
| 
       327 
323 
     | 
    
         
             
                end
         
     | 
| 
       328 
324 
     | 
    
         | 
| 
       329 
325 
     | 
    
         
             
              end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: attributor
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 4.0.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Josep M. Blanquer
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2015-07- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2015-07-08 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: hashie
         
     |