bumbleworks 0.0.42 → 0.0.43

Sign up to get free protection for your applications and to get access to all the features.
data/lib/bumbleworks.rb CHANGED
@@ -10,6 +10,7 @@ require "bumbleworks/hash_storage"
10
10
  require "bumbleworks/simple_logger"
11
11
  require "bumbleworks/storage_participant"
12
12
  require "bumbleworks/local_participant"
13
+ require "bumbleworks/participant"
13
14
  require "bumbleworks/error_handler"
14
15
  require "bumbleworks/error_logger"
15
16
  require "bumbleworks/error_handler_participant"
@@ -1,13 +1,12 @@
1
1
  module Bumbleworks
2
- class ErrorHandlerParticipant
3
- include ::Ruote::LocalParticipant
4
-
2
+ class ErrorHandlerParticipant < ::Ruote::Participant
5
3
  def on_workitem
6
4
  return if (error_handlers = Bumbleworks.error_handlers).empty?
7
5
 
8
6
  error_handlers.each do |error_handler|
9
7
  error_handler.new(workitem).on_error
10
8
  end
9
+ reply
11
10
  end
12
11
  end
13
12
  end
@@ -0,0 +1,11 @@
1
+ require "bumbleworks/local_participant"
2
+
3
+ module Bumbleworks
4
+ class Participant
5
+ include LocalParticipant
6
+
7
+ def on_cancel
8
+ # default no-op method
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Bumbleworks
2
- VERSION = "0.0.42"
2
+ VERSION = "0.0.43"
3
3
  end
@@ -8,7 +8,7 @@ describe Bumbleworks::ErrorHandlerParticipant do
8
8
  Bumbleworks.error_handlers = error_handlers
9
9
  error_handlers[0].should_receive(:new).ordered.with(workitem).and_return(instances[0])
10
10
  error_handlers[1].should_receive(:new).ordered.with(workitem).and_return(instances[1])
11
- subject.stub(:workitem => workitem)
11
+ subject.stub(:reply => nil, :workitem => workitem)
12
12
  subject.on_workitem
13
13
  end
14
14
  end
@@ -0,0 +1,11 @@
1
+ describe Bumbleworks::Participant do
2
+ it 'includes Bumbleworks::LocalParticipant' do
3
+ described_class.included_modules.should include(Bumbleworks::LocalParticipant)
4
+ end
5
+
6
+ it 'defines #on_cancel' do
7
+ expect {
8
+ subject.on_cancel
9
+ }.not_to raise_error
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumbleworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.42
4
+ version: 0.0.43
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-11-20 00:00:00.000000000 Z
15
+ date: 2013-11-21 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ruote
@@ -172,6 +172,7 @@ files:
172
172
  - lib/bumbleworks/error_logger.rb
173
173
  - lib/bumbleworks/hash_storage.rb
174
174
  - lib/bumbleworks/local_participant.rb
175
+ - lib/bumbleworks/participant.rb
175
176
  - lib/bumbleworks/participant_registration.rb
176
177
  - lib/bumbleworks/process_definition.rb
177
178
  - lib/bumbleworks/rake_tasks.rb
@@ -212,6 +213,7 @@ files:
212
213
  - spec/lib/bumbleworks/error_logger_spec.rb
213
214
  - spec/lib/bumbleworks/local_participant_spec.rb
214
215
  - spec/lib/bumbleworks/participant_registration_spec.rb
216
+ - spec/lib/bumbleworks/participant_spec.rb
215
217
  - spec/lib/bumbleworks/process_definition_spec.rb
216
218
  - spec/lib/bumbleworks/ruote/exp/broadcast_event_expression_spec.rb
217
219
  - spec/lib/bumbleworks/ruote/exp/wait_for_event_expression_spec.rb
@@ -242,7 +244,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
244
  version: '0'
243
245
  segments:
244
246
  - 0
245
- hash: -1259087947392220578
247
+ hash: -1294048902539087769
246
248
  required_rubygems_version: !ruby/object:Gem::Requirement
247
249
  none: false
248
250
  requirements:
@@ -251,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
253
  version: '0'
252
254
  segments:
253
255
  - 0
254
- hash: -1259087947392220578
256
+ hash: -1294048902539087769
255
257
  requirements: []
256
258
  rubyforge_project:
257
259
  rubygems_version: 1.8.23
@@ -282,6 +284,7 @@ test_files:
282
284
  - spec/lib/bumbleworks/error_logger_spec.rb
283
285
  - spec/lib/bumbleworks/local_participant_spec.rb
284
286
  - spec/lib/bumbleworks/participant_registration_spec.rb
287
+ - spec/lib/bumbleworks/participant_spec.rb
285
288
  - spec/lib/bumbleworks/process_definition_spec.rb
286
289
  - spec/lib/bumbleworks/ruote/exp/broadcast_event_expression_spec.rb
287
290
  - spec/lib/bumbleworks/ruote/exp/wait_for_event_expression_spec.rb