yawl 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8320797288de59dfdd5b0b84e584dc48580d6b715665c8fed71d8bdeb0d62d72
4
+ data.tar.gz: b0cf5e62b1576b6b1256d2275369dbfe9f32e88e7834dadc25f5d96853b4c4ec
5
+ SHA512:
6
+ metadata.gz: 48bf04e5a2c4672298c18e756d4f66c5718a386fb7b30157327ae36c9cc1fe06c3dc889641696c8d0e6ee9e056d20cd77036e5cde99be6a2c4cb472471819296
7
+ data.tar.gz: e49afd2a46f0e68e94aea46d5cc2d92442696ec2c724cce72d54fdcab6dbda1ca27a16607cf1b5fdb512c63dd8ebacfa7f901cc85caf52a7569591ccbf6d1041
@@ -101,7 +101,7 @@ module Yawl
101
101
  end
102
102
 
103
103
  def unfinished_steps
104
- steps_dataset.where("state != 'completed'")
104
+ steps_dataset.where(Sequel.lit("state != 'completed'"))
105
105
  end
106
106
 
107
107
  def end_state_reached
@@ -1,3 +1,3 @@
1
1
  module Yawl
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -13,10 +13,10 @@ describe Yawl::Process do
13
13
 
14
14
  @process = Yawl::Process.create(:object_type => "FakeObject", :object_id => 123, :desired_state => "tested")
15
15
  @fake_object = FakeObject.new
16
- FakeObject.stub(:[]).with(123) { @fake_object }
16
+ allow(FakeObject).to receive(:[]).with(123) { @fake_object }
17
17
  end
18
18
 
19
19
  it "loads object" do
20
- @process.object.should == @fake_object
20
+ expect(@process.object).to eq(@fake_object)
21
21
  end
22
22
  end
@@ -92,7 +92,7 @@ describe Yawl::Step do
92
92
  it "executes a single step by id" do
93
93
  Yawl::Step.execute(step.id)
94
94
 
95
- step.reload.state.should == "completed"
95
+ expect(step.reload.state).to eq("completed")
96
96
  end
97
97
  end
98
98
 
@@ -106,7 +106,7 @@ describe Yawl::Step do
106
106
 
107
107
  Yawl::Step.restart_interrupted
108
108
 
109
- step.should be_queued_for_now
109
+ expect(step).to be_queued_for_now
110
110
  end
111
111
  end
112
112
 
@@ -118,7 +118,7 @@ describe Yawl::Step do
118
118
  it "enqueues the step for immediate execution" do
119
119
  step.start
120
120
 
121
- step.should be_queued_for_now
121
+ expect(step).to be_queued_for_now
122
122
  end
123
123
 
124
124
  it "resets state to pending" do
@@ -126,7 +126,7 @@ describe Yawl::Step do
126
126
 
127
127
  step.start
128
128
 
129
- step.state.should == "pending"
129
+ expect(step.state).to eq("pending")
130
130
  end
131
131
  end
132
132
 
@@ -138,11 +138,11 @@ describe Yawl::Step do
138
138
  it "sets state to completed" do
139
139
  step.execute
140
140
 
141
- step.state.should == "completed"
141
+ expect(step.state).to eq("completed")
142
142
  end
143
143
 
144
144
  it "notifies the process of completion" do
145
- step.process.should_receive(:step_finished)
145
+ expect(step.process).to receive(:step_finished)
146
146
 
147
147
  step.execute
148
148
  end
@@ -150,7 +150,7 @@ describe Yawl::Step do
150
150
  it "captures output" do
151
151
  step.execute
152
152
 
153
- step.attempts.first.output.should == "I worked\n"
153
+ expect(step.attempts.first.output).to eq("I worked\n")
154
154
  end
155
155
  end
156
156
 
@@ -163,11 +163,11 @@ describe Yawl::Step do
163
163
  it "sets state to pending" do
164
164
  step.execute
165
165
 
166
- step.state.should == "pending"
166
+ expect(step.state).to eq("pending")
167
167
  end
168
168
 
169
169
  it "does not notify the process of failure" do
170
- step.process.should_not_receive(:step_failed)
170
+ expect(step.process).not_to receive(:step_failed)
171
171
 
172
172
  step.execute
173
173
  end
@@ -175,13 +175,13 @@ describe Yawl::Step do
175
175
  it "is queued for retry" do
176
176
  step.execute
177
177
 
178
- step.should be_queued_for_later
178
+ expect(step).to be_queued_for_later
179
179
  end
180
180
 
181
181
  it "captures output" do
182
182
  step.execute
183
183
 
184
- step.attempts.first.output.should =~ /\AI started\n\n\n---\nCAUGHT ERROR: I failed\n.*:in `.*'/ # backtrace
184
+ expect(step.attempts.first.output).to match(/\AI started\n\n\n---\nCAUGHT ERROR: I failed\n.*:in `.*'/) # backtrace
185
185
  end
186
186
  end
187
187
 
@@ -196,11 +196,11 @@ describe Yawl::Step do
196
196
  step.execute
197
197
  }.to raise_error(Yawl::Step::Fatal)
198
198
 
199
- step.state.should == "failed"
199
+ expect(step.state).to eq("failed")
200
200
  end
201
201
 
202
202
  it "does not notify the process of failure" do
203
- step.process.should_receive(:step_failed)
203
+ expect(step.process).to receive(:step_failed)
204
204
 
205
205
  expect {
206
206
  step.execute
@@ -212,7 +212,7 @@ describe Yawl::Step do
212
212
  step.execute
213
213
  }.to raise_error(Yawl::Step::Fatal)
214
214
 
215
- step.should_not be_queued_for_later
215
+ expect(step).not_to be_queued_for_later
216
216
  end
217
217
 
218
218
  it "captures output" do
@@ -220,7 +220,7 @@ describe Yawl::Step do
220
220
  step.execute
221
221
  }.to raise_error(Yawl::Step::Fatal)
222
222
 
223
- step.attempts.first.output.should =~ /\AI started\n\n\n---\nCAUGHT ERROR: Fatal error in step\n.*:in `.*'/ # backtrace
223
+ expect(step.attempts.first.output).to match(/\AI started\n\n\n---\nCAUGHT ERROR: Fatal error in step\n.*:in `.*'/) # backtrace
224
224
  end
225
225
  end
226
226
  end
@@ -239,11 +239,11 @@ describe Yawl::Step do
239
239
  it "sets state to failed" do
240
240
  expect { step.execute }.to raise_error
241
241
 
242
- step.state.should == "failed"
242
+ expect(step.state).to eq("failed")
243
243
  end
244
244
 
245
245
  it "notifies the process of failure" do
246
- step.process.should_receive(:step_failed)
246
+ expect(step.process).to receive(:step_failed)
247
247
 
248
248
  expect { step.execute }.to raise_error
249
249
  end
@@ -251,13 +251,13 @@ describe Yawl::Step do
251
251
  it "is not queued for retry" do
252
252
  expect { step.execute }.to raise_error
253
253
 
254
- step.should_not be_queued_for_later
254
+ expect(step).not_to be_queued_for_later
255
255
  end
256
256
 
257
257
  it "captures output" do
258
258
  expect { step.execute }.to raise_error
259
259
 
260
- step.attempts.first.output.should =~ /\AI started\n\n\n---\nCAUGHT ERROR: I failed\n.*:in `.*'/
260
+ expect(step.attempts.first.output).to match(/\AI started\n\n\n---\nCAUGHT ERROR: I failed\n.*:in `.*'/)
261
261
  end
262
262
  end
263
263
 
@@ -275,11 +275,11 @@ describe Yawl::Step do
275
275
  it "sets state to interrupted" do
276
276
  expect { step.execute }.to raise_error
277
277
 
278
- step.state.should == "interrupted"
278
+ expect(step.state).to eq("interrupted")
279
279
  end
280
280
 
281
281
  it "does not notify the process of failure" do
282
- step.process.should_not_receive(:step_failed)
282
+ expect(step.process).not_to receive(:step_failed)
283
283
 
284
284
  expect { step.execute }.to raise_error
285
285
  end
@@ -287,13 +287,13 @@ describe Yawl::Step do
287
287
  it "is not queued for retry" do
288
288
  expect { step.execute }.to raise_error
289
289
 
290
- step.should_not be_queued_for_later
290
+ expect(step).not_to be_queued_for_later
291
291
  end
292
292
 
293
293
  it "captures output" do
294
294
  expect { step.execute }.to raise_error
295
295
 
296
- step.attempts.first.output.should =~ /\AI started\n\n\n---\nCAUGHT ERROR: SIGTERM\n.*:in `.*'/ # backtrace
296
+ expect(step.attempts.first.output).to match(/\AI started\n\n\n---\nCAUGHT ERROR: SIGTERM\n.*:in `.*'/) # backtrace
297
297
  end
298
298
  end
299
299
  end
@@ -307,11 +307,11 @@ describe Yawl::Step do
307
307
  it "sets state to pending" do
308
308
  step.execute
309
309
 
310
- step.state.should == "pending"
310
+ expect(step.state).to eq("pending")
311
311
  end
312
312
 
313
313
  it "does not notify the process of failure" do
314
- step.process.should_not_receive(:step_failed)
314
+ expect(step.process).not_to receive(:step_failed)
315
315
 
316
316
  step.execute
317
317
  end
@@ -319,13 +319,13 @@ describe Yawl::Step do
319
319
  it "is queued for retry" do
320
320
  step.execute
321
321
 
322
- step.should be_queued_for_later
322
+ expect(step).to be_queued_for_later
323
323
  end
324
324
 
325
325
  it "captures output" do
326
326
  step.execute
327
327
 
328
- step.attempts.first.output.should =~ /\AI started\n\n\n---\nStep slept\n\Z/
328
+ expect(step.attempts.first.output).to match(/\AI started\n\n\n---\nStep slept\n\Z/)
329
329
  end
330
330
  end
331
331
 
@@ -343,11 +343,11 @@ describe Yawl::Step do
343
343
  it "sets state to failed" do
344
344
  expect { step.execute }.to raise_error
345
345
 
346
- step.state.should == "failed"
346
+ expect(step.state).to eq("failed")
347
347
  end
348
348
 
349
349
  it "notifies the process of failure" do
350
- step.process.should_receive(:step_failed)
350
+ expect(step.process).to receive(:step_failed)
351
351
 
352
352
  expect { step.execute }.to raise_error
353
353
  end
@@ -355,13 +355,13 @@ describe Yawl::Step do
355
355
  it "is not queued for retry" do
356
356
  expect { step.execute }.to raise_error
357
357
 
358
- step.should_not be_queued_for_later
358
+ expect(step).not_to be_queued_for_later
359
359
  end
360
360
 
361
361
  it "captures output" do
362
362
  expect { step.execute }.to raise_error
363
363
 
364
- step.attempts.first.output.should =~ /\AI started\n\n\n---\nStep slept\n\Z/
364
+ expect(step.attempts.first.output).to match(/\AI started\n\n\n---\nStep slept\n\Z/)
365
365
  end
366
366
  end
367
367
  end
@@ -12,6 +12,8 @@ require "yawl/setup"
12
12
 
13
13
  Yawl::Setup.create_for_test!
14
14
 
15
+ RSpec::Expectations.configuration.on_potential_false_positives = :nothing
16
+
15
17
  def QC.jobs
16
18
  s = "SELECT * FROM queue_classic_jobs"
17
19
  [QC::Conn.execute(s)].compact.flatten.
@@ -46,11 +48,11 @@ RSpec::Matchers.define :be_queued_for_later do
46
48
  QC.later_jobs.include?("q_name" => "default", "method" => "Yawl::Step.execute", "args" => [step.id])
47
49
  end
48
50
 
49
- failure_message_for_should do |step|
51
+ failure_message do |step|
50
52
  "expected #{step.inspect} to be queued for later in later jobs #{QC.later_jobs}"
51
53
  end
52
54
 
53
- failure_message_for_should_not do |step|
55
+ failure_message_when_negated do |step|
54
56
  "expected #{step.inspect} to not be queued for later in later jobs #{QC.later_jobs}"
55
57
  end
56
58
  end
@@ -60,11 +62,11 @@ RSpec::Matchers.define :be_queued_for_now do
60
62
  QC.jobs.include?("q_name" => "default", "method" => "Yawl::Step.execute", "args" => [step.id])
61
63
  end
62
64
 
63
- failure_message_for_should do |step|
65
+ failure_message do |step|
64
66
  "expected #{step.inspect} to be queued for now in jobs #{QC.jobs}"
65
67
  end
66
68
 
67
- failure_message_for_should_not do |step|
69
+ failure_message_when_negated do |step|
68
70
  "expected #{step.inspect} to not be queued for now in jobs #{QC.jobs}"
69
71
  end
70
72
  end
@@ -20,10 +20,10 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "sequel"
22
22
  spec.add_dependency "scrolls"
23
- spec.add_dependency "queue_classic"
23
+ spec.add_dependency "queue_classic", "2.2.3"
24
24
  spec.add_dependency "queue_classic-later", ">= 0.3.0"
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.3"
26
+ spec.add_development_dependency "bundler"
27
27
  spec.add_development_dependency "rake"
28
28
  spec.add_development_dependency "rspec"
29
29
  end
metadata CHANGED
@@ -1,126 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yawl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ricardo Chimal, Jr.
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-04-29 00:00:00.000000000 Z
11
+ date: 2018-10-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sequel
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: scrolls
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: queue_classic
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '='
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: 2.2.3
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '='
60
53
  - !ruby/object:Gem::Version
61
- version: '0'
54
+ version: 2.2.3
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: queue_classic-later
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: 0.3.0
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: 0.3.0
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: bundler
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
- version: '1.3'
75
+ version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
- version: '1.3'
82
+ version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rake
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rspec
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: Yet Another Workflow Library for Ruby
@@ -130,8 +115,8 @@ executables: []
130
115
  extensions: []
131
116
  extra_rdoc_files: []
132
117
  files:
133
- - .gitignore
134
- - .rspec
118
+ - ".gitignore"
119
+ - ".rspec"
135
120
  - Gemfile
136
121
  - LICENSE.txt
137
122
  - README.md
@@ -159,33 +144,26 @@ files:
159
144
  homepage: https://github.com/ricardochimal/yawl
160
145
  licenses:
161
146
  - MIT
147
+ metadata: {}
162
148
  post_install_message:
163
149
  rdoc_options: []
164
150
  require_paths:
165
151
  - lib
166
152
  required_ruby_version: !ruby/object:Gem::Requirement
167
- none: false
168
153
  requirements:
169
- - - ! '>='
154
+ - - ">="
170
155
  - !ruby/object:Gem::Version
171
156
  version: '0'
172
- segments:
173
- - 0
174
- hash: -3845304480906963772
175
157
  required_rubygems_version: !ruby/object:Gem::Requirement
176
- none: false
177
158
  requirements:
178
- - - ! '>='
159
+ - - ">="
179
160
  - !ruby/object:Gem::Version
180
161
  version: '0'
181
- segments:
182
- - 0
183
- hash: -3845304480906963772
184
162
  requirements: []
185
163
  rubyforge_project:
186
- rubygems_version: 1.8.23
164
+ rubygems_version: 2.7.6
187
165
  signing_key:
188
- specification_version: 3
166
+ specification_version: 4
189
167
  summary: Yet Another Workflow Library for Ruby
190
168
  test_files:
191
169
  - spec/lib/process_spec.rb