public
Description: the [OpenWFEru] workflow and BPM engine (ruby)
Homepage: http://openwferu.rubyforge.org
Clone URL: git://github.com/jmettraux/ruote.git
history cleanup and survey
jmettraux (author)
Wed Jun 11 16:35:09 -0700 2008
commit  8f5336bb1c976ad26cc60f8cb02e0a52584a6f3a
tree    bb285f7c1e3fd9349991b1a458df3657a8767e3d
parent  93a12a65d83fe3e3d83d533b915e43fbde3e2d3c
...
1
2
3
 
4
5
6
...
37
38
39
40
41
42
43
44
...
50
51
52
53
 
 
54
55
56
...
70
71
72
73
 
74
75
76
77
78
79
80
...
113
114
115
116
 
117
118
 
119
120
121
...
132
133
134
135
136
137
138
139
 
140
141
142
...
145
146
147
148
 
149
150
151
...
1
2
 
3
4
5
6
...
37
38
39
 
 
40
41
42
...
48
49
50
 
51
52
53
54
55
...
69
70
71
 
72
73
74
75
 
76
77
78
...
111
112
113
 
114
115
116
117
118
119
120
...
131
132
133
 
 
 
 
 
134
135
136
137
...
140
141
142
 
143
144
145
146
0
@@ -1,6 +1,6 @@
0
 #
0
 #--
0
-# Copyright (c) 2007, John Mettraux, OpenWFE.org
0
+# Copyright (c) 2007-2008, John Mettraux, OpenWFE.org
0
 # All rights reserved.
0
 #
0
 # Redistribution and use in source and binary forms, with or without
0
@@ -37,8 +37,6 @@
0
 # John Mettraux at openwfe.org
0
 #
0
 
0
-#require 'date'
0
-
0
 require 'openwfe/service'
0
 require 'openwfe/omixins'
0
 require 'openwfe/rudefinitions'
0
@@ -50,7 +48,8 @@ module OpenWFE
0
   # A Mixin for history modules
0
   #
0
   module HistoryMixin
0
- include ServiceMixin, OwfeServiceLocator
0
+ include ServiceMixin
0
+ include OwfeServiceLocator
0
 
0
     def service_init (service_name, application_context)
0
 
0
@@ -70,11 +69,10 @@ module OpenWFE
0
   #
0
   # A base implementation for InMemoryHistory and FileHistory.
0
   #
0
- class BaseHistory
0
+ class History
0
     include HistoryMixin
0
     include FeiMixin
0
 
0
- attr_reader :entries
0
 
0
     def initialize (service_name, application_context)
0
 
0
@@ -113,9 +111,10 @@ module OpenWFE
0
   #
0
   # Is only used for unit testing purposes.
0
   #
0
- class InMemoryHistory < BaseHistory
0
+ class InMemoryHistory < History
0
 
0
     def initialize (service_name, application_context)
0
+
0
       super
0
 
0
       @output = []
0
@@ -132,11 +131,7 @@ module OpenWFE
0
     # Returns all the entries as a String.
0
     #
0
     def to_s
0
- s = ""
0
- @output.each do |entry|
0
- s << entry.to_s
0
- end
0
- s
0
+ @output.inject("") { |r, entry| r << entry.to_s }
0
     end
0
   end
0
 
0
@@ -145,7 +140,7 @@ module OpenWFE
0
   # "history.log"
0
   # Warning : no fancy rotation or compression implemented here.
0
   #
0
- class FileHistory < BaseHistory
0
+ class FileHistory < History
0
 
0
     def initialize (service_name, application_context)
0
 
...
39
40
41
42
 
43
44
45
46
47
48
 
49
50
51
...
57
58
59
60
 
61
62
63
...
39
40
41
 
42
43
44
45
46
47
 
48
49
50
51
...
57
58
59
 
60
61
62
63
0
@@ -39,13 +39,13 @@ class FlowTest22 < Test::Unit::TestCase
0
 
0
   def test_history_0
0
 
0
- @engine.init_service("history", InMemoryHistory)
0
+ @engine.init_service "history", OpenWFE::InMemoryHistory
0
 
0
     history = @engine.application_context["history"]
0
 
0
     dotest TestDefinition0, %w{ a b c }.join("\n")
0
 
0
- #puts history.to_s
0
+ puts history.to_s
0
     #puts history.entries.size()
0
 
0
     #f = File.open("history.log", "w")
0
@@ -57,7 +57,7 @@ class FlowTest22 < Test::Unit::TestCase
0
 
0
   def test_history_1
0
 
0
- @engine.init_service("history", FileHistory)
0
+ @engine.init_service "history", OpenWFE::FileHistory
0
 
0
     dotest TestDefinition0, %w{ a b c }.join("\n")
0
 

Comments

    No one has commented yet.