thinking-sphinx 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. data/VERSION.yml +1 -1
  2. data/features/support/env.rb +2 -1
  3. data/lib/thinking_sphinx.rb +0 -1
  4. data/lib/thinking_sphinx/0.9.8.rb +3 -0
  5. data/lib/thinking_sphinx/0.9.9.rb +3 -0
  6. data/rails/init.rb +1 -1
  7. data/tasks/distribution.rb +3 -4
  8. metadata +24 -26
  9. data/vendor/after_commit/LICENSE +0 -20
  10. data/vendor/after_commit/README +0 -16
  11. data/vendor/after_commit/Rakefile +0 -22
  12. data/vendor/after_commit/init.rb +0 -8
  13. data/vendor/after_commit/lib/after_commit.rb +0 -45
  14. data/vendor/after_commit/lib/after_commit/active_record.rb +0 -114
  15. data/vendor/after_commit/lib/after_commit/connection_adapters.rb +0 -103
  16. data/vendor/after_commit/test/after_commit_test.rb +0 -53
  17. data/vendor/riddle/lib/riddle.rb +0 -30
  18. data/vendor/riddle/lib/riddle/client.rb +0 -635
  19. data/vendor/riddle/lib/riddle/client/filter.rb +0 -53
  20. data/vendor/riddle/lib/riddle/client/message.rb +0 -66
  21. data/vendor/riddle/lib/riddle/client/response.rb +0 -84
  22. data/vendor/riddle/lib/riddle/configuration.rb +0 -33
  23. data/vendor/riddle/lib/riddle/configuration/distributed_index.rb +0 -48
  24. data/vendor/riddle/lib/riddle/configuration/index.rb +0 -142
  25. data/vendor/riddle/lib/riddle/configuration/indexer.rb +0 -19
  26. data/vendor/riddle/lib/riddle/configuration/remote_index.rb +0 -17
  27. data/vendor/riddle/lib/riddle/configuration/searchd.rb +0 -25
  28. data/vendor/riddle/lib/riddle/configuration/section.rb +0 -43
  29. data/vendor/riddle/lib/riddle/configuration/source.rb +0 -23
  30. data/vendor/riddle/lib/riddle/configuration/sql_source.rb +0 -34
  31. data/vendor/riddle/lib/riddle/configuration/xml_source.rb +0 -28
  32. data/vendor/riddle/lib/riddle/controller.rb +0 -55
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 2
2
+ :patch: 3
3
3
  :major: 1
4
4
  :build:
5
5
  :minor: 3
@@ -13,6 +13,7 @@ require 'cucumber/thinking_sphinx/internal_world'
13
13
  world = Cucumber::ThinkingSphinx::InternalWorld.new
14
14
  world.configure_database
15
15
 
16
- require 'thinking_sphinx'
16
+ SphinxVersion = ENV['VERSION'] || '0.9.8'
17
+ require "thinking_sphinx/#{SphinxVersion}"
17
18
 
18
19
  world.setup
@@ -3,7 +3,6 @@ Dir[File.join(File.dirname(__FILE__), '../vendor/*/lib')].each do |path|
3
3
  end
4
4
 
5
5
  require 'active_record'
6
- require 'riddle'
7
6
  require 'after_commit'
8
7
  require 'yaml'
9
8
  require 'cgi'
@@ -0,0 +1,3 @@
1
+ require 'riddle'
2
+ require 'riddle/0.9.8'
3
+ require 'thinking_sphinx'
@@ -0,0 +1,3 @@
1
+ require 'riddle'
2
+ require 'riddle/0.9.9'
3
+ require 'thinking_sphinx'
data/rails/init.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'thinking_sphinx'
1
+ require 'thinking_sphinx/0.9.8'
2
2
  require 'action_controller/dispatcher'
3
3
 
4
4
  ActionController::Dispatcher.to_prepare :thinking_sphinx do
@@ -2,9 +2,7 @@ require 'yard'
2
2
  require 'jeweler'
3
3
 
4
4
  desc 'Generate documentation'
5
- YARD::Rake::YardocTask.new do |t|
6
- # t.title = 'Thinking Sphinx - ActiveRecord Sphinx Plugin'
7
- end
5
+ YARD::Rake::YardocTask.new
8
6
 
9
7
  Jeweler::Tasks.new do |gem|
10
8
  gem.name = "thinking-sphinx"
@@ -22,7 +20,6 @@ Jeweler::Tasks.new do |gem|
22
20
  "README.textile",
23
21
  "tasks/**/*.rb",
24
22
  "tasks/**/*.rake",
25
- "vendor/**/*",
26
23
  "VERSION.yml"
27
24
  ]
28
25
  gem.test_files = FileList[
@@ -31,6 +28,8 @@ Jeweler::Tasks.new do |gem|
31
28
  ]
32
29
 
33
30
  gem.add_dependency 'activerecord', '>= 1.15.6'
31
+ gem.add_dependency 'riddle', '>= 1.0.0'
32
+ gem.add_dependency 'after_commit', '>= 1.0.2'
34
33
 
35
34
  gem.post_install_message = <<-MESSAGE
36
35
  If you're upgrading, you should read this:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinking-sphinx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-05 00:00:00 +11:00
12
+ date: 2009-11-11 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,6 +22,26 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.15.6
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: riddle
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: after_commit
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.0.2
44
+ version:
25
45
  description: A concise and easy-to-use Ruby library that connects ActiveRecord to the Sphinx search daemon, managing configuration, indexing and searching.
26
46
  email: pat@freelancing-gods.com
27
47
  executables: []
@@ -38,6 +58,8 @@ files:
38
58
  - lib/cucumber/thinking_sphinx/internal_world.rb
39
59
  - lib/cucumber/thinking_sphinx/sql_logger.rb
40
60
  - lib/thinking_sphinx.rb
61
+ - lib/thinking_sphinx/0.9.8.rb
62
+ - lib/thinking_sphinx/0.9.9.rb
41
63
  - lib/thinking_sphinx/active_record.rb
42
64
  - lib/thinking_sphinx/active_record/attribute_updates.rb
43
65
  - lib/thinking_sphinx/active_record/delta.rb
@@ -75,30 +97,6 @@ files:
75
97
  - tasks/distribution.rb
76
98
  - tasks/rails.rake
77
99
  - tasks/testing.rb
78
- - vendor/after_commit/LICENSE
79
- - vendor/after_commit/README
80
- - vendor/after_commit/Rakefile
81
- - vendor/after_commit/init.rb
82
- - vendor/after_commit/lib/after_commit.rb
83
- - vendor/after_commit/lib/after_commit/active_record.rb
84
- - vendor/after_commit/lib/after_commit/connection_adapters.rb
85
- - vendor/after_commit/test/after_commit_test.rb
86
- - vendor/riddle/lib/riddle.rb
87
- - vendor/riddle/lib/riddle/client.rb
88
- - vendor/riddle/lib/riddle/client/filter.rb
89
- - vendor/riddle/lib/riddle/client/message.rb
90
- - vendor/riddle/lib/riddle/client/response.rb
91
- - vendor/riddle/lib/riddle/configuration.rb
92
- - vendor/riddle/lib/riddle/configuration/distributed_index.rb
93
- - vendor/riddle/lib/riddle/configuration/index.rb
94
- - vendor/riddle/lib/riddle/configuration/indexer.rb
95
- - vendor/riddle/lib/riddle/configuration/remote_index.rb
96
- - vendor/riddle/lib/riddle/configuration/searchd.rb
97
- - vendor/riddle/lib/riddle/configuration/section.rb
98
- - vendor/riddle/lib/riddle/configuration/source.rb
99
- - vendor/riddle/lib/riddle/configuration/sql_source.rb
100
- - vendor/riddle/lib/riddle/configuration/xml_source.rb
101
- - vendor/riddle/lib/riddle/controller.rb
102
100
  has_rdoc: true
103
101
  homepage: http://ts.freelancing-gods.com
104
102
  licenses: []
@@ -1,20 +0,0 @@
1
- Copyright (c) 2008 Nick Muerdter
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,16 +0,0 @@
1
- after_commit
2
- ===========
3
-
4
- A Ruby on Rails plugin to add after_commit callbacks. The callbacks that are provided can be used
5
- to trigger events that run only after the entire transaction is complete. This is beneficial
6
- in situations where you are doing asynchronous processing and need committed objects.
7
-
8
- The following callbacks are provided:
9
-
10
- * (1) after_commit
11
- * (2) after_commit_on_create
12
- * (3) after_commit_on_update
13
- * (4) after_commit_on_destroy
14
-
15
- The after_commit callback is run for any object that has just been committed. You can obtain finer
16
- callback control by using the additional <tt>after_commit_on_*</tt> callbacks.
@@ -1,22 +0,0 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/rdoctask'
4
-
5
- desc 'Default: run unit tests.'
6
- task :default => :test
7
-
8
- desc 'Test the after_commit plugin.'
9
- Rake::TestTask.new(:test) do |t|
10
- t.libs << 'lib'
11
- t.pattern = 'test/**/*_test.rb'
12
- t.verbose = true
13
- end
14
-
15
- desc 'Generate documentation for the after_commit plugin.'
16
- Rake::RDocTask.new(:rdoc) do |rdoc|
17
- rdoc.rdoc_dir = 'rdoc'
18
- rdoc.title = 'AfterCommit'
19
- rdoc.options << '--line-numbers' << '--inline-source'
20
- rdoc.rdoc_files.include('README')
21
- rdoc.rdoc_files.include('lib/**/*.rb')
22
- end
@@ -1,8 +0,0 @@
1
- ActiveRecord::Base.send(:include, AfterCommit::ActiveRecord)
2
-
3
- Object.subclasses_of(ActiveRecord::ConnectionAdapters::AbstractAdapter).each do |klass|
4
- klass.send(:include, AfterCommit::ConnectionAdapters)
5
- end
6
- if defined?(JRUBY_VERSION) and defined?(JdbcSpec::MySQL)
7
- JdbcSpec::MySQL.send :include, AfterCommit::ConnectionAdapters
8
- end
@@ -1,45 +0,0 @@
1
- require 'after_commit/active_record'
2
- require 'after_commit/connection_adapters'
3
-
4
- module AfterCommit
5
- def self.committed_records
6
- @@committed_records ||= []
7
- end
8
-
9
- def self.committed_records=(committed_records)
10
- @@committed_records = committed_records
11
- end
12
-
13
- def self.committed_records_on_create
14
- @@committed_records_on_create ||= []
15
- end
16
-
17
- def self.committed_records_on_create=(committed_records)
18
- @@committed_records_on_create = committed_records
19
- end
20
-
21
- def self.committed_records_on_update
22
- @@committed_records_on_update ||= []
23
- end
24
-
25
- def self.committed_records_on_update=(committed_records)
26
- @@committed_records_on_update = committed_records
27
- end
28
-
29
- def self.committed_records_on_destroy
30
- @@committed_records_on_destroy ||= []
31
- end
32
-
33
- def self.committed_records_on_destroy=(committed_records)
34
- @@committed_records_on_destroy = committed_records
35
- end
36
- end
37
-
38
- ActiveRecord::Base.send(:include, AfterCommit::ActiveRecord)
39
-
40
- Object.subclasses_of(ActiveRecord::ConnectionAdapters::AbstractAdapter).each do |klass|
41
- klass.send(:include, AfterCommit::ConnectionAdapters)
42
- end
43
- if defined?(JRUBY_VERSION) and defined?(JdbcSpec::MySQL)
44
- JdbcSpec::MySQL.send :include, AfterCommit::ConnectionAdapters
45
- end
@@ -1,114 +0,0 @@
1
- module AfterCommit
2
- module ActiveRecord
3
- # Based on the code found in Thinking Sphinx:
4
- # http://ts.freelancing-gods.com/ which was based on code written by Eli
5
- # Miller:
6
- # http://elimiller.blogspot.com/2007/06/proper-cache-expiry-with-aftercommit.html
7
- # with slight modification from Joost Hietbrink. And now me! Whew.
8
- def self.included(base)
9
- base.class_eval do
10
- # The define_callbacks method was added post Rails 2.0.2 - if it
11
- # doesn't exist, we define the callback manually
12
- if respond_to?(:define_callbacks)
13
- define_callbacks :after_commit,
14
- :after_commit_on_create,
15
- :after_commit_on_update,
16
- :after_commit_on_destroy
17
- else
18
- class << self
19
- # Handle after_commit callbacks - call all the registered callbacks.
20
- def after_commit(*callbacks, &block)
21
- callbacks << block if block_given?
22
- write_inheritable_array(:after_commit, callbacks)
23
- end
24
-
25
- def after_commit_on_create(*callbacks, &block)
26
- callbacks << block if block_given?
27
- write_inheritable_array(:after_commit_on_create, callbacks)
28
- end
29
-
30
- def after_commit_on_update(*callbacks, &block)
31
- callbacks << block if block_given?
32
- write_inheritable_array(:after_commit_on_update, callbacks)
33
- end
34
-
35
- def after_commit_on_destroy(*callbacks, &block)
36
- callbacks << block if block_given?
37
- write_inheritable_array(:after_commit_on_destroy, callbacks)
38
- end
39
- end
40
- end
41
-
42
- after_save :add_committed_record
43
- after_create :add_committed_record_on_create
44
- after_update :add_committed_record_on_update
45
- after_destroy :add_committed_record_on_destroy
46
-
47
- # We need to keep track of records that have been saved or destroyed
48
- # within this transaction.
49
- def add_committed_record
50
- AfterCommit.committed_records << self
51
- end
52
-
53
- def add_committed_record_on_create
54
- AfterCommit.committed_records_on_create << self
55
- end
56
-
57
- def add_committed_record_on_update
58
- AfterCommit.committed_records_on_update << self
59
- end
60
-
61
- def add_committed_record_on_destroy
62
- AfterCommit.committed_records << self
63
- AfterCommit.committed_records_on_destroy << self
64
- end
65
-
66
- def after_commit
67
- # Deliberately blank.
68
- end
69
-
70
- # Wraps a call to the private callback method so that the the
71
- # after_commit callback can be made from the ConnectionAdapters when
72
- # the commit for the transaction has finally succeeded.
73
- def after_commit_callback
74
- call_after_commit_callback :after_commit
75
- end
76
-
77
- def after_commit_on_create_callback
78
- call_after_commit_callback :after_commit_on_create
79
- end
80
-
81
- def after_commit_on_update_callback
82
- call_after_commit_callback :after_commit_on_update
83
- end
84
-
85
- def after_commit_on_destroy_callback
86
- call_after_commit_callback :after_commit_on_destroy
87
- end
88
-
89
- private
90
-
91
- def call_after_commit_callback(call)
92
- if can_call_after_commit call
93
- callback call
94
- clear_after_commit_call call
95
- end
96
- end
97
-
98
- def can_call_after_commit(call)
99
- @calls ||= {}
100
- @calls[call] ||= false
101
- if @calls[call]
102
- return false
103
- else
104
- @calls[call] = true
105
- end
106
- end
107
-
108
- def clear_after_commit_call(call)
109
- @calls[call] = false
110
- end
111
- end
112
- end
113
- end
114
- end
@@ -1,103 +0,0 @@
1
- module AfterCommit
2
- module ConnectionAdapters
3
- def self.included(base)
4
- base.class_eval do
5
- # The commit_db_transaction method gets called when the outermost
6
- # transaction finishes and everything inside commits. We want to
7
- # override it so that after this happens, any records that were saved
8
- # or destroyed within this transaction now get their after_commit
9
- # callback fired.
10
- def commit_db_transaction_with_callback
11
- commit_db_transaction_without_callback
12
- trigger_after_commit_callbacks
13
- trigger_after_commit_on_create_callbacks
14
- trigger_after_commit_on_update_callbacks
15
- trigger_after_commit_on_destroy_callbacks
16
- end
17
- alias_method_chain :commit_db_transaction, :callback
18
-
19
- # In the event the transaction fails and rolls back, nothing inside
20
- # should recieve the after_commit callback.
21
- def rollback_db_transaction_with_callback
22
- rollback_db_transaction_without_callback
23
-
24
- AfterCommit.committed_records = []
25
- AfterCommit.committed_records_on_create = []
26
- AfterCommit.committed_records_on_update = []
27
- AfterCommit.committed_records_on_destroy = []
28
- end
29
- alias_method_chain :rollback_db_transaction, :callback
30
-
31
- protected
32
- def trigger_after_commit_callbacks
33
- # Trigger the after_commit callback for each of the committed
34
- # records.
35
- if AfterCommit.committed_records.any?
36
- AfterCommit.committed_records.each do |record|
37
- begin
38
- record.after_commit_callback
39
- rescue
40
- end
41
- end
42
- end
43
-
44
- # Make sure we clear out our list of committed records now that we've
45
- # triggered the callbacks for each one.
46
- AfterCommit.committed_records = []
47
- end
48
-
49
- def trigger_after_commit_on_create_callbacks
50
- # Trigger the after_commit_on_create callback for each of the committed
51
- # records.
52
- if AfterCommit.committed_records_on_create.any?
53
- AfterCommit.committed_records_on_create.each do |record|
54
- begin
55
- record.after_commit_on_create_callback
56
- rescue
57
- end
58
- end
59
- end
60
-
61
- # Make sure we clear out our list of committed records now that we've
62
- # triggered the callbacks for each one.
63
- AfterCommit.committed_records_on_create = []
64
- end
65
-
66
- def trigger_after_commit_on_update_callbacks
67
- # Trigger the after_commit_on_update callback for each of the committed
68
- # records.
69
- if AfterCommit.committed_records_on_update.any?
70
- AfterCommit.committed_records_on_update.each do |record|
71
- begin
72
- record.after_commit_on_update_callback
73
- rescue
74
- end
75
- end
76
- end
77
-
78
- # Make sure we clear out our list of committed records now that we've
79
- # triggered the callbacks for each one.
80
- AfterCommit.committed_records_on_update = []
81
- end
82
-
83
- def trigger_after_commit_on_destroy_callbacks
84
- # Trigger the after_commit_on_destroy callback for each of the committed
85
- # records.
86
- if AfterCommit.committed_records_on_destroy.any?
87
- AfterCommit.committed_records_on_destroy.each do |record|
88
- begin
89
- record.after_commit_on_destroy_callback
90
- rescue
91
- end
92
- end
93
- end
94
-
95
- # Make sure we clear out our list of committed records now that we've
96
- # triggered the callbacks for each one.
97
- AfterCommit.committed_records_on_destroy = []
98
- end
99
- #end protected
100
- end
101
- end
102
- end
103
- end