asari 0.9.2 → 0.9.3
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.
- data/README.md +4 -3
- data/lib/asari.rb +2 -1
- data/lib/asari/version.rb +1 -1
- data/spec/search_spec.rb +2 -2
- metadata +2 -2
data/README.md
CHANGED
|
@@ -193,9 +193,10 @@ Gem requirements/etc. should be handled by Bundler.
|
|
|
193
193
|
|
|
194
194
|
### Contributors
|
|
195
195
|
|
|
196
|
-
* [Lance Gleason](https://github.com/lgleasain "lgleasain on
|
|
197
|
-
* [Emil Soman](https://github.com/emilsoman "emilsoman on
|
|
198
|
-
* [Chris Vincent](https://github.com/cvincent "cvincent on
|
|
196
|
+
* [Lance Gleason](https://github.com/lgleasain "lgleasain on GitHub")
|
|
197
|
+
* [Emil Soman](https://github.com/emilsoman "emilsoman on GitHub")
|
|
198
|
+
* [Chris Vincent](https://github.com/cvincent "cvincent on GitHub")
|
|
199
|
+
* [Kyle Meyer](https://github.com/kaiuhl "kaiuhl on GitHub")
|
|
199
200
|
|
|
200
201
|
## License
|
|
201
202
|
Copyright (C) 2012 by Tommy Morgan
|
data/lib/asari.rb
CHANGED
|
@@ -198,7 +198,8 @@ class Asari
|
|
|
198
198
|
reduce = lambda { |hash|
|
|
199
199
|
hash.reduce("") do |memo, (key, value)|
|
|
200
200
|
if %w(and or not).include?(key.to_s) && value.is_a?(Hash)
|
|
201
|
-
|
|
201
|
+
sub_query = reduce.call(value)
|
|
202
|
+
memo += "(#{key}#{sub_query})" unless sub_query.empty?
|
|
202
203
|
else
|
|
203
204
|
memo += " #{key}:'#{value}'" unless value.to_s.nil? || value.to_s.empty?
|
|
204
205
|
end
|
data/lib/asari/version.rb
CHANGED
data/spec/search_spec.rb
CHANGED
|
@@ -130,9 +130,9 @@ describe Asari do
|
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
it "fails gracefully with empty params" do
|
|
133
|
-
HTTParty.should_receive(:get).with("http://search-testdomain.us-east-1.cloudsearch.amazonaws.com/2011-02-01/search?q=&bq=%28or+is_donut%3A%27true%27%
|
|
133
|
+
HTTParty.should_receive(:get).with("http://search-testdomain.us-east-1.cloudsearch.amazonaws.com/2011-02-01/search?q=&bq=%28or+is_donut%3A%27true%27%29&size=10")
|
|
134
134
|
@asari.search(filter: { or: { is_donut: true, and:
|
|
135
|
-
{ round: "", frosting: nil, fried:
|
|
135
|
+
{ round: "", frosting: nil, fried: nil }}
|
|
136
136
|
})
|
|
137
137
|
end
|
|
138
138
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: asari
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.3
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-09-
|
|
12
|
+
date: 2013-09-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: httparty
|