dusen 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -7,11 +7,16 @@ task :default => 'all:spec'
|
|
7
7
|
namespace :travis_ci do
|
8
8
|
|
9
9
|
desc 'Things to do before Travis CI begins'
|
10
|
-
task :prepare do
|
10
|
+
task :prepare => :slimgems do
|
11
11
|
Rake::Task['travis_ci:create_database'].invoke &&
|
12
12
|
Rake::Task['travis_ci:create_database_yml'].invoke
|
13
13
|
end
|
14
14
|
|
15
|
+
desc 'Install slimgems'
|
16
|
+
task :slimgems do
|
17
|
+
system('gem install slimgems')
|
18
|
+
end
|
19
|
+
|
15
20
|
desc 'Creates a test database'
|
16
21
|
task :create_database do
|
17
22
|
system("mysql -e 'create database dusen_test;'")
|
@@ -10,7 +10,7 @@ module Dusen
|
|
10
10
|
Dusen::Description.parse_syntax(@search_syntax, &dsl) if dsl
|
11
11
|
unless singleton_class.method_defined?(:search)
|
12
12
|
singleton_class.send(:define_method, :search) do |query_string|
|
13
|
-
@search_syntax.search(
|
13
|
+
@search_syntax.search(scoped({}), query_string)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
@search_syntax
|
data/lib/dusen/version.rb
CHANGED
data/spec/rails-2.3/Gemfile
CHANGED
@@ -70,7 +70,22 @@ shared_examples_for 'model with search syntax' do
|
|
70
70
|
it 'should distinguish between "Baden" and "Baden-Baden" (bugfix)' do
|
71
71
|
match = subject.create!(:city => 'Baden-Baden')
|
72
72
|
no_match = subject.create!(:city => 'Baden')
|
73
|
-
subject.search('Baden-Baden').
|
73
|
+
subject.search('Baden-Baden').to_a.should == [match]
|
74
|
+
end
|
75
|
+
|
76
|
+
context 'when the given query is blank' do
|
77
|
+
|
78
|
+
it 'returns all records' do
|
79
|
+
match = subject.create!
|
80
|
+
subject.search('').to_a.should == [match]
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'respects an existing scope chain' do
|
84
|
+
match = subject.create!(:name => 'Abraham')
|
85
|
+
no_match = subject.create!(:name => 'Elizabath')
|
86
|
+
subject.scoped(:conditions => { :name => 'Abraham' }).search('').to_a.should == [match]
|
87
|
+
end
|
88
|
+
|
74
89
|
end
|
75
90
|
|
76
91
|
end
|
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: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 5
|
10
|
+
version: 0.4.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-05-17 00:00:00 +02:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: rails
|
@@ -132,6 +133,7 @@ files:
|
|
132
133
|
- spec/shared/spec/dusen/parser_spec.rb
|
133
134
|
- spec/shared/spec/dusen/query_spec.rb
|
134
135
|
- spec/shared/spec/dusen/util_spec.rb
|
136
|
+
has_rdoc: true
|
135
137
|
homepage: https://github.com/makandra/dusen
|
136
138
|
licenses: []
|
137
139
|
|
@@ -161,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
163
|
requirements: []
|
162
164
|
|
163
165
|
rubyforge_project:
|
164
|
-
rubygems_version: 1.
|
166
|
+
rubygems_version: 1.3.9.5
|
165
167
|
signing_key:
|
166
168
|
specification_version: 3
|
167
169
|
summary: Comprehensive full text search for ActiveRecord and MySQL
|