loquor 1.1.1 → 1.2.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 +3 -0
 - data/README.md +4 -1
 - data/lib/loquor/api_calls/index.rb +5 -1
 - data/lib/loquor/version.rb +1 -1
 - data/test/api_calls/index_test.rb +9 -0
 - metadata +3 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 9a1c662fecb099a96aaf567f6b51e6ad9c4638dd
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a6d61c28522534f7833ffb23b254ee059e25eda3
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: aba203c507be449bbaae6c1a942e05dcec2a1f5542f45489ef5ec36862e1f5d196086acea96e1dca64ed00765af6a782c3fcc2733e1ac8f2753d35701777a27a
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 908fb33fb8e47fadde344f73b1134a56951afffb8d5c5098eb129b8796d3c791e07754394ec88138b066cf9ac60c28cb81dadb7199f4064a1fc0292368700e76
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -94,7 +94,10 @@ This project is managed by the [Meducation team](http://company.meducation.net/a 
     | 
|
| 
       94 
94 
     | 
    
         | 
| 
       95 
95 
     | 
    
         
             
            These individuals have come up with the ideas and written the code that made this possible:
         
     | 
| 
       96 
96 
     | 
    
         | 
| 
       97 
     | 
    
         
            -
            - [Jeremy Walker](http://github.com/ 
     | 
| 
      
 97 
     | 
    
         
            +
            - [Jeremy Walker](http://github.com/iHiD)
         
     | 
| 
      
 98 
     | 
    
         
            +
            - [Malcolm Landon](http://github.com/malcyL)
         
     | 
| 
      
 99 
     | 
    
         
            +
            - [Charles Care](http://github.com/ccare)
         
     | 
| 
      
 100 
     | 
    
         
            +
            - [Rob Styles](http://github.com/mmmmmrob)
         
     | 
| 
       98 
101 
     | 
    
         | 
| 
       99 
102 
     | 
    
         
             
            ## Licence
         
     | 
| 
       100 
103 
     | 
    
         | 
| 
         @@ -69,8 +69,12 @@ module Loquor 
     | 
|
| 
       69 
69 
     | 
    
         
             
                      value.each do |v|
         
     | 
| 
       70 
70 
     | 
    
         
             
                        query_string << "#{key}[]=#{URI.encode(v.to_s)}"
         
     | 
| 
       71 
71 
     | 
    
         
             
                      end
         
     | 
| 
      
 72 
     | 
    
         
            +
                    when Hash
         
     | 
| 
      
 73 
     | 
    
         
            +
                      value.each do |k,v|
         
     | 
| 
      
 74 
     | 
    
         
            +
                        query_string << "#{key}[#{k}]=#{URI.encode(v.to_s)}"
         
     | 
| 
      
 75 
     | 
    
         
            +
                      end
         
     | 
| 
       72 
76 
     | 
    
         
             
                    else
         
     | 
| 
       73 
     | 
    
         
            -
                      raise LoquorError.new("Filter values must be strings or  
     | 
| 
      
 77 
     | 
    
         
            +
                      raise LoquorError.new("Filter values must be strings, arrays or single-depth hashes.")
         
     | 
| 
       74 
78 
     | 
    
         
             
                    end
         
     | 
| 
       75 
79 
     | 
    
         
             
                  end
         
     | 
| 
       76 
80 
     | 
    
         
             
                end
         
     | 
    
        data/lib/loquor/version.rb
    CHANGED
    
    
| 
         @@ -74,6 +74,15 @@ module Loquor 
     | 
|
| 
       74 
74 
     | 
    
         
             
                  assert url.include?("thing[]=bar")
         
     | 
| 
       75 
75 
     | 
    
         
             
                end
         
     | 
| 
       76 
76 
     | 
    
         | 
| 
      
 77 
     | 
    
         
            +
                def test_generates_url_correctly_with_hash_in_a_hash
         
     | 
| 
      
 78 
     | 
    
         
            +
                  criteria = {thing: {foo: 'bar', cat: 'dog'}}
         
     | 
| 
      
 79 
     | 
    
         
            +
                  searcher = ApiCall::Index.new(resource).where(criteria)
         
     | 
| 
      
 80 
     | 
    
         
            +
                  searcher.stubs(path: "foobar")
         
     | 
| 
      
 81 
     | 
    
         
            +
                  url = searcher.send(:generate_url)
         
     | 
| 
      
 82 
     | 
    
         
            +
                  assert url.include?("thing[foo]=bar")
         
     | 
| 
      
 83 
     | 
    
         
            +
                  assert url.include?("thing[cat]=dog")
         
     | 
| 
      
 84 
     | 
    
         
            +
                end
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
       77 
86 
     | 
    
         
             
                def test_uses_correct_replacement_strings_in_query
         
     | 
| 
       78 
87 
     | 
    
         
             
                  Loquor.config.substitute_values[true] = ":__true__"
         
     | 
| 
       79 
88 
     | 
    
         
             
                  criteria = {thing: true}
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: loquor
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jeremy Walker
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-02-12 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: filum
         
     | 
| 
         @@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       174 
174 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       175 
175 
     | 
    
         
             
            requirements: []
         
     | 
| 
       176 
176 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       177 
     | 
    
         
            -
            rubygems_version: 2.1 
     | 
| 
      
 177 
     | 
    
         
            +
            rubygems_version: 2.2.1
         
     | 
| 
       178 
178 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       179 
179 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       180 
180 
     | 
    
         
             
            summary: This library dispatches requests to Meducation
         
     | 
| 
         @@ -193,4 +193,3 @@ test_files: 
     | 
|
| 
       193 
193 
     | 
    
         
             
            - test/resource_mock_test.rb
         
     | 
| 
       194 
194 
     | 
    
         
             
            - test/resource_test.rb
         
     | 
| 
       195 
195 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       196 
     | 
    
         
            -
            has_rdoc: 
         
     |