ts-delayed-delta 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -52,7 +52,8 @@ h2. Contributors
52
52
  * "Edgars Beigarts":http://github.com/ebeigarts (Adding intelligent description for tasks)
53
53
  * "Alexander Simonov":http://simonov.me/ (Explicit table definition)
54
54
  * "David Goodlad":http://david.goodlad.ca/ (Delayed Job/ActiveRecord load order fix)
55
+ * "Ben Hutton":http://www.benhutton.com/ (Delayed Job compatibility update)
55
56
 
56
57
  h2. Copyright
57
58
 
58
- Copyright (c) 2009 Pat Allan, and released under an MIT Licence.
59
+ Copyright (c) 2009-2010 Pat Allan, and released under an MIT Licence.
@@ -8,10 +8,10 @@ $:.unshift File.dirname(__FILE__) + '/../../lib'
8
8
 
9
9
  require 'cucumber/thinking_sphinx/internal_world'
10
10
 
11
- Time.zone_default = Time.__send__(:get_zone, 'Melbourne')
12
- ActiveRecord::Base.time_zone_aware_attributes = true
13
- ActiveRecord::Base.default_timezone = :utc
14
-
11
+ # Time.zone_default = Time.__send__(:get_zone, 'Melbourne')
12
+ # ActiveRecord::Base.time_zone_aware_attributes = true
13
+ # ActiveRecord::Base.default_timezone = :utc
14
+ #
15
15
  world = Cucumber::ThinkingSphinx::InternalWorld.new
16
16
  world.configure_database
17
17
 
@@ -26,7 +26,7 @@ class ThinkingSphinx::Deltas::Job < Delayed::Backend::ActiveRecord::Job
26
26
  # @param [Integer] priority (0)
27
27
  #
28
28
  def self.enqueue(object, priority = 0)
29
- ::Delayed::Job.enqueue(object, priority) unless duplicates_exist(object)
29
+ ::Delayed::Job.enqueue(object, :priority => priority) unless duplicates_exist(object)
30
30
  end
31
31
 
32
32
  # Remove all Thinking Sphinx/Delayed Delta jobs from the queue. If the
@@ -43,7 +43,7 @@ class ThinkingSphinx::Deltas::DelayedDelta < ThinkingSphinx::Deltas::DefaultDelt
43
43
  ThinkingSphinx::Deltas::FlagAsDeletedJob.new(
44
44
  model.core_index_names, instance.sphinx_document_id
45
45
  ),
46
- ThinkingSphinx::Configuration.instance.delayed_job_priority
46
+ :priority => ThinkingSphinx::Configuration.instance.delayed_job_priority
47
47
  ) if instance
48
48
 
49
49
  true
data/spec/spec_helper.rb CHANGED
@@ -7,6 +7,8 @@ require 'spec/autorun'
7
7
  require 'thinking_sphinx'
8
8
  require 'thinking_sphinx/deltas/delayed_delta'
9
9
 
10
+ Delayed::Worker.backend = :active_record
11
+
10
12
  Spec::Runner.configure do |config|
11
13
  #
12
14
  end
@@ -96,7 +96,7 @@ describe ThinkingSphinx::Deltas::DelayedDelta do
96
96
  end
97
97
 
98
98
  it "should enqueue a flag-as-deleted job for the appropriate indexes" do
99
- Delayed::Job.should_receive(:enqueue) do |job, priority|
99
+ Delayed::Job.should_receive(:enqueue) do |job, options|
100
100
  job.indexes.should == ['foo_core']
101
101
  end
102
102
 
@@ -104,7 +104,7 @@ describe ThinkingSphinx::Deltas::DelayedDelta do
104
104
  end
105
105
 
106
106
  it "should enqueue a flag-as-deleted job for the appropriate id" do
107
- Delayed::Job.should_receive(:enqueue) do |job, priority|
107
+ Delayed::Job.should_receive(:enqueue) do |job, options|
108
108
  job.document_id.should == 42
109
109
  end
110
110
 
@@ -112,8 +112,8 @@ describe ThinkingSphinx::Deltas::DelayedDelta do
112
112
  end
113
113
 
114
114
  it "should use the defined priority for the flag-as-deleted job" do
115
- Delayed::Job.should_receive(:enqueue) do |job, priority|
116
- priority.should == 2
115
+ Delayed::Job.should_receive(:enqueue) do |job, options|
116
+ options[:priority].should == 2
117
117
  end
118
118
 
119
119
  @delayed_delta.index(@model, @instance)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ts-delayed-delta
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Allan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-17 00:00:00 +11:00
18
+ date: 2011-02-15 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -42,12 +42,12 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- hash: 63
45
+ hash: 11
46
46
  segments:
47
+ - 2
47
48
  - 1
48
- - 8
49
- - 4
50
- version: 1.8.4
49
+ - 0
50
+ version: 2.1.0
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
53
  - !ruby/object:Gem::Dependency
@@ -116,11 +116,9 @@ files:
116
116
  - features/step_definitions/delayed_delta_steps.rb
117
117
  - features/support/env.rb
118
118
  - features/thinking_sphinx/database.example.yml
119
- - features/thinking_sphinx/database.yml
120
119
  - features/thinking_sphinx/db/fixtures/delayed_betas.rb
121
120
  - features/thinking_sphinx/db/migrations/create_delayed_betas.rb
122
121
  - features/thinking_sphinx/models/delayed_beta.rb
123
- - spec/spec.opts
124
122
  - spec/spec_helper.rb
125
123
  - spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb
126
124
  - spec/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job_spec.rb
@@ -166,11 +164,9 @@ test_files:
166
164
  - features/step_definitions/delayed_delta_steps.rb
167
165
  - features/support/env.rb
168
166
  - features/thinking_sphinx/database.example.yml
169
- - features/thinking_sphinx/database.yml
170
167
  - features/thinking_sphinx/db/fixtures/delayed_betas.rb
171
168
  - features/thinking_sphinx/db/migrations/create_delayed_betas.rb
172
169
  - features/thinking_sphinx/models/delayed_beta.rb
173
- - spec/spec.opts
174
170
  - spec/spec_helper.rb
175
171
  - spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb
176
172
  - spec/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job_spec.rb
@@ -1,4 +0,0 @@
1
- username: root
2
- host: localhost
3
- pool: 1
4
- min_messages: warning
data/spec/spec.opts DELETED
@@ -1 +0,0 @@
1
- --color