actionable 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/actionable.gemspec +2 -2
- data/lib/actionable/job.rb +3 -0
- data/lib/actionable/version.rb +1 -1
- data/spec/failure_spec.rb +6 -7
- data/spec/job_spec.rb +3 -7
- data/spec/support/test_failure_job.rb +4 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a27909aea2c1fa8b2a2a544c2b9d4c7fa2317b4
|
4
|
+
data.tar.gz: 0f7c0706056ddb3aa49ea0df40c51a4110469c7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adfd64e3a62a2d2afa6eb27b334fda4d52d15fc7989697bc69b7bd94c99a85d0b713e863b6b8aa3e8436499e8084c43d82e21b2df1932a75e3a273bcd8e704b6
|
7
|
+
data.tar.gz: 471fdea064a1e0dc4f7f7c8c23d9449b3bdaa6abf9e72ae08487f2f6616e833eb0a63e0223cc737853c5adff59b81fa5a24ddc57b183762afd7043dfaa1d8901
|
data/actionable.gemspec
CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency "activesupport", "~> 4.0.0"
|
31
31
|
spec.add_dependency "resque", "~> 1.24.1"
|
32
|
-
spec.add_dependency "mongoid", "
|
33
|
-
spec.add_dependency "rufus-scheduler"
|
32
|
+
spec.add_dependency "mongoid", ">= 4.0.0"
|
33
|
+
spec.add_dependency "rufus-scheduler", "~> 2.0.4"
|
34
34
|
|
35
35
|
|
36
36
|
end
|
data/lib/actionable/job.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'resque/errors'
|
1
2
|
module Actionable
|
2
3
|
class Job
|
3
4
|
|
@@ -34,7 +35,9 @@ module Actionable
|
|
34
35
|
rescue => e
|
35
36
|
puts "Error in 'on_failure' handler: #{e.message}"
|
36
37
|
logger.error("Error in 'on_failure' handler: #{e.message}")
|
38
|
+
raise
|
37
39
|
end
|
40
|
+
raise err
|
38
41
|
end
|
39
42
|
|
40
43
|
def self.perform(id)
|
data/lib/actionable/version.rb
CHANGED
data/spec/failure_spec.rb
CHANGED
@@ -5,11 +5,12 @@ class TestWorker
|
|
5
5
|
attr_accessor :pid
|
6
6
|
|
7
7
|
def spawn
|
8
|
-
@pid = Kernel.spawn('bundle exec rake resque:work QUEUES=actionable,actionable_sweep')
|
8
|
+
@pid = Kernel.spawn('bundle exec rake resque:work TERM_CHILD=1 QUEUES=actionable,actionable_sweep')
|
9
9
|
end
|
10
10
|
|
11
11
|
def kill
|
12
|
-
|
12
|
+
Process.kill("TERM",@pid)
|
13
|
+
# system("killall resque-1.24.1: Waiting for actionable,actionable_sweep")
|
13
14
|
end
|
14
15
|
|
15
16
|
end
|
@@ -30,16 +31,14 @@ end
|
|
30
31
|
describe "Failing Actionable::Job" do
|
31
32
|
|
32
33
|
before do
|
33
|
-
system(
|
34
|
+
system("killall 'resque-1.24.1: Waiting for actionable,actionable_sweep'")
|
34
35
|
end
|
35
36
|
|
36
|
-
after do
|
37
|
-
system('killall resque-1.24.1: Waiting for actionable,actionable_sweep')
|
38
|
-
end
|
39
37
|
|
40
38
|
|
41
39
|
context "scheduled for one minute ago" do
|
42
40
|
|
41
|
+
|
43
42
|
it "should be executed by a worker manually" do
|
44
43
|
Resque.inline = true
|
45
44
|
target = TestModel.create({
|
@@ -49,7 +48,7 @@ describe "Failing Actionable::Job" do
|
|
49
48
|
})
|
50
49
|
target.schedule_actionable(1.minute.ago,TestFailureJob,{number:2})
|
51
50
|
id = target.id
|
52
|
-
expect(TestFailureJob).to receive(:
|
51
|
+
expect(TestFailureJob).to receive(:stubbed_failure_method)
|
53
52
|
# expect(Resque::Failure).to receive(:create)
|
54
53
|
expect {
|
55
54
|
Actionable::Sweep.perform
|
data/spec/job_spec.rb
CHANGED
@@ -5,11 +5,11 @@ class TestWorker
|
|
5
5
|
attr_accessor :pid
|
6
6
|
|
7
7
|
def spawn
|
8
|
-
@pid = Kernel.spawn('bundle exec rake resque:work QUEUES=actionable,actionable_sweep')
|
8
|
+
@pid = Kernel.spawn('bundle exec rake resque:work TERM_CHILD=1 QUEUES=actionable,actionable_sweep')
|
9
9
|
end
|
10
10
|
|
11
11
|
def kill
|
12
|
-
system(
|
12
|
+
system("killall 'resque-1.24.1: Waiting for actionable,actionable_sweep'")
|
13
13
|
end
|
14
14
|
|
15
15
|
end
|
@@ -30,11 +30,7 @@ end
|
|
30
30
|
describe Actionable::Job do
|
31
31
|
|
32
32
|
before do
|
33
|
-
system(
|
34
|
-
end
|
35
|
-
|
36
|
-
after do
|
37
|
-
system('killall resque-1.24.1: Waiting for actionable,actionable_sweep')
|
33
|
+
system("killall 'resque-1.24.1: Waiting for actionable,actionable_sweep'")
|
38
34
|
end
|
39
35
|
|
40
36
|
context "scheduled for one minute ago" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Luxemburg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -154,30 +154,30 @@ dependencies:
|
|
154
154
|
name: mongoid
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: 4.0.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - '>='
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 4.0.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rufus-scheduler
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - ~>
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 2.0.4
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 2.0.4
|
181
181
|
description: Better jobs. Good jobs.
|
182
182
|
email:
|
183
183
|
- daniel.luxemburg@gmail.com
|