searchlight 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/lib/searchlight/search.rb +4 -1
- data/lib/searchlight/version.rb +1 -1
- data/spec/searchlight/search_spec.rb +3 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODNkY2NkZGFiNWQ2NzViZGEyNjE4MWY1OWE2ODcwZTY4YTFkMjVjMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTZlMGY2Njg4OTJmM2RmYTZkM2FhY2UxYWE3YzVlMDZmNjU2ODg4OQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjhlNjgyNDExZjJhZDc1OGIwOTBlYzA2MTE3YmJmOGI3ZWUyNjFhODA2MzRk
|
10
|
+
NDU1YWMyMDRkNTg1MWU4MGFjMDRjMDE3NzkwZGJiNDcxMmZhODk5MjkzN2Q5
|
11
|
+
YTU2NmQyZDkyMmQ1ZmVlNzRmYWViYzRkMjYzYmJlZGRjNTdhODY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2VjMWJlZDRjZDQ2ZTBkZTg1YzBmMWJlNzk4NjA0YzJmZTNhNTVkMzE2OTUz
|
14
|
+
MWRjNmQ2YjU1NmZjNzE3NTA1ZjQwZTY5ODEwMTFjNjMzNTQ3NDM3MzJiZjBl
|
15
|
+
MjVmOTMzM2FkY2RkNjE3YzBjODExNjJmMjg0MmM1NDM4ZTVhZjY=
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Searchlight does its best to use [semantic versioning](http://semver.org).
|
4
4
|
|
5
|
+
## v1.2.1
|
6
|
+
|
7
|
+
Bugfix for v1.2.0 - screen out from options any collections containing only blank values
|
8
|
+
|
5
9
|
## v1.2.0
|
6
10
|
|
7
11
|
- Provide `options` accessor that returns all options considered non-blank
|
data/lib/searchlight/search.rb
CHANGED
@@ -64,7 +64,10 @@ module Searchlight
|
|
64
64
|
|
65
65
|
# Note that false is not blank
|
66
66
|
def is_blank?(value)
|
67
|
-
|
67
|
+
return true if value.respond_to?(:all?) && value.all? { |v| is_blank?(v) }
|
68
|
+
return true if value.respond_to?(:empty?) && value.empty?
|
69
|
+
return true if value.nil? || value.to_s.strip == ''
|
70
|
+
false
|
68
71
|
end
|
69
72
|
|
70
73
|
MissingSearchTarget = Class.new(Searchlight::Error)
|
data/lib/searchlight/version.rb
CHANGED
@@ -25,7 +25,7 @@ describe Searchlight::Search do
|
|
25
25
|
|
26
26
|
let(:allowed_options) { [:name, :description, :categories, :nicknames] }
|
27
27
|
|
28
|
-
context "when
|
28
|
+
context "when all options are usable" do
|
29
29
|
|
30
30
|
let(:provided_options) { {name: 'Roy', description: 'Ornry', categories: %w[mammal moonshiner], nicknames: %w[Slim Bubba]} }
|
31
31
|
|
@@ -37,11 +37,10 @@ describe Searchlight::Search do
|
|
37
37
|
|
38
38
|
context "when some provided options are empty" do
|
39
39
|
|
40
|
-
let(:provided_options) { {name: 'Roy', description: '', categories:
|
40
|
+
let(:provided_options) { {name: 'Roy', description: '', categories: ['', ''], nicknames: []} }
|
41
41
|
|
42
42
|
it "does not add them to the options accessor" do
|
43
|
-
expect(search.options).to eq(name: 'Roy'
|
44
|
-
|
43
|
+
expect(search.options).to eq(name: 'Roy')
|
45
44
|
end
|
46
45
|
|
47
46
|
end
|