taskinator 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/lib/taskinator/create_process_worker.rb +14 -1
- data/lib/taskinator/version.rb +1 -1
- data/lib/taskinator/workflow.rb +1 -1
- data/spec/taskinator/create_process_worker_spec.rb +41 -8
- data/spec/taskinator/task_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f38da174c5aa2c6925369594efb9a6bd2c9f7f92
|
4
|
+
data.tar.gz: f5f868792f18674fcaf36eb1f810979d573a00dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 456f4e59f0be95f9e75cf077d75c1c839ddca9c11d983e675acd9ed54b1a64f957a19d35885ed07033c31b0f8e4f435f414e5847966376de28282529448e1884
|
7
|
+
data.tar.gz: cc736074a6f21baa49cfa76ab05566c17d48f653c54f25f00759f0ecf89ed9de0fbf77296e8071f3cdd6f487bccae256b35eddf94183f0f774eb4011f9cad729
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/mperham/sidekiq.git
|
3
|
-
revision:
|
3
|
+
revision: cf5933ab67eefb86e64d99a6aee4eaf18aada08f
|
4
4
|
specs:
|
5
5
|
sidekiq (3.5.0)
|
6
6
|
celluloid (~> 0.17.0)
|
@@ -12,7 +12,7 @@ GIT
|
|
12
12
|
PATH
|
13
13
|
remote: .
|
14
14
|
specs:
|
15
|
-
taskinator (0.3.
|
15
|
+
taskinator (0.3.2)
|
16
16
|
connection_pool (>= 2.2.0)
|
17
17
|
json (>= 1.8.2)
|
18
18
|
redis (>= 3.2.1)
|
@@ -19,7 +19,20 @@ module Taskinator
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def perform
|
22
|
-
|
22
|
+
|
23
|
+
# args may contain an options hash at the end
|
24
|
+
# so merge in the uuid into it, or add
|
25
|
+
|
26
|
+
process_args = args || []
|
27
|
+
|
28
|
+
if process_args.last.is_a?(Hash)
|
29
|
+
process_args.last.merge!(:uuid => uuid)
|
30
|
+
else
|
31
|
+
process_args << { :uuid => uuid }
|
32
|
+
end
|
33
|
+
|
34
|
+
@definition._create_process_(false, *process_args).enqueue!
|
35
|
+
|
23
36
|
end
|
24
37
|
|
25
38
|
private
|
data/lib/taskinator/version.rb
CHANGED
data/lib/taskinator/workflow.rb
CHANGED
@@ -4,9 +4,9 @@ describe Taskinator::CreateProcessWorker do
|
|
4
4
|
|
5
5
|
let(:definition) { MockDefinition.create }
|
6
6
|
let(:uuid) { SecureRandom.uuid }
|
7
|
-
let(:args) { {:foo => :bar} }
|
7
|
+
let(:args) { [{:foo => :bar}] }
|
8
8
|
|
9
|
-
subject { Taskinator::CreateProcessWorker.new(definition.name, uuid, Taskinator::Persistence.serialize(
|
9
|
+
subject { Taskinator::CreateProcessWorker.new(definition.name, uuid, Taskinator::Persistence.serialize(args)) }
|
10
10
|
|
11
11
|
describe "#initialize" do
|
12
12
|
it {
|
@@ -14,19 +14,19 @@ describe Taskinator::CreateProcessWorker do
|
|
14
14
|
}
|
15
15
|
|
16
16
|
it {
|
17
|
-
Taskinator::CreateProcessWorker.new(definition.name, uuid, Taskinator::Persistence.serialize(
|
17
|
+
Taskinator::CreateProcessWorker.new(definition.name, uuid, Taskinator::Persistence.serialize(args))
|
18
18
|
expect(subject.definition).to eq(definition)
|
19
19
|
}
|
20
20
|
|
21
21
|
it {
|
22
22
|
MockDefinition.const_set(definition.name, definition)
|
23
|
-
Taskinator::CreateProcessWorker.new("MockDefinition::#{definition.name}", uuid, Taskinator::Persistence.serialize(
|
23
|
+
Taskinator::CreateProcessWorker.new("MockDefinition::#{definition.name}", uuid, Taskinator::Persistence.serialize(args))
|
24
24
|
expect(subject.definition).to eq(definition)
|
25
25
|
}
|
26
26
|
|
27
27
|
it {
|
28
28
|
expect {
|
29
|
-
Taskinator::CreateProcessWorker.new("NonExistent", uuid, Taskinator::Persistence.serialize(
|
29
|
+
Taskinator::CreateProcessWorker.new("NonExistent", uuid, Taskinator::Persistence.serialize(args))
|
30
30
|
}.to raise_error(NameError)
|
31
31
|
}
|
32
32
|
|
@@ -40,9 +40,42 @@ describe Taskinator::CreateProcessWorker do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
describe "#perform" do
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
describe "create the process" do
|
44
|
+
it "with no arguments" do
|
45
|
+
process_args = [{:uuid => uuid}]
|
46
|
+
args = Taskinator::Persistence.serialize([])
|
47
|
+
|
48
|
+
expect(definition).to receive(:_create_process_).with(false, *process_args).and_return(double('process', :enqueue! => nil))
|
49
|
+
|
50
|
+
Taskinator::CreateProcessWorker.new(definition.name, uuid, args).perform
|
51
|
+
end
|
52
|
+
|
53
|
+
it "with arguments" do
|
54
|
+
process_args = [:foo, :bar, {:uuid => uuid}]
|
55
|
+
serialized_args = Taskinator::Persistence.serialize([:foo, :bar])
|
56
|
+
|
57
|
+
expect(definition).to receive(:_create_process_).with(false, *process_args).and_return(double('process', :enqueue! => nil))
|
58
|
+
|
59
|
+
Taskinator::CreateProcessWorker.new(definition.name, uuid, serialized_args).perform
|
60
|
+
end
|
61
|
+
|
62
|
+
it "with options" do
|
63
|
+
process_args = [{:foo => :bar, :uuid => uuid}]
|
64
|
+
serialized_args = Taskinator::Persistence.serialize([{:foo => :bar}])
|
65
|
+
|
66
|
+
expect(definition).to receive(:_create_process_).with(false, *process_args).and_return(double('process', :enqueue! => nil))
|
67
|
+
|
68
|
+
Taskinator::CreateProcessWorker.new(definition.name, uuid, serialized_args).perform
|
69
|
+
end
|
70
|
+
|
71
|
+
it "with arguments and options" do
|
72
|
+
process_args = [:foo, {:bar => :baz, :uuid => uuid}]
|
73
|
+
serialized_args = Taskinator::Persistence.serialize([:foo, {:bar => :baz}])
|
74
|
+
|
75
|
+
expect(definition).to receive(:_create_process_).with(false, *process_args).and_return(double('process', :enqueue! => nil))
|
76
|
+
|
77
|
+
Taskinator::CreateProcessWorker.new(definition.name, uuid, serialized_args).perform
|
78
|
+
end
|
46
79
|
end
|
47
80
|
|
48
81
|
it "should enqueue the process" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taskinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Stefano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09
|
11
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|