asari 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
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 Github")
197
- * [Emil Soman](https://github.com/emilsoman "emilsoman on Github")
198
- * [Chris Vincent](https://github.com/cvincent "cvincent on Github")
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
- memo += "(#{key}#{reduce.call(value)})"
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
@@ -1,3 +1,3 @@
1
1
  class Asari
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
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%28and+fried%3A%27true%27%29%29&size=10")
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: true }}
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.2
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-10 00:00:00.000000000 Z
12
+ date: 2013-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty