thinking-sphinx 1.4.14 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/features/attribute_updates.feature +15 -13
  2. data/features/deleting_instances.feature +16 -13
  3. data/features/handling_edits.feature +20 -17
  4. data/features/searching_by_index.feature +6 -5
  5. data/features/step_definitions/common_steps.rb +8 -4
  6. data/features/support/env.rb +0 -3
  7. data/lib/thinking_sphinx.rb +8 -1
  8. data/lib/thinking_sphinx/active_record.rb +3 -3
  9. data/lib/thinking_sphinx/active_record/attribute_updates.rb +5 -4
  10. data/lib/thinking_sphinx/adapters/abstract_adapter.rb +7 -0
  11. data/lib/thinking_sphinx/auto_version.rb +1 -1
  12. data/lib/thinking_sphinx/bundled_search.rb +6 -10
  13. data/lib/thinking_sphinx/configuration.rb +19 -33
  14. data/lib/thinking_sphinx/connection.rb +71 -0
  15. data/lib/thinking_sphinx/deltas.rb +2 -0
  16. data/lib/thinking_sphinx/deltas/default_delta.rb +14 -18
  17. data/lib/thinking_sphinx/deltas/delete_job.rb +16 -0
  18. data/lib/thinking_sphinx/deltas/index_job.rb +17 -0
  19. data/lib/thinking_sphinx/search.rb +26 -14
  20. data/lib/thinking_sphinx/tasks.rb +1 -5
  21. data/spec/spec_helper.rb +0 -3
  22. data/spec/thinking_sphinx/active_record/delta_spec.rb +6 -5
  23. data/spec/thinking_sphinx/active_record/scopes_spec.rb +2 -1
  24. data/spec/thinking_sphinx/active_record_spec.rb +2 -2
  25. data/spec/thinking_sphinx/adapters/abstract_adapter_spec.rb +18 -0
  26. data/spec/thinking_sphinx/configuration_spec.rb +0 -68
  27. data/spec/thinking_sphinx/connection_spec.rb +77 -0
  28. data/spec/thinking_sphinx/facet_search_spec.rb +25 -25
  29. data/spec/thinking_sphinx/search_methods_spec.rb +34 -34
  30. data/spec/thinking_sphinx/search_spec.rb +4 -16
  31. metadata +48 -39
  32. data/lib/thinking_sphinx/version.rb +0 -3
  33. data/rails/init.rb +0 -16
  34. data/tasks/rails.rake +0 -1
@@ -6,18 +6,19 @@ describe ThinkingSphinx::Search do
6
6
  @config = ThinkingSphinx::Configuration.instance
7
7
  @client = Riddle::Client.new
8
8
 
9
- @config.stub!(:client => @client)
9
+ ThinkingSphinx::Connection.stub(:take).and_yield(@client)
10
+
10
11
  @client.stub!(:query => {:matches => [], :total_found => 41, :total => 41})
11
12
  end
12
13
 
13
14
  it "not request results from the client if not accessing items" do
14
- @config.should_not_receive(:client)
15
+ ThinkingSphinx::Connection.should_not_receive(:take)
15
16
 
16
17
  ThinkingSphinx::Search.new.class
17
18
  end
18
19
 
19
20
  it "should request results if access is required" do
20
- @config.should_receive(:client)
21
+ ThinkingSphinx::Connection.should_receive(:take).and_yield(@client)
21
22
 
22
23
  ThinkingSphinx::Search.new.first
23
24
  end
@@ -1418,19 +1419,6 @@ describe ThinkingSphinx::Search do
1418
1419
  @search.freeze.should be_a(ThinkingSphinx::Search)
1419
1420
  end
1420
1421
  end
1421
-
1422
- describe '#client' do
1423
- let(:client) { Riddle::Client.new }
1424
- it "should respect the client in options" do
1425
- search = ThinkingSphinx::Search.new :client => client
1426
- search.client.should == client
1427
- end
1428
-
1429
- it "should get a new client from the configuration singleton by default" do
1430
- ThinkingSphinx::Configuration.instance.stub!(:client => client)
1431
- ThinkingSphinx::Search.new.client.should == client
1432
- end
1433
- end
1434
1422
  end
1435
1423
 
1436
1424
  describe ThinkingSphinx::Search, "playing nice with Search model" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinking-sphinx
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 4
9
- - 14
10
- version: 1.4.14
8
+ - 5
9
+ - 0
10
+ version: 1.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Allan
@@ -15,29 +15,20 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-01-02 00:00:00 +11:00
18
+ date: 2013-05-07 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  requirement: &id001 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
- - - <
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
- hash: 7
28
- segments:
29
- - 3
30
- - 0
31
- - 0
32
- version: 3.0.0
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- hash: 39
27
+ hash: 1
36
28
  segments:
29
+ - 2
37
30
  - 1
38
- - 15
39
- - 6
40
- version: 1.15.6
31
+ version: "2.1"
41
32
  version_requirements: *id001
42
33
  name: activerecord
43
34
  prerelease: false
@@ -64,18 +55,34 @@ dependencies:
64
55
  requirements:
65
56
  - - ">="
66
57
  - !ruby/object:Gem::Version
67
- hash: 5
58
+ hash: 15
68
59
  segments:
69
60
  - 1
70
61
  - 5
71
- - 3
72
- version: 1.5.3
62
+ - 6
63
+ version: 1.5.6
73
64
  version_requirements: *id003
74
65
  name: riddle
75
66
  prerelease: false
76
67
  type: :runtime
77
68
  - !ruby/object:Gem::Dependency
78
69
  requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ~>
73
+ - !ruby/object:Gem::Version
74
+ hash: 19
75
+ segments:
76
+ - 1
77
+ - 0
78
+ - 2
79
+ version: 1.0.2
80
+ version_requirements: *id004
81
+ name: innertube
82
+ prerelease: false
83
+ type: :runtime
84
+ - !ruby/object:Gem::Dependency
85
+ requirement: &id005 !ruby/object:Gem::Requirement
79
86
  none: false
80
87
  requirements:
81
88
  - - "="
@@ -86,12 +93,12 @@ dependencies:
86
93
  - 4
87
94
  - 0
88
95
  version: 0.4.0
89
- version_requirements: *id004
96
+ version_requirements: *id005
90
97
  name: appraisal
91
98
  prerelease: false
92
99
  type: :development
93
100
  - !ruby/object:Gem::Dependency
94
- requirement: &id005 !ruby/object:Gem::Requirement
101
+ requirement: &id006 !ruby/object:Gem::Requirement
95
102
  none: false
96
103
  requirements:
97
104
  - - "="
@@ -102,12 +109,12 @@ dependencies:
102
109
  - 0
103
110
  - 2
104
111
  version: 1.0.2
105
- version_requirements: *id005
112
+ version_requirements: *id006
106
113
  name: cucumber
107
114
  prerelease: false
108
115
  type: :development
109
116
  - !ruby/object:Gem::Dependency
110
- requirement: &id006 !ruby/object:Gem::Requirement
117
+ requirement: &id007 !ruby/object:Gem::Requirement
111
118
  none: false
112
119
  requirements:
113
120
  - - "="
@@ -118,12 +125,12 @@ dependencies:
118
125
  - 3
119
126
  - 1
120
127
  version: 0.3.1
121
- version_requirements: *id006
128
+ version_requirements: *id007
122
129
  name: faker
123
130
  prerelease: false
124
131
  type: :development
125
132
  - !ruby/object:Gem::Dependency
126
- requirement: &id007 !ruby/object:Gem::Requirement
133
+ requirement: &id008 !ruby/object:Gem::Requirement
127
134
  none: false
128
135
  requirements:
129
136
  - - ">="
@@ -134,12 +141,12 @@ dependencies:
134
141
  - 9
135
142
  - 2
136
143
  version: 0.9.2
137
- version_requirements: *id007
144
+ version_requirements: *id008
138
145
  name: rake
139
146
  prerelease: false
140
147
  type: :development
141
148
  - !ruby/object:Gem::Dependency
142
- requirement: &id008 !ruby/object:Gem::Requirement
149
+ requirement: &id009 !ruby/object:Gem::Requirement
143
150
  none: false
144
151
  requirements:
145
152
  - - "="
@@ -150,12 +157,12 @@ dependencies:
150
157
  - 6
151
158
  - 0
152
159
  version: 2.6.0
153
- version_requirements: *id008
160
+ version_requirements: *id009
154
161
  name: rspec
155
162
  prerelease: false
156
163
  type: :development
157
164
  - !ruby/object:Gem::Dependency
158
- requirement: &id009 !ruby/object:Gem::Requirement
165
+ requirement: &id010 !ruby/object:Gem::Requirement
159
166
  none: false
160
167
  requirements:
161
168
  - - "="
@@ -166,12 +173,12 @@ dependencies:
166
173
  - 3
167
174
  - 15
168
175
  version: 2.3.15
169
- version_requirements: *id009
176
+ version_requirements: *id010
170
177
  name: will_paginate
171
178
  prerelease: false
172
179
  type: :development
173
180
  - !ruby/object:Gem::Dependency
174
- requirement: &id010 !ruby/object:Gem::Requirement
181
+ requirement: &id011 !ruby/object:Gem::Requirement
175
182
  none: false
176
183
  requirements:
177
184
  - - ">="
@@ -182,7 +189,7 @@ dependencies:
182
189
  - 7
183
190
  - 2
184
191
  version: 0.7.2
185
- version_requirements: *id010
192
+ version_requirements: *id011
186
193
  name: yard
187
194
  prerelease: false
188
195
  type: :development
@@ -216,10 +223,13 @@ files:
216
223
  - lib/thinking_sphinx/bundled_search.rb
217
224
  - lib/thinking_sphinx/class_facet.rb
218
225
  - lib/thinking_sphinx/configuration.rb
226
+ - lib/thinking_sphinx/connection.rb
219
227
  - lib/thinking_sphinx/context.rb
220
228
  - lib/thinking_sphinx/core/string.rb
221
229
  - lib/thinking_sphinx/deltas.rb
222
230
  - lib/thinking_sphinx/deltas/default_delta.rb
231
+ - lib/thinking_sphinx/deltas/delete_job.rb
232
+ - lib/thinking_sphinx/deltas/index_job.rb
223
233
  - lib/thinking_sphinx/deploy/capistrano.rb
224
234
  - lib/thinking_sphinx/excerpter.rb
225
235
  - lib/thinking_sphinx/facet.rb
@@ -238,11 +248,8 @@ files:
238
248
  - lib/thinking_sphinx/source/sql.rb
239
249
  - lib/thinking_sphinx/tasks.rb
240
250
  - lib/thinking_sphinx/test.rb
241
- - lib/thinking_sphinx/version.rb
242
- - rails/init.rb
243
251
  - LICENCE
244
252
  - README.textile
245
- - tasks/rails.rake
246
253
  - features/abstract_inheritance.feature
247
254
  - features/alternate_primary_key.feature
248
255
  - features/attribute_transformation.feature
@@ -350,6 +357,7 @@ files:
350
357
  - spec/thinking_sphinx/attribute_spec.rb
351
358
  - spec/thinking_sphinx/auto_version_spec.rb
352
359
  - spec/thinking_sphinx/configuration_spec.rb
360
+ - spec/thinking_sphinx/connection_spec.rb
353
361
  - spec/thinking_sphinx/context_spec.rb
354
362
  - spec/thinking_sphinx/core/array_spec.rb
355
363
  - spec/thinking_sphinx/core/string_spec.rb
@@ -367,12 +375,12 @@ files:
367
375
  - spec/thinking_sphinx/test_spec.rb
368
376
  - spec/thinking_sphinx_spec.rb
369
377
  has_rdoc: true
370
- homepage: http://pat.github.com/ts/en/
378
+ homepage: http://pat.github.io/thinking-sphinx/
371
379
  licenses: []
372
380
 
373
381
  post_install_message: |+
374
382
  If you're upgrading, you should read this:
375
- http://pat.github.com/ts/en/upgrading.html
383
+ http://pat.github.io/thinking-sphinx/upgrading.html
376
384
 
377
385
  rdoc_options: []
378
386
 
@@ -511,6 +519,7 @@ test_files:
511
519
  - spec/thinking_sphinx/attribute_spec.rb
512
520
  - spec/thinking_sphinx/auto_version_spec.rb
513
521
  - spec/thinking_sphinx/configuration_spec.rb
522
+ - spec/thinking_sphinx/connection_spec.rb
514
523
  - spec/thinking_sphinx/context_spec.rb
515
524
  - spec/thinking_sphinx/core/array_spec.rb
516
525
  - spec/thinking_sphinx/core/string_spec.rb
@@ -1,3 +0,0 @@
1
- module ThinkingSphinx
2
- Version = '1.4.14'
3
- end
@@ -1,16 +0,0 @@
1
- Dir[File.join(File.dirname(__FILE__), '../vendor/*/lib')].each do |path|
2
- $LOAD_PATH.unshift path
3
- end
4
-
5
- require 'thinking_sphinx'
6
- require 'action_controller/dispatcher'
7
-
8
- ActionController::Dispatcher.to_prepare :thinking_sphinx do
9
- # Force internationalisation to be loaded.
10
- if Rails::VERSION::STRING.to_f > 2.2
11
- I18n.backend.reload!
12
- I18n.backend.available_locales
13
- elsif Rails::VERSION::STRING.to_f > 2.1
14
- I18n.backend.load_translations(*I18n.load_path)
15
- end
16
- end
@@ -1 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '/../lib/thinking_sphinx/tasks')