dusen 0.4.3 → 0.4.4
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/dusen/util.rb +1 -1
- data/lib/dusen/version.rb +1 -1
- data/spec/rails-2.3/Gemfile +1 -1
- data/spec/rails-2.3/app_root/config/database.yml +1 -1
- data/spec/rails-3.0/Gemfile +1 -1
- data/spec/rails-3.0/app_root/config/database.yml +1 -1
- data/spec/rails-3.2/Gemfile +1 -1
- data/spec/rails-3.2/app_root/config/database.yml +1 -1
- data/spec/shared/spec/dusen/active_record/base_ext_spec.rb +6 -1
- data/spec/shared/spec/dusen/parser_spec.rb +5 -0
- data/spec/shared/spec/dusen/util_spec.rb +1 -0
- metadata +5 -6
data/lib/dusen/util.rb
CHANGED
data/lib/dusen/version.rb
CHANGED
data/spec/rails-2.3/Gemfile
CHANGED
data/spec/rails-3.0/Gemfile
CHANGED
data/spec/rails-3.2/Gemfile
CHANGED
@@ -64,10 +64,15 @@ shared_examples_for 'model with search syntax' do
|
|
64
64
|
it 'should find words where one letter is separated from other letters by a period' do
|
65
65
|
match = subject.create!(:name => 'E;ONNNEN')
|
66
66
|
subject.search('E;ONNNEN')
|
67
|
-
# debugger
|
68
67
|
subject.search('E;ONNNEN').to_a.should == [match]
|
69
68
|
end
|
70
69
|
|
70
|
+
it 'should distinguish between "Baden" and "Baden-Baden" (bugfix)' do
|
71
|
+
match = subject.create!(:city => 'Baden-Baden')
|
72
|
+
no_match = subject.create!(:city => 'Baden')
|
73
|
+
subject.search('Baden-Baden').all.should == [match]
|
74
|
+
end
|
75
|
+
|
71
76
|
end
|
72
77
|
|
73
78
|
describe '.search_syntax' do
|
@@ -9,6 +9,11 @@ describe Dusen::Parser do
|
|
9
9
|
query.collect(&:value).should == ['field1-value', 'field2-value', 'word1', 'word2']
|
10
10
|
end
|
11
11
|
|
12
|
+
it 'should not consider the dash to be a word boundary' do
|
13
|
+
query = Dusen::Parser.parse('Baden-Baden')
|
14
|
+
query.collect(&:value).should == ['Baden-Baden']
|
15
|
+
end
|
16
|
+
|
12
17
|
end
|
13
18
|
|
14
19
|
end
|
@@ -24,6 +24,7 @@ describe Dusen::Util do
|
|
24
24
|
Dusen::Util.normalize_word_boundaries("E.ON Bayern").should == 'EON Bayern'
|
25
25
|
Dusen::Util.normalize_word_boundaries("E.ON E.ON").should == 'EON EON'
|
26
26
|
Dusen::Util.normalize_word_boundaries("E;ON").should == 'EON'
|
27
|
+
Dusen::Util.normalize_word_boundaries("Baden-Baden").should == 'BadenBaden'
|
27
28
|
end
|
28
29
|
|
29
30
|
it 'should remove characters that MySQL would mistakenly consider a word boundary' do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dusen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 4
|
10
|
+
version: 0.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-03-15 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|
@@ -161,10 +161,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
requirements: []
|
162
162
|
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 1.8.
|
164
|
+
rubygems_version: 1.8.25
|
165
165
|
signing_key:
|
166
166
|
specification_version: 3
|
167
167
|
summary: Comprehensive full text search for ActiveRecord and MySQL
|
168
168
|
test_files: []
|
169
169
|
|
170
|
-
has_rdoc:
|