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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmFhNGNkYmJmZDdmMjc5NjJjODI3NzZmN2Q0ODY5NjkyNzYwZjhiZQ==
4
+ ODNkY2NkZGFiNWQ2NzViZGEyNjE4MWY1OWE2ODcwZTY4YTFkMjVjMA==
5
5
  data.tar.gz: !binary |-
6
- YzRlZTAyZTZiN2UzOTM3NWU1YTAyZGRkNDM1YjUwMTA0NTAxMGU4ZQ==
6
+ YTZlMGY2Njg4OTJmM2RmYTZkM2FhY2UxYWE3YzVlMDZmNjU2ODg4OQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZTY3MjgyOGI3Y2FjYTFhMzlhZGVhMGQyYmNiYTRmZDI1Nzc3MzY2YjU1Mzcw
10
- M2Y4YjFmNDg3YmEzZmUyNWM0ZGYwOTNkZTYyODkyZGNmZTU4NTUyMWQwNmQ3
11
- M2U3NDBkOTM4OTRhZGFiNTNhMDQxOTdlYmFiZTEwMTQ1MzlmYjI=
9
+ ZjhlNjgyNDExZjJhZDc1OGIwOTBlYzA2MTE3YmJmOGI3ZWUyNjFhODA2MzRk
10
+ NDU1YWMyMDRkNTg1MWU4MGFjMDRjMDE3NzkwZGJiNDcxMmZhODk5MjkzN2Q5
11
+ YTU2NmQyZDkyMmQ1ZmVlNzRmYWViYzRkMjYzYmJlZGRjNTdhODY=
12
12
  data.tar.gz: !binary |-
13
- MDRkNDY3N2Y4Mzc4Mjc2NGZjOGYxYWZlMjc3MjZmYzM4ZmFlYTE0NzMyYWIy
14
- YTQwZjhiNjQwM2I3OTI3Zjk3NTA4MzQ1ZTM1NTE3Mzk4NTliMDc1NWVkODRm
15
- YzZmZTg0YmUzZDgzMDI3YjYzN2RmZjFiYTBiM2EwMmIyNTUyNzc=
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
@@ -64,7 +64,10 @@ module Searchlight
64
64
 
65
65
  # Note that false is not blank
66
66
  def is_blank?(value)
67
- (value.respond_to?(:empty?) && value.empty?) || value.nil? || value.to_s.strip == ''
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)
@@ -1,3 +1,3 @@
1
1
  module Searchlight
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -25,7 +25,7 @@ describe Searchlight::Search do
25
25
 
26
26
  let(:allowed_options) { [:name, :description, :categories, :nicknames] }
27
27
 
28
- context "when non-empty options are provided" do
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: %w[mammal moonshiner], nicknames: []} }
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', categories: %w[mammal moonshiner])
44
-
43
+ expect(search.options).to eq(name: 'Roy')
45
44
  end
46
45
 
47
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Long