ruote 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  .yardoc
2
2
  ruote_rdoc/
3
3
  work/
4
+ *.swp
@@ -2,6 +2,12 @@
2
2
  = ruote - CHANGELOG.txt
3
3
 
4
4
 
5
+ == ruote - 2.1.3 released 2010/01/04
6
+
7
+ - fixed issue with Rufus.is_cron_string (thanks Torsten)
8
+ - fixed issue with FlowExpression#cancel (Kenneth)
9
+
10
+
5
11
  == ruote - 2.1.2 released 2010/01/03
6
12
 
7
13
  - fixed issue when initializing engine without worker. Thanks Matt Nichols.
data/Rakefile CHANGED
@@ -33,6 +33,8 @@ ruote is an open source ruby workflow engine.
33
33
 
34
34
  gem.add_development_dependency 'json'
35
35
  gem.add_development_dependency 'yard'
36
+ gem.add_development_dependency 'builder'
37
+ gem.add_development_dependency 'mailtrap'
36
38
 
37
39
  # Gem::Specification http://www.rubygems.org/read/chapter/20
38
40
  end
data/TODO.txt CHANGED
@@ -156,6 +156,19 @@
156
156
  [o] undo exp : alias to 'cancel'
157
157
  [o] Andrew's at for timeouts (Chronic maybe)
158
158
  [x] timeout :at and :after (timeout expression vanished)
159
+ [x] listen : should it forget its triggered children ? yes
160
+ [o] limit the number of msgs returned
161
+ [o] should redo/undo follow the example of command and add_branches ?
162
+ everything through reply (receive)
163
+ should re_apply not touch the state of its expression ?
164
+ [o] test undo when cancelling parent expression
165
+ [o] issue with :unless => '${f:index} == 2000'
166
+ [o] implement Engine#reply (Engine simply has to include ReceiverMixin
167
+ [o] listeners X receivers
168
+ [o] add_service(name, path, klass, opts={}) opts local to services (really?)
169
+ [o] add_branches : pass message to concurrent_iterator like a command expression
170
+ [o] clean up persists present in #apply
171
+ [o] maybe cancel should have a safely / redo_reply thing
159
172
 
160
173
  [ ] exp : exp (restricted form of eval ?)
161
174
  [ ] exp : case (is it necessary ?)
@@ -246,7 +259,6 @@
246
259
  [ ] repeat : have a counter in a variable (:to => x maybe) (subprocessid ?)
247
260
 
248
261
  [ ] when : add test for cancelling when child has been triggered / is running
249
- [x] listen : should it forget its triggered children ? yes
250
262
 
251
263
  [ ] engine.cancel_forgotten_children(wfid) ?
252
264
 
@@ -254,25 +266,12 @@
254
266
 
255
267
  [ ] double-check on_cancel rewrite (ft_1_process_status)
256
268
 
257
- [o] limit the number of msgs returned
258
- [o] should redo/undo follow the example of command and add_branches ?
259
- everything through reply (receive)
260
- should re_apply not touch the state of its expression ?
261
- [o] test undo when cancelling parent expression
262
- [o] issue with :unless => '${f:index} == 2000'
263
- [o] implement Engine#reply (Engine simply has to include ReceiverMixin
264
- [o] listeners X receivers
265
- [o] add_service(name, path, klass, opts={}) opts local to services (really?)
266
- [o] add_branches : pass message to concurrent_iterator like a command expression
267
-
268
269
  [ ] verify get_last/get_raw logic, no + 0.0001...
269
- [ ] clean up persists present in #apply
270
270
  [ ] case exp : smarter one ?
271
271
  [ ] spare 1 get_msg by caching msg (but keep 'deleting')
272
272
  [ ] [un]set_var : via message ? should be ok like that... Not much traffic there
273
273
 
274
274
  [ ] empty iterator or concurrent-iterator, log ? crash ? empty while...
275
- [ ] maybe cancel should have a safely / redo_reply thing
276
275
  [ ] at expression ?
277
276
  [ ] listen to participants/errors/tags {in|out}
278
277
 
@@ -320,7 +320,7 @@ module Ruote::Exp
320
320
  def cancel (flavour)
321
321
 
322
322
  return reply_to_parent(h.applied_workitem) \
323
- unless h.children.find { |cfei| Ruote::FlowExpression.fetch(cfei) }
323
+ unless h.children.find { |cfei| Ruote::Exp::FlowExpression.fetch(@context, cfei) }
324
324
 
325
325
  do_persist || return
326
326
  # before firing the cancel message to the children
@@ -40,7 +40,7 @@ module Ruote
40
40
  @waiting = nil
41
41
  @color = 33
42
42
 
43
- @context.worker.subscribe(:all, self) if @context.respond_to?(:worker)
43
+ @context.worker.subscribe(:all, self) if @context.worker
44
44
 
45
45
  @noisy = false
46
46
  end
@@ -118,6 +118,12 @@ module Ruote
118
118
  hwi ? Ruote::Workitem.new(hwi) : nil
119
119
  end
120
120
 
121
+ # Clean this participant out completely
122
+ def purge!
123
+
124
+ fetch_all.each { |hwi| @context.storage.delete( hwi ) }
125
+ end
126
+
121
127
  protected
122
128
 
123
129
  def fetch_all
@@ -139,7 +139,7 @@ module Ruote
139
139
 
140
140
  at = if s.is_a?(Time) # at or every
141
141
  at
142
- elsif Rufus::Scheduler.is_cron_string(s) # cron
142
+ elsif is_cron_string(s) # cron
143
143
  Rufus::CronLine.new(s).next_time(Time.now + 1)
144
144
  else # at or every
145
145
  Ruote.s_to_at(s)
@@ -205,6 +205,18 @@ module Ruote
205
205
 
206
206
  scheds.select { |sched| sched['at'] <= now }
207
207
  end
208
+
209
+ # Waiting for a better implementation of it in rufus-scheduler 2.0.4
210
+ #
211
+ def is_cron_string (s)
212
+
213
+ ss = s.split(' ')
214
+
215
+ return false if ss.size < 5 || ss.size > 6
216
+ return false if s.match(/\d{4}/)
217
+
218
+ true
219
+ end
208
220
  end
209
221
  end
210
222
 
@@ -27,7 +27,7 @@ require 'ruote/fei'
27
27
 
28
28
  module Ruote
29
29
 
30
- VERSION = '2.1.2'
30
+ VERSION = '2.1.3'
31
31
 
32
32
  class Worker
33
33
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruote}
8
- s.version = "2.1.2"
8
+ s.version = "2.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Mettraux", "Kenneth Kalmer"]
12
- s.date = %q{2010-01-03}
12
+ s.date = %q{2010-01-04}
13
13
  s.description = %q{
14
14
  ruote is an open source ruby workflow engine.
15
15
  }
@@ -253,6 +253,8 @@ ruote is an open source ruby workflow engine.
253
253
  s.add_runtime_dependency(%q<rufus-treechecker>, [">= 1.0.3"])
254
254
  s.add_development_dependency(%q<json>, [">= 0"])
255
255
  s.add_development_dependency(%q<yard>, [">= 0"])
256
+ s.add_development_dependency(%q<builder>, [">= 0"])
257
+ s.add_development_dependency(%q<mailtrap>, [">= 0"])
256
258
  else
257
259
  s.add_dependency(%q<rufus-json>, [">= 0"])
258
260
  s.add_dependency(%q<rufus-cloche>, [">= 0.1.10"])
@@ -263,6 +265,8 @@ ruote is an open source ruby workflow engine.
263
265
  s.add_dependency(%q<rufus-treechecker>, [">= 1.0.3"])
264
266
  s.add_dependency(%q<json>, [">= 0"])
265
267
  s.add_dependency(%q<yard>, [">= 0"])
268
+ s.add_dependency(%q<builder>, [">= 0"])
269
+ s.add_dependency(%q<mailtrap>, [">= 0"])
266
270
  end
267
271
  else
268
272
  s.add_dependency(%q<rufus-json>, [">= 0"])
@@ -274,6 +278,8 @@ ruote is an open source ruby workflow engine.
274
278
  s.add_dependency(%q<rufus-treechecker>, [">= 1.0.3"])
275
279
  s.add_dependency(%q<json>, [">= 0"])
276
280
  s.add_dependency(%q<yard>, [">= 0"])
281
+ s.add_dependency(%q<builder>, [">= 0"])
282
+ s.add_dependency(%q<mailtrap>, [">= 0"])
277
283
  end
278
284
  end
279
285
 
@@ -42,5 +42,31 @@ class FtStorageParticipantTest < Test::Unit::TestCase
42
42
 
43
43
  assert_nil @engine.process(wfid)
44
44
  end
45
+
46
+ def test_purge
47
+
48
+ pdef = Ruote.process_definition :name => 'def0' do
49
+ alpha
50
+ end
51
+
52
+ @engine.register_participant :alpha, Ruote::StorageParticipant
53
+
54
+ #noisy
55
+
56
+ wfid = @engine.launch(pdef)
57
+
58
+ wait_for(:alpha)
59
+
60
+ assert_equal 1, @engine.storage.get_many('workitems').size
61
+
62
+ alpha = Ruote::StorageParticipant.new
63
+ alpha.context = @engine.context
64
+
65
+ assert !alpha.first.nil?
66
+
67
+ alpha.purge!
68
+
69
+ assert alpha.first.nil?
70
+ end
45
71
  end
46
72
 
@@ -23,6 +23,13 @@ class UtEngineTest < Test::Unit::TestCase
23
23
  engine = Ruote::Engine.new(worker, false)
24
24
  end
25
25
 
26
+ def test_initialize_with_worker_and_without_logger
27
+
28
+ storage = determine_storage({})
29
+ worker = Ruote::Worker.new(storage)
30
+ engine = Ruote::Engine.new(worker, false)
31
+ end
32
+
26
33
  def test_initialize_with_storage
27
34
 
28
35
  storage = determine_storage(
@@ -30,5 +37,11 @@ class UtEngineTest < Test::Unit::TestCase
30
37
 
31
38
  engine = Ruote::Engine.new(storage)
32
39
  end
40
+
41
+ def test_initialize_storage_without_logger
42
+
43
+ storage = determine_storage({})
44
+ engine = Ruote::Engine.new(storage)
45
+ end
33
46
  end
34
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruote
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-03 00:00:00 +09:00
13
+ date: 2010-01-04 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -103,6 +103,26 @@ dependencies:
103
103
  - !ruby/object:Gem::Version
104
104
  version: "0"
105
105
  version:
106
+ - !ruby/object:Gem::Dependency
107
+ name: builder
108
+ type: :development
109
+ version_requirement:
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: "0"
115
+ version:
116
+ - !ruby/object:Gem::Dependency
117
+ name: mailtrap
118
+ type: :development
119
+ version_requirement:
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: "0"
125
+ version:
106
126
  description: "\n\
107
127
  ruote is an open source ruby workflow engine.\n "
108
128
  email: jmettraux@gmail.com