picky 4.27.0 → 4.27.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/picky/backends/file/json.rb +1 -1
- data/lib/picky/backends/google_hash.rb +5 -1
- data/lib/picky/backends/memory/basic.rb +0 -9
- data/lib/picky/backends/memory.rb +3 -2
- data/lib/picky/bundle.rb +2 -2
- data/lib/picky/categories.rb +1 -1
- data/lib/picky/category.rb +1 -1
- data/lib/picky/indexes.rb +1 -1
- data/lib/picky/qualifier_mapper.rb +1 -1
- data/lib/picky/query/token.rb +2 -3
- data/lib/picky/splitters/automatic.rb +2 -2
- data/spec/functional/no_dump_hint_spec.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a32ef9ec55047df769e8a264eee585bab738f5d
|
4
|
+
data.tar.gz: 6574e4c5d634313b160d0ff291a4c68e8ee9f553
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecbb19fb08c6e69ad40bc9a9d6b7416db8ad5b5fc1ac6d340070714cc1e02d70c01ed68fd0de8bd79628af5cb847126983b92c1f847b9bedbd5ffaa2134d85aa
|
7
|
+
data.tar.gz: 9fe9fbcd9109b245777bd48246d466078646a602260e278f73e9c0ba0233e2b69e852903af046412acdebc169072544435d8b2b0eef4d5a9ffdb8f0b400ea693
|
@@ -1,6 +1,8 @@
|
|
1
1
|
if require 'google_hash'
|
2
2
|
|
3
3
|
class ::GoogleHashSparseRubyToRuby
|
4
|
+
|
5
|
+
alias each_pair each
|
4
6
|
|
5
7
|
# This is mainly used in tests, which is
|
6
8
|
# why we allow for a silly implementation.
|
@@ -24,7 +26,7 @@ if require 'google_hash'
|
|
24
26
|
true
|
25
27
|
end
|
26
28
|
|
27
|
-
#
|
29
|
+
# TODO
|
28
30
|
#
|
29
31
|
def inject init, &block
|
30
32
|
result = init
|
@@ -34,6 +36,8 @@ if require 'google_hash'
|
|
34
36
|
result
|
35
37
|
end
|
36
38
|
|
39
|
+
# TODO
|
40
|
+
#
|
37
41
|
def size
|
38
42
|
result = 0
|
39
43
|
# each only accepts a block
|
@@ -45,15 +45,6 @@ module Picky
|
|
45
45
|
def empty
|
46
46
|
@empty && @empty.clone || hash_type.new
|
47
47
|
end
|
48
|
-
|
49
|
-
def empty_hash
|
50
|
-
# TODO Make this an explicit option.
|
51
|
-
if defined? GoogleHashSparseRubyToRuby
|
52
|
-
GoogleHashSparseRubyToRuby.new # TODO Use GoogleHashDenseIntToRuby where possible.
|
53
|
-
else
|
54
|
-
{}
|
55
|
-
end
|
56
|
-
end
|
57
48
|
|
58
49
|
# The initial content before loading from file/indexing.
|
59
50
|
#
|
@@ -44,14 +44,15 @@ module Picky
|
|
44
44
|
# object[id] # => [:sym1, :sym2]
|
45
45
|
#
|
46
46
|
def create_realtime bundle, hints = nil
|
47
|
-
|
47
|
+
# GoogleHashSparseLongToRuby # FIXME This is only true on number keys (add Picky hints).
|
48
|
+
json bundle.index_path(:realtime), hash_for(hints)
|
48
49
|
end
|
49
50
|
|
50
51
|
private
|
51
52
|
|
52
53
|
def hash_for hints
|
53
54
|
if hints && hints.does?(:no_dump)
|
54
|
-
::GoogleHashSparseRubyToRuby
|
55
|
+
::GoogleHashSparseRubyToRuby # TODO Use GoogleHashSparseIntToRuby where possible.
|
55
56
|
else
|
56
57
|
::Hash
|
57
58
|
end
|
data/lib/picky/bundle.rb
CHANGED
@@ -54,8 +54,8 @@ module Picky
|
|
54
54
|
@partial_strategy = partial_strategy
|
55
55
|
@similarity_strategy = similarity_strategy
|
56
56
|
|
57
|
-
@hints = options
|
58
|
-
@backend = options
|
57
|
+
@hints = options[:hints]
|
58
|
+
@backend = options[:backend]
|
59
59
|
|
60
60
|
reset_backend
|
61
61
|
end
|
data/lib/picky/categories.rb
CHANGED
data/lib/picky/category.rb
CHANGED
data/lib/picky/indexes.rb
CHANGED
data/lib/picky/query/token.rb
CHANGED
@@ -85,12 +85,11 @@ module Picky
|
|
85
85
|
|
86
86
|
# Generates a reused stem.
|
87
87
|
#
|
88
|
-
#
|
89
|
-
# the same stemmer will be used always.
|
88
|
+
# Caches a stem for a tokenizer.
|
90
89
|
#
|
91
90
|
def stem tokenizer
|
92
91
|
if stem?
|
93
|
-
@stems ||=
|
92
|
+
@stems ||= Hash.new
|
94
93
|
@stems[tokenizer] ||= tokenizer.stem(@text)
|
95
94
|
else
|
96
95
|
@text
|
@@ -27,9 +27,11 @@ describe "Hint: no_dump" do
|
|
27
27
|
it "raises" do
|
28
28
|
index.replace Book.new(2, "Title New", "Author New")
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
expect {
|
31
|
+
index.dump
|
32
|
+
index.load
|
33
|
+
index.build_realtime_mapping
|
34
|
+
}.to raise_error # TODO Clarify error.
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.27.
|
4
|
+
version: 4.27.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|