loquor 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67976c1b27cc7116c58be7007348984a3d653439
4
- data.tar.gz: 8bfe7d6a68bfba4fd830f791e626002c0e2d796b
3
+ metadata.gz: 9a1c662fecb099a96aaf567f6b51e6ad9c4638dd
4
+ data.tar.gz: a6d61c28522534f7833ffb23b254ee059e25eda3
5
5
  SHA512:
6
- metadata.gz: 26a431293bfd25cc5b312290c4dc57aa48c71459a7c5c9cdcd4f0cf57a54e7b12bf97aa743b0e79f5dc0746bc8c5aeb294266d8e9c2b63fb378ec72c41126328
7
- data.tar.gz: 2ca3d98c59e01d8e7ab734bb0cbe324adcaf2c6f50010bc877ce4c88f7c1d6a6372656c724a5f336a258a0fd077a20b66bc578ee4d03c6c0c2d7b9b0fb62a302
6
+ metadata.gz: aba203c507be449bbaae6c1a942e05dcec2a1f5542f45489ef5ec36862e1f5d196086acea96e1dca64ed00765af6a782c3fcc2733e1ac8f2753d35701777a27a
7
+ data.tar.gz: 908fb33fb8e47fadde344f73b1134a56951afffb8d5c5098eb129b8796d3c791e07754394ec88138b066cf9ac60c28cb81dadb7199f4064a1fc0292368700e76
@@ -1,3 +1,6 @@
1
+ # 1.2.0 / 2014-02-11
2
+ [FEATURE] Add support for hashes as filters.
3
+
1
4
  # 1.1.1 / 2014-01-24
2
5
  * [BUGFIX] Respond_to should respond to the same to symbols and strings.
3
6
 
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/iHID)
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 arrays.")
77
+ raise LoquorError.new("Filter values must be strings, arrays or single-depth hashes.")
74
78
  end
75
79
  end
76
80
  end
@@ -1,3 +1,3 @@
1
1
  module Loquor
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -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.1.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-01-24 00:00:00.000000000 Z
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.9
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: