picky 4.25.1 → 4.25.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44a3b70f33fe644a7c9ab0cc519af8c182cf09c3
4
- data.tar.gz: e74d3117c847a410ef852ad9d850179327cd0b97
3
+ metadata.gz: 65f4506b046ad69ea906941acd6e3119f3ecf30e
4
+ data.tar.gz: 4fa9054087a65a94e94e1ecf8f76af34bc30e876
5
5
  SHA512:
6
- metadata.gz: d1da0628b51f4678f645d25dc637208ab508b580d1fbe33e7609538df2b322626cddd48bf85283b2f05ec374f1c37af16bf141d7421b7178a9ec6aa2f3bf067b
7
- data.tar.gz: 2d28bbc6d9d95e11fd2829ad6d6695746ee3b273b298826420311eeb7005087c4c28cd3f5e10a9c3fb8fe143dbb857e231f685247f059d06c108c03948c16f4a
6
+ metadata.gz: 0ee957602ea8399d207212162c2d8865cd3cd34f390832abfd92eed9d4a36d92f59bc8cd56b2c8e0feba975fe61a962a46236e56b6f793b24dbf63ffc86ddbbe
7
+ data.tar.gz: 572ac5d023808273e7300dfce25ed79c2e675cc360099801f834a4d2a2f7fec7b9778f88dd7f54218cf9e2c487c0bf8e97c05c3e8dc29cbbe2ce450b72693f2e
@@ -24,6 +24,10 @@ module Picky
24
24
  end
25
25
  combinations.empty? && combinations || [Query::Combination::Or.new(combinations)]
26
26
  end
27
+
28
+ def symbolize!
29
+ @tokens.symbolize
30
+ end
27
31
 
28
32
  end
29
33
 
@@ -29,6 +29,28 @@ describe "OR token" do
29
29
  it('still works') { try.search("hello text:ohai").ids.should == [1] }
30
30
  end
31
31
 
32
+ context 'simple cases with symbol_keys' do
33
+ let(:index) do
34
+ index = Picky::Index.new :or do
35
+ symbol_keys true
36
+ category :text
37
+ end
38
+ thing = OpenStruct.new id: 1, text: "hello ohai"
39
+ other = OpenStruct.new id: 2, text: "hello kthxbye"
40
+
41
+ index.add thing
42
+ index.add other
43
+
44
+ index
45
+ end
46
+ let(:try) { Picky::Search.new(index) { symbol_keys } }
47
+ it { try.search("hello text:ohai|text:kthxbye").ids.should == [1, 2] }
48
+ it { try.search("hello text:ohai|kthxbye").ids.should == [1, 2] }
49
+ it { try.search("hello ohai|text:kthxbye").ids.should == [1, 2] }
50
+ it { try.search("hello ohai|kthxbye").ids.should == [1, 2] }
51
+ it('still works') { try.search("hello text:ohai").ids.should == [1] }
52
+ end
53
+
32
54
  context 'more complex cases' do
33
55
  let(:index) do
34
56
  index = Picky::Index.new :or do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picky
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.25.1
4
+ version: 4.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke