taskinator 0.0.7 → 0.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb55f92dd0ef5d48b4fb0d1f3d82093c59fdca7c
4
- data.tar.gz: c87595e40a584e0913571dbc50176ae8236010d2
3
+ metadata.gz: f681b5a701e5f68d9bb53ac6edf88480c7ddbfa9
4
+ data.tar.gz: 0b2f8046ada412f50927cd76d4989f98dfeff452
5
5
  SHA512:
6
- metadata.gz: 71858572f752ee6a0572607fb70607e36a49df6334e83c5c1a477675b70f41f75cbefc04e23cefb802bac39adc1207d947d69d580954d51e9992804a7ef2aa95
7
- data.tar.gz: a405c8209923653109f732d03601f2747cf35642ae452b44598ad78487c3c639a3ae91ba065c887116e7b47c7e512374104994a8b8c9a9f7b812e47530af5b96
6
+ metadata.gz: ed37c8d1d8974b9bb22ab1b95baa4448e16ecf2faebbe3a72c815b692ac8286714849d2ee8662f2b9c78cfcb3066ac183fb5da0983006f9ed51046e193bdcdd9
7
+ data.tar.gz: 720b6d27cce9bf6728d333faf65d4db46e3c91cc326783465d7133fd86673fa3ec57d5c19646028c0781c124afa36e3d89bc68b31cec6a13b79024cd96214a44
data/Gemfile CHANGED
@@ -3,8 +3,5 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in Taskinator.gemspec
4
4
  gemspec
5
5
 
6
- # add as a git gem dependency until the official gem is up to date.
7
- # uses features not released to RubyGems yet:
8
- # * condition checks for event transistions - https://github.com/geekq/workflow/pull/109
9
- # * method names for conditions - https://github.com/geekq/workflow/pull/113
6
+ # add as a git gem dependency until version 1.3.0 is released to RubyGems.
10
7
  gem 'workflow', :git => 'git://github.com/virtualstaticvoid/workflow.git', :branch => :master
data/Gemfile.lock CHANGED
@@ -1,6 +1,6 @@
1
1
  GIT
2
2
  remote: git://github.com/virtualstaticvoid/workflow.git
3
- revision: b7578549f10b8b50e74fd31c3f5dccdb6bd08ce2
3
+ revision: 5c7267ce7002d8ba7efad3acee52d56cbf88e0e0
4
4
  branch: master
5
5
  specs:
6
6
  workflow (1.3.0)
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- taskinator (0.0.7)
11
+ taskinator (0.0.8)
12
12
  connection_pool (>= 2.0.0)
13
13
  json (>= 1.8.1)
14
14
  redis (>= 3.0.6)
@@ -17,7 +17,7 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- activesupport (4.1.6)
20
+ activesupport (4.1.7)
21
21
  i18n (~> 0.6, >= 0.6.9)
22
22
  json (~> 1.7, >= 1.7.7)
23
23
  minitest (~> 5.1)
@@ -45,11 +45,11 @@ GEM
45
45
  i18n (0.6.11)
46
46
  json (1.8.1)
47
47
  method_source (0.8.2)
48
- mime-types (2.4.2)
48
+ mime-types (2.4.3)
49
49
  minitest (5.4.2)
50
50
  mono_logger (1.1.0)
51
51
  multi_json (1.10.1)
52
- netrc (0.7.8)
52
+ netrc (0.8.0)
53
53
  pry (0.9.12.6)
54
54
  coderay (~> 1.0)
55
55
  method_source (~> 0.8)
@@ -90,7 +90,7 @@ GEM
90
90
  rspec-mocks (3.1.3)
91
91
  rspec-support (~> 3.1.0)
92
92
  rspec-support (3.1.2)
93
- sidekiq (3.2.5)
93
+ sidekiq (3.2.6)
94
94
  celluloid (= 0.15.2)
95
95
  connection_pool (>= 2.0.0)
96
96
  json
@@ -42,7 +42,7 @@ module Taskinator
42
42
  raise NoMethodError, method unless @executor.respond_to?(method)
43
43
  raise ArgumentError, 'block' unless block_given?
44
44
 
45
- @executor.send(method, *@args) do |*args|
45
+ @executor.send(method, *[*@args, options]) do |*args|
46
46
  Builder.new(@process, @definition, args).instance_eval(&block)
47
47
  end
48
48
  end
@@ -1,3 +1,3 @@
1
1
  module Taskinator
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -10,6 +10,10 @@ module TestFlow
10
10
  task :the_task
11
11
  end
12
12
 
13
+ for_each :iterator, :sub_option => 1 do
14
+ task :the_task
15
+ end
16
+
13
17
  sequential do
14
18
  task :the_task
15
19
  task :the_task
@@ -39,7 +43,7 @@ module TestFlow
39
43
 
40
44
  # note: arg1 and arg2 are passed in all the way from the
41
45
  # definition#create_process method
42
- def iterator(arg1, arg2)
46
+ def iterator(arg1, arg2, options={})
43
47
  3.times do |i|
44
48
  yield [arg1, arg2, i]
45
49
  end
@@ -99,7 +99,7 @@ describe Taskinator::Definition::Builder do
99
99
  @executor = executor
100
100
  end
101
101
 
102
- expect(executor).to receive(:iterator_method) do |*args, &block|
102
+ expect(executor).to receive(:iterator_method).with(*[*args, {}]) do |*a, &block|
103
103
  3.times(&block)
104
104
  end
105
105
 
@@ -125,8 +125,26 @@ describe Taskinator::Definition::Builder do
125
125
  subject.for_each(nil)
126
126
  }.to raise_error(ArgumentError)
127
127
  end
128
+
129
+ it "calls the iterator method, adding specified options" do
130
+ executor = Taskinator::Executor.new(definition)
131
+
132
+ subject.instance_eval do
133
+ @executor = executor
134
+ end
135
+
136
+ expect(executor).to receive(:iterator_method).with(*[*args, :sub_option => 1]) do |*a, &block|
137
+ 3.times(&block)
138
+ end
139
+
140
+ expect(block).to receive(:call).exactly(3).times
141
+
142
+ subject.for_each(:iterator_method, :sub_option => 1, &define_block)
143
+ end
128
144
  end
129
145
 
146
+ # NOTE: #transform is an alias for #for_each
147
+
130
148
  describe "#task" do
131
149
  it "creates a task" do
132
150
  expect(Taskinator::Task).to receive(:define_step_task).with(process, :task_method, args, {})
data/taskinator.gemspec CHANGED
@@ -25,7 +25,8 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'redis-namespace', '>= 1.3.1'
26
26
  spec.add_dependency 'connection_pool', '>= 2.0.0'
27
27
  spec.add_dependency 'json', '>= 1.8.1'
28
- # spec.add_dependency 'workflow', '>= 1.1.0' # gem currently out of date...
28
+
29
+ # spec.add_dependency 'workflow', '>= 1.3.0' # RubyGems not up to date as of 11 Nov 2014.
29
30
 
30
31
  # queues
31
32
  spec.add_development_dependency 'sidekiq', '>= 3.0.0'
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.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Stefano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-16 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis