ximate 0.2.2 → 0.2.3
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.
- data/lib/ximate/search.rb +9 -7
- data/lib/ximate/version.rb +1 -1
- metadata +21 -30
data/lib/ximate/search.rb
CHANGED
@@ -88,13 +88,15 @@ module Ximate
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def update_index(locale = I18n.default_locale, &block)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
words.each do |
|
96
|
-
|
97
|
-
|
91
|
+
if DATA[locale]
|
92
|
+
table = self.class.to_s.underscore.pluralize.to_sym
|
93
|
+
remove_index(locale)
|
94
|
+
instance_eval(&block)
|
95
|
+
@words.each do |priority, words|
|
96
|
+
words.each do |word|
|
97
|
+
ids_ranks = (DATA[locale.to_sym][table][word] ||= {})
|
98
|
+
ids_ranks[self.id] = ids_ranks[self.id].to_i + priority
|
99
|
+
end
|
98
100
|
end
|
99
101
|
end
|
100
102
|
end
|
data/lib/ximate/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,24 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ximate
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.2.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Enrico Pilotto
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-06-15 00:00:00 +02:00
|
14
|
-
default_executable:
|
12
|
+
date: 2011-09-06 00:00:00.000000000Z
|
15
13
|
dependencies: []
|
16
|
-
|
17
14
|
description: Approximate fuzzy search for Ruby on Rails activerecord models.
|
18
|
-
email:
|
15
|
+
email:
|
19
16
|
- enrico@megiston.it
|
20
17
|
executables: []
|
21
|
-
|
22
|
-
extensions:
|
18
|
+
extensions:
|
23
19
|
- ext/extconf.rb
|
24
20
|
extra_rdoc_files: []
|
25
|
-
|
26
|
-
files:
|
21
|
+
files:
|
27
22
|
- .gitignore
|
28
23
|
- Gemfile
|
29
24
|
- README.rdoc
|
@@ -37,34 +32,30 @@ files:
|
|
37
32
|
- lib/ximate/search.rb
|
38
33
|
- lib/ximate/version.rb
|
39
34
|
- ximate.gemspec
|
40
|
-
has_rdoc: true
|
41
35
|
homepage: https://github.com/pioz/ximate
|
42
|
-
licenses:
|
36
|
+
licenses:
|
43
37
|
- MIT
|
44
38
|
post_install_message:
|
45
39
|
rdoc_options: []
|
46
|
-
|
47
|
-
require_paths:
|
40
|
+
require_paths:
|
48
41
|
- lib
|
49
42
|
- ext
|
50
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
44
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version:
|
56
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
50
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version:
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
62
55
|
requirements: []
|
63
|
-
|
64
56
|
rubyforge_project: ximate
|
65
|
-
rubygems_version: 1.6
|
57
|
+
rubygems_version: 1.8.6
|
66
58
|
signing_key:
|
67
59
|
specification_version: 3
|
68
60
|
summary: Approximate fuzzy search for Ruby on Rails
|
69
61
|
test_files: []
|
70
|
-
|