fuzzily 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +7 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +12 -12
- data/LICENSE.txt +1 -1
- data/README.md +2 -0
- data/fuzzily.gemspec +2 -1
- data/gemfiles/rails23.gemfile.lock +18 -18
- data/gemfiles/rails30.gemfile.lock +17 -17
- data/gemfiles/rails31.gemfile.lock +24 -24
- data/gemfiles/rails32.gemfile.lock +25 -25
- data/gemfiles/rails32_mysql.gemfile.lock +25 -25
- data/gemfiles/rails32_pg.gemfile.lock +25 -25
- data/lib/fuzzily/searchable.rb +1 -0
- data/lib/fuzzily/trigram.rb +1 -1
- data/lib/fuzzily/version.rb +1 -1
- data/spec/fuzzily/searchable_spec.rb +17 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7405e2a5492b3d3ebc3a3af29130fe2b105d9d00
|
4
|
+
data.tar.gz: cff5f7936cdd377ba57975341457e1a9c3941038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b42bc03dbc0e11415ba757ee9e5dd56e99055def2a368d82968ec7fcb30a3eab90c9f0065b4b0ad5e10bbc0176b31c4998a0dcd976e10809a45bb2e4e0e069cd
|
7
|
+
data.tar.gz: bc411000aedc0213f1b884080406fb8d611bb24169d10a852d04f29015051e150230e49277be2885cf0248211e95eda7ec8afeffe9db52a17636b49b3c80741a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0-p247
|
data/.travis.yml
CHANGED
@@ -10,6 +10,13 @@ gemfile:
|
|
10
10
|
- gemfiles/rails32.gemfile
|
11
11
|
- gemfiles/rails32_pg.gemfile
|
12
12
|
- gemfiles/rails32_mysql.gemfile
|
13
|
+
before_install: bundle install
|
14
|
+
bundler_args:
|
15
|
+
matrix:
|
16
|
+
exclude:
|
17
|
+
- rvm: 2.0.0
|
18
|
+
gemfile: gemfiles/rails23.gemfile
|
19
|
+
env: TRAVIS=TRUE
|
13
20
|
before_script:
|
14
21
|
- psql -c 'create database fuzzily_test;' -U postgres
|
15
22
|
- mysql -e 'create database fuzzily_test;'
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fuzzily (0.2.
|
4
|
+
fuzzily (0.2.4)
|
5
5
|
activerecord (>= 2.3.17)
|
6
6
|
|
7
7
|
GEM
|
8
|
-
remote:
|
8
|
+
remote: http://yarp.dev/
|
9
9
|
specs:
|
10
|
-
activemodel (3.2.
|
11
|
-
activesupport (= 3.2.
|
10
|
+
activemodel (3.2.14)
|
11
|
+
activesupport (= 3.2.14)
|
12
12
|
builder (~> 3.0.0)
|
13
|
-
activerecord (3.2.
|
14
|
-
activemodel (= 3.2.
|
15
|
-
activesupport (= 3.2.
|
13
|
+
activerecord (3.2.14)
|
14
|
+
activemodel (= 3.2.14)
|
15
|
+
activesupport (= 3.2.14)
|
16
16
|
arel (~> 3.0.2)
|
17
17
|
tzinfo (~> 0.3.29)
|
18
|
-
activesupport (3.2.
|
19
|
-
i18n (
|
18
|
+
activesupport (3.2.14)
|
19
|
+
i18n (~> 0.6, >= 0.6.4)
|
20
20
|
multi_json (~> 1.0)
|
21
21
|
appraisal (0.5.2)
|
22
22
|
bundler
|
@@ -32,10 +32,10 @@ GEM
|
|
32
32
|
simplecov (>= 0.7)
|
33
33
|
thor
|
34
34
|
diff-lcs (1.2.4)
|
35
|
-
i18n (0.6.
|
35
|
+
i18n (0.6.5)
|
36
36
|
method_source (0.8.1)
|
37
37
|
mime-types (1.23)
|
38
|
-
multi_json (1.7.
|
38
|
+
multi_json (1.7.9)
|
39
39
|
mysql2 (0.3.11)
|
40
40
|
pg (0.15.1)
|
41
41
|
pry (0.9.12.1)
|
@@ -44,7 +44,7 @@ GEM
|
|
44
44
|
slop (~> 3.4)
|
45
45
|
pry-nav (0.2.3)
|
46
46
|
pry (~> 0.9.10)
|
47
|
-
rake (10.0
|
47
|
+
rake (10.1.0)
|
48
48
|
rest-client (1.6.7)
|
49
49
|
mime-types (>= 1.16)
|
50
50
|
rspec (2.13.0)
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
data/fuzzily.gemspec
CHANGED
@@ -10,7 +10,8 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["julien.letessier@gmail.com"]
|
11
11
|
gem.description = %q{Fast fuzzy string matching for rails}
|
12
12
|
gem.summary = %q{A fast, trigram-based, database-backed fuzzy string search/match engine for Rails.}
|
13
|
-
gem.homepage = ""
|
13
|
+
gem.homepage = "http://github.com/mezis/fuzzily"
|
14
|
+
gem.license = 'MIT'
|
14
15
|
|
15
16
|
gem.add_runtime_dependency 'activerecord', '>= 2.3.17'
|
16
17
|
|
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/mezis/Dropbox/Development/fuzzily
|
3
3
|
specs:
|
4
|
-
fuzzily (0.2.
|
4
|
+
fuzzily (0.2.4)
|
5
5
|
activerecord (>= 2.3.17)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activerecord (2.3.
|
11
|
-
activesupport (= 2.3.
|
12
|
-
activesupport (2.3.
|
10
|
+
activerecord (2.3.18)
|
11
|
+
activesupport (= 2.3.18)
|
12
|
+
activesupport (2.3.18)
|
13
13
|
appraisal (0.5.2)
|
14
14
|
bundler
|
15
15
|
rake
|
@@ -22,28 +22,28 @@ GEM
|
|
22
22
|
simplecov (>= 0.7)
|
23
23
|
thor
|
24
24
|
diff-lcs (1.2.4)
|
25
|
-
method_source (0.8.
|
26
|
-
mime-types (1.
|
27
|
-
multi_json (1.7.
|
28
|
-
mysql2 (0.3.
|
29
|
-
pg (0.
|
30
|
-
pry (0.9.12.
|
25
|
+
method_source (0.8.2)
|
26
|
+
mime-types (1.25)
|
27
|
+
multi_json (1.7.9)
|
28
|
+
mysql2 (0.3.13)
|
29
|
+
pg (0.16.0)
|
30
|
+
pry (0.9.12.2)
|
31
31
|
coderay (~> 1.0.5)
|
32
32
|
method_source (~> 0.8)
|
33
33
|
slop (~> 3.4)
|
34
34
|
pry-nav (0.2.3)
|
35
35
|
pry (~> 0.9.10)
|
36
|
-
rake (10.0
|
36
|
+
rake (10.1.0)
|
37
37
|
rest-client (1.6.7)
|
38
38
|
mime-types (>= 1.16)
|
39
|
-
rspec (2.
|
40
|
-
rspec-core (~> 2.
|
41
|
-
rspec-expectations (~> 2.
|
42
|
-
rspec-mocks (~> 2.
|
43
|
-
rspec-core (2.
|
44
|
-
rspec-expectations (2.
|
39
|
+
rspec (2.14.1)
|
40
|
+
rspec-core (~> 2.14.0)
|
41
|
+
rspec-expectations (~> 2.14.0)
|
42
|
+
rspec-mocks (~> 2.14.0)
|
43
|
+
rspec-core (2.14.5)
|
44
|
+
rspec-expectations (2.14.2)
|
45
45
|
diff-lcs (>= 1.1.3, < 2.0)
|
46
|
-
rspec-mocks (2.
|
46
|
+
rspec-mocks (2.14.3)
|
47
47
|
simplecov (0.7.1)
|
48
48
|
multi_json (~> 1.0)
|
49
49
|
simplecov-html (~> 0.7.1)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/mezis/Dropbox/Development/fuzzily
|
3
3
|
specs:
|
4
|
-
fuzzily (0.2.
|
4
|
+
fuzzily (0.2.4)
|
5
5
|
activerecord (>= 2.3.17)
|
6
6
|
|
7
7
|
GEM
|
@@ -32,34 +32,34 @@ GEM
|
|
32
32
|
thor
|
33
33
|
diff-lcs (1.2.4)
|
34
34
|
i18n (0.5.0)
|
35
|
-
method_source (0.8.
|
36
|
-
mime-types (1.
|
37
|
-
multi_json (1.7.
|
38
|
-
mysql2 (0.3.
|
39
|
-
pg (0.
|
40
|
-
pry (0.9.12.
|
35
|
+
method_source (0.8.2)
|
36
|
+
mime-types (1.25)
|
37
|
+
multi_json (1.7.9)
|
38
|
+
mysql2 (0.3.13)
|
39
|
+
pg (0.16.0)
|
40
|
+
pry (0.9.12.2)
|
41
41
|
coderay (~> 1.0.5)
|
42
42
|
method_source (~> 0.8)
|
43
43
|
slop (~> 3.4)
|
44
44
|
pry-nav (0.2.3)
|
45
45
|
pry (~> 0.9.10)
|
46
|
-
rake (10.0
|
46
|
+
rake (10.1.0)
|
47
47
|
rest-client (1.6.7)
|
48
48
|
mime-types (>= 1.16)
|
49
|
-
rspec (2.
|
50
|
-
rspec-core (~> 2.
|
51
|
-
rspec-expectations (~> 2.
|
52
|
-
rspec-mocks (~> 2.
|
53
|
-
rspec-core (2.
|
54
|
-
rspec-expectations (2.
|
49
|
+
rspec (2.14.1)
|
50
|
+
rspec-core (~> 2.14.0)
|
51
|
+
rspec-expectations (~> 2.14.0)
|
52
|
+
rspec-mocks (~> 2.14.0)
|
53
|
+
rspec-core (2.14.5)
|
54
|
+
rspec-expectations (2.14.2)
|
55
55
|
diff-lcs (>= 1.1.3, < 2.0)
|
56
|
-
rspec-mocks (2.
|
56
|
+
rspec-mocks (2.14.3)
|
57
57
|
simplecov (0.7.1)
|
58
58
|
multi_json (~> 1.0)
|
59
59
|
simplecov-html (~> 0.7.1)
|
60
60
|
simplecov-html (0.7.1)
|
61
|
-
slop (3.4.
|
62
|
-
sqlite3 (1.3.
|
61
|
+
slop (3.4.6)
|
62
|
+
sqlite3 (1.3.8)
|
63
63
|
thor (0.18.1)
|
64
64
|
tzinfo (0.3.37)
|
65
65
|
|
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/mezis/Dropbox/Development/fuzzily
|
3
3
|
specs:
|
4
|
-
fuzzily (0.2.
|
4
|
+
fuzzily (0.2.4)
|
5
5
|
activerecord (>= 2.3.17)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (3.1.
|
11
|
-
activesupport (= 3.1.
|
10
|
+
activemodel (3.1.12)
|
11
|
+
activesupport (= 3.1.12)
|
12
12
|
builder (~> 3.0.0)
|
13
13
|
i18n (~> 0.6)
|
14
|
-
activerecord (3.1.
|
15
|
-
activemodel (= 3.1.
|
16
|
-
activesupport (= 3.1.
|
14
|
+
activerecord (3.1.12)
|
15
|
+
activemodel (= 3.1.12)
|
16
|
+
activesupport (= 3.1.12)
|
17
17
|
arel (~> 2.2.3)
|
18
18
|
tzinfo (~> 0.3.29)
|
19
|
-
activesupport (3.1.
|
19
|
+
activesupport (3.1.12)
|
20
20
|
multi_json (~> 1.0)
|
21
21
|
appraisal (0.5.2)
|
22
22
|
bundler
|
@@ -32,35 +32,35 @@ GEM
|
|
32
32
|
simplecov (>= 0.7)
|
33
33
|
thor
|
34
34
|
diff-lcs (1.2.4)
|
35
|
-
i18n (0.6.
|
36
|
-
method_source (0.8.
|
37
|
-
mime-types (1.
|
38
|
-
multi_json (1.7.
|
39
|
-
mysql2 (0.3.
|
40
|
-
pg (0.
|
41
|
-
pry (0.9.12.
|
35
|
+
i18n (0.6.5)
|
36
|
+
method_source (0.8.2)
|
37
|
+
mime-types (1.25)
|
38
|
+
multi_json (1.7.9)
|
39
|
+
mysql2 (0.3.13)
|
40
|
+
pg (0.16.0)
|
41
|
+
pry (0.9.12.2)
|
42
42
|
coderay (~> 1.0.5)
|
43
43
|
method_source (~> 0.8)
|
44
44
|
slop (~> 3.4)
|
45
45
|
pry-nav (0.2.3)
|
46
46
|
pry (~> 0.9.10)
|
47
|
-
rake (10.0
|
47
|
+
rake (10.1.0)
|
48
48
|
rest-client (1.6.7)
|
49
49
|
mime-types (>= 1.16)
|
50
|
-
rspec (2.
|
51
|
-
rspec-core (~> 2.
|
52
|
-
rspec-expectations (~> 2.
|
53
|
-
rspec-mocks (~> 2.
|
54
|
-
rspec-core (2.
|
55
|
-
rspec-expectations (2.
|
50
|
+
rspec (2.14.1)
|
51
|
+
rspec-core (~> 2.14.0)
|
52
|
+
rspec-expectations (~> 2.14.0)
|
53
|
+
rspec-mocks (~> 2.14.0)
|
54
|
+
rspec-core (2.14.5)
|
55
|
+
rspec-expectations (2.14.2)
|
56
56
|
diff-lcs (>= 1.1.3, < 2.0)
|
57
|
-
rspec-mocks (2.
|
57
|
+
rspec-mocks (2.14.3)
|
58
58
|
simplecov (0.7.1)
|
59
59
|
multi_json (~> 1.0)
|
60
60
|
simplecov-html (~> 0.7.1)
|
61
61
|
simplecov-html (0.7.1)
|
62
|
-
slop (3.4.
|
63
|
-
sqlite3 (1.3.
|
62
|
+
slop (3.4.6)
|
63
|
+
sqlite3 (1.3.8)
|
64
64
|
thor (0.18.1)
|
65
65
|
tzinfo (0.3.37)
|
66
66
|
|
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/mezis/Dropbox/Development/fuzzily
|
3
3
|
specs:
|
4
|
-
fuzzily (0.2.
|
4
|
+
fuzzily (0.2.4)
|
5
5
|
activerecord (>= 2.3.17)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (3.2.
|
11
|
-
activesupport (= 3.2.
|
10
|
+
activemodel (3.2.14)
|
11
|
+
activesupport (= 3.2.14)
|
12
12
|
builder (~> 3.0.0)
|
13
|
-
activerecord (3.2.
|
14
|
-
activemodel (= 3.2.
|
15
|
-
activesupport (= 3.2.
|
13
|
+
activerecord (3.2.14)
|
14
|
+
activemodel (= 3.2.14)
|
15
|
+
activesupport (= 3.2.14)
|
16
16
|
arel (~> 3.0.2)
|
17
17
|
tzinfo (~> 0.3.29)
|
18
|
-
activesupport (3.2.
|
19
|
-
i18n (
|
18
|
+
activesupport (3.2.14)
|
19
|
+
i18n (~> 0.6, >= 0.6.4)
|
20
20
|
multi_json (~> 1.0)
|
21
21
|
appraisal (0.5.2)
|
22
22
|
bundler
|
@@ -32,35 +32,35 @@ GEM
|
|
32
32
|
simplecov (>= 0.7)
|
33
33
|
thor
|
34
34
|
diff-lcs (1.2.4)
|
35
|
-
i18n (0.6.
|
36
|
-
method_source (0.8.
|
37
|
-
mime-types (1.
|
38
|
-
multi_json (1.7.
|
39
|
-
mysql2 (0.3.
|
40
|
-
pg (0.
|
41
|
-
pry (0.9.12.
|
35
|
+
i18n (0.6.5)
|
36
|
+
method_source (0.8.2)
|
37
|
+
mime-types (1.25)
|
38
|
+
multi_json (1.7.9)
|
39
|
+
mysql2 (0.3.13)
|
40
|
+
pg (0.16.0)
|
41
|
+
pry (0.9.12.2)
|
42
42
|
coderay (~> 1.0.5)
|
43
43
|
method_source (~> 0.8)
|
44
44
|
slop (~> 3.4)
|
45
45
|
pry-nav (0.2.3)
|
46
46
|
pry (~> 0.9.10)
|
47
|
-
rake (10.0
|
47
|
+
rake (10.1.0)
|
48
48
|
rest-client (1.6.7)
|
49
49
|
mime-types (>= 1.16)
|
50
|
-
rspec (2.
|
51
|
-
rspec-core (~> 2.
|
52
|
-
rspec-expectations (~> 2.
|
53
|
-
rspec-mocks (~> 2.
|
54
|
-
rspec-core (2.
|
55
|
-
rspec-expectations (2.
|
50
|
+
rspec (2.14.1)
|
51
|
+
rspec-core (~> 2.14.0)
|
52
|
+
rspec-expectations (~> 2.14.0)
|
53
|
+
rspec-mocks (~> 2.14.0)
|
54
|
+
rspec-core (2.14.5)
|
55
|
+
rspec-expectations (2.14.2)
|
56
56
|
diff-lcs (>= 1.1.3, < 2.0)
|
57
|
-
rspec-mocks (2.
|
57
|
+
rspec-mocks (2.14.3)
|
58
58
|
simplecov (0.7.1)
|
59
59
|
multi_json (~> 1.0)
|
60
60
|
simplecov-html (~> 0.7.1)
|
61
61
|
simplecov-html (0.7.1)
|
62
|
-
slop (3.4.
|
63
|
-
sqlite3 (1.3.
|
62
|
+
slop (3.4.6)
|
63
|
+
sqlite3 (1.3.8)
|
64
64
|
thor (0.18.1)
|
65
65
|
tzinfo (0.3.37)
|
66
66
|
|
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/mezis/Dropbox/Development/fuzzily
|
3
3
|
specs:
|
4
|
-
fuzzily (0.2.
|
4
|
+
fuzzily (0.2.4)
|
5
5
|
activerecord (>= 2.3.17)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (3.2.
|
11
|
-
activesupport (= 3.2.
|
10
|
+
activemodel (3.2.14)
|
11
|
+
activesupport (= 3.2.14)
|
12
12
|
builder (~> 3.0.0)
|
13
|
-
activerecord (3.2.
|
14
|
-
activemodel (= 3.2.
|
15
|
-
activesupport (= 3.2.
|
13
|
+
activerecord (3.2.14)
|
14
|
+
activemodel (= 3.2.14)
|
15
|
+
activesupport (= 3.2.14)
|
16
16
|
arel (~> 3.0.2)
|
17
17
|
tzinfo (~> 0.3.29)
|
18
|
-
activesupport (3.2.
|
19
|
-
i18n (
|
18
|
+
activesupport (3.2.14)
|
19
|
+
i18n (~> 0.6, >= 0.6.4)
|
20
20
|
multi_json (~> 1.0)
|
21
21
|
appraisal (0.5.2)
|
22
22
|
bundler
|
@@ -32,35 +32,35 @@ GEM
|
|
32
32
|
simplecov (>= 0.7)
|
33
33
|
thor
|
34
34
|
diff-lcs (1.2.4)
|
35
|
-
i18n (0.6.
|
36
|
-
method_source (0.8.
|
37
|
-
mime-types (1.
|
38
|
-
multi_json (1.7.
|
39
|
-
mysql2 (0.3.
|
40
|
-
pg (0.
|
41
|
-
pry (0.9.12.
|
35
|
+
i18n (0.6.5)
|
36
|
+
method_source (0.8.2)
|
37
|
+
mime-types (1.25)
|
38
|
+
multi_json (1.7.9)
|
39
|
+
mysql2 (0.3.13)
|
40
|
+
pg (0.16.0)
|
41
|
+
pry (0.9.12.2)
|
42
42
|
coderay (~> 1.0.5)
|
43
43
|
method_source (~> 0.8)
|
44
44
|
slop (~> 3.4)
|
45
45
|
pry-nav (0.2.3)
|
46
46
|
pry (~> 0.9.10)
|
47
|
-
rake (10.0
|
47
|
+
rake (10.1.0)
|
48
48
|
rest-client (1.6.7)
|
49
49
|
mime-types (>= 1.16)
|
50
|
-
rspec (2.
|
51
|
-
rspec-core (~> 2.
|
52
|
-
rspec-expectations (~> 2.
|
53
|
-
rspec-mocks (~> 2.
|
54
|
-
rspec-core (2.
|
55
|
-
rspec-expectations (2.
|
50
|
+
rspec (2.14.1)
|
51
|
+
rspec-core (~> 2.14.0)
|
52
|
+
rspec-expectations (~> 2.14.0)
|
53
|
+
rspec-mocks (~> 2.14.0)
|
54
|
+
rspec-core (2.14.5)
|
55
|
+
rspec-expectations (2.14.2)
|
56
56
|
diff-lcs (>= 1.1.3, < 2.0)
|
57
|
-
rspec-mocks (2.
|
57
|
+
rspec-mocks (2.14.3)
|
58
58
|
simplecov (0.7.1)
|
59
59
|
multi_json (~> 1.0)
|
60
60
|
simplecov-html (~> 0.7.1)
|
61
61
|
simplecov-html (0.7.1)
|
62
|
-
slop (3.4.
|
63
|
-
sqlite3 (1.3.
|
62
|
+
slop (3.4.6)
|
63
|
+
sqlite3 (1.3.8)
|
64
64
|
thor (0.18.1)
|
65
65
|
tzinfo (0.3.37)
|
66
66
|
|
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/mezis/Dropbox/Development/fuzzily
|
3
3
|
specs:
|
4
|
-
fuzzily (0.2.
|
4
|
+
fuzzily (0.2.4)
|
5
5
|
activerecord (>= 2.3.17)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (3.2.
|
11
|
-
activesupport (= 3.2.
|
10
|
+
activemodel (3.2.14)
|
11
|
+
activesupport (= 3.2.14)
|
12
12
|
builder (~> 3.0.0)
|
13
|
-
activerecord (3.2.
|
14
|
-
activemodel (= 3.2.
|
15
|
-
activesupport (= 3.2.
|
13
|
+
activerecord (3.2.14)
|
14
|
+
activemodel (= 3.2.14)
|
15
|
+
activesupport (= 3.2.14)
|
16
16
|
arel (~> 3.0.2)
|
17
17
|
tzinfo (~> 0.3.29)
|
18
|
-
activesupport (3.2.
|
19
|
-
i18n (
|
18
|
+
activesupport (3.2.14)
|
19
|
+
i18n (~> 0.6, >= 0.6.4)
|
20
20
|
multi_json (~> 1.0)
|
21
21
|
appraisal (0.5.2)
|
22
22
|
bundler
|
@@ -32,35 +32,35 @@ GEM
|
|
32
32
|
simplecov (>= 0.7)
|
33
33
|
thor
|
34
34
|
diff-lcs (1.2.4)
|
35
|
-
i18n (0.6.
|
36
|
-
method_source (0.8.
|
37
|
-
mime-types (1.
|
38
|
-
multi_json (1.7.
|
39
|
-
mysql2 (0.3.
|
40
|
-
pg (0.
|
41
|
-
pry (0.9.12.
|
35
|
+
i18n (0.6.5)
|
36
|
+
method_source (0.8.2)
|
37
|
+
mime-types (1.25)
|
38
|
+
multi_json (1.7.9)
|
39
|
+
mysql2 (0.3.13)
|
40
|
+
pg (0.16.0)
|
41
|
+
pry (0.9.12.2)
|
42
42
|
coderay (~> 1.0.5)
|
43
43
|
method_source (~> 0.8)
|
44
44
|
slop (~> 3.4)
|
45
45
|
pry-nav (0.2.3)
|
46
46
|
pry (~> 0.9.10)
|
47
|
-
rake (10.0
|
47
|
+
rake (10.1.0)
|
48
48
|
rest-client (1.6.7)
|
49
49
|
mime-types (>= 1.16)
|
50
|
-
rspec (2.
|
51
|
-
rspec-core (~> 2.
|
52
|
-
rspec-expectations (~> 2.
|
53
|
-
rspec-mocks (~> 2.
|
54
|
-
rspec-core (2.
|
55
|
-
rspec-expectations (2.
|
50
|
+
rspec (2.14.1)
|
51
|
+
rspec-core (~> 2.14.0)
|
52
|
+
rspec-expectations (~> 2.14.0)
|
53
|
+
rspec-mocks (~> 2.14.0)
|
54
|
+
rspec-core (2.14.5)
|
55
|
+
rspec-expectations (2.14.2)
|
56
56
|
diff-lcs (>= 1.1.3, < 2.0)
|
57
|
-
rspec-mocks (2.
|
57
|
+
rspec-mocks (2.14.3)
|
58
58
|
simplecov (0.7.1)
|
59
59
|
multi_json (~> 1.0)
|
60
60
|
simplecov-html (~> 0.7.1)
|
61
61
|
simplecov-html (0.7.1)
|
62
|
-
slop (3.4.
|
63
|
-
sqlite3 (1.3.
|
62
|
+
slop (3.4.6)
|
63
|
+
sqlite3 (1.3.8)
|
64
64
|
thor (0.18.1)
|
65
65
|
tzinfo (0.3.37)
|
66
66
|
|
data/lib/fuzzily/searchable.rb
CHANGED
data/lib/fuzzily/trigram.rb
CHANGED
@@ -4,6 +4,7 @@ module Fuzzily
|
|
4
4
|
class String < SimpleDelegator
|
5
5
|
|
6
6
|
def trigrams
|
7
|
+
return [] if __getobj__.nil?
|
7
8
|
normalized = self.normalize
|
8
9
|
number_of_trigrams = normalized.length - 3
|
9
10
|
trigrams = (0..number_of_trigrams).map { |index| normalized[index,3] }.uniq
|
@@ -18,7 +19,6 @@ module Fuzzily
|
|
18
19
|
# Remove accents, downcase, replace spaces and word start with '*',
|
19
20
|
# return list of normalized words
|
20
21
|
def normalize
|
21
|
-
# Iconv.iconv('ascii//translit//ignore', 'utf-8', self).first.
|
22
22
|
ActiveSupport::Multibyte::Chars.new(self).
|
23
23
|
mb_chars.normalize(:kd).gsub(/[^\x00-\x7F]/,'').downcase.to_s.
|
24
24
|
gsub(/[^a-z]/,' ').
|
data/lib/fuzzily/version.rb
CHANGED
@@ -62,13 +62,22 @@ describe Fuzzily::Searchable do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
describe '#update_fuzzy_<field>!' do
|
65
|
-
|
65
|
+
before do
|
66
66
|
subject.fuzzily_searchable :name
|
67
|
+
end
|
68
|
+
|
69
|
+
it 're-creates trigrams' do
|
67
70
|
subject.create(:name => 'Paris')
|
68
71
|
old_ids = Trigram.all.map(&:id)
|
69
72
|
subject.last.update_fuzzy_name!
|
70
73
|
(old_ids & Trigram.all.map(&:id)).should be_empty
|
71
74
|
end
|
75
|
+
|
76
|
+
it 'ignores nil values' do
|
77
|
+
subject.create(:name => nil)
|
78
|
+
subject.last.update_fuzzy_name!
|
79
|
+
Trigram.all.should be_empty
|
80
|
+
end
|
72
81
|
end
|
73
82
|
|
74
83
|
describe '.bulk_update_fuzzy_<field>' do
|
@@ -80,6 +89,13 @@ describe Fuzzily::Searchable do
|
|
80
89
|
subject.bulk_update_fuzzy_name
|
81
90
|
Trigram.all.should_not be_empty
|
82
91
|
end
|
92
|
+
|
93
|
+
it 'ignores nil values' do
|
94
|
+
subject.create(:name => nil)
|
95
|
+
Trigram.delete_all
|
96
|
+
subject.bulk_update_fuzzy_name
|
97
|
+
Trigram.all.should be_empty
|
98
|
+
end
|
83
99
|
end
|
84
100
|
|
85
101
|
context '(integrationg test)' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuzzily
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -192,8 +192,9 @@ files:
|
|
192
192
|
- spec/fuzzily/trigram_spec.rb
|
193
193
|
- spec/meta_spec.rb
|
194
194
|
- spec/spec_helper.rb
|
195
|
-
homepage:
|
196
|
-
licenses:
|
195
|
+
homepage: http://github.com/mezis/fuzzily
|
196
|
+
licenses:
|
197
|
+
- MIT
|
197
198
|
metadata: {}
|
198
199
|
post_install_message:
|
199
200
|
rdoc_options: []
|