public
Description: RESTful workflow / bpm engine based on Sinatra and OpenWFEru
Homepage: http://openwferu.rubyforge.org
Clone URL: git://github.com/jmettraux/ruote-rest.git
Search Repo:
nuked reset_participants task
jmettraux (author)
Tue May 06 18:40:23 -0700 2008
commit  f3bb2913ee62550c5be76372ddf370a533f84855
tree    39c2e6a36a5c06dc8b351797321808fc85ebec58
parent  e084be256959cba4ed235f11f5bcc9453b517010
...
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
39
40
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
43
44
0
@@ -39,27 +39,6 @@
0
 
0
 
0
 #
0
-# dumps an initial version of conf/participants_test.yaml
0
-#
0
-task :reset_participants do
0
-
0
- require 'yaml'
0
-
0
- FileUtils.rm "conf/participants_test.yaml"
0
-
0
- File.open "conf/participants_test.yaml", "w" do |f|
0
- f.puts(YAML.dump([
0
- [ "alpha", 'OpenWFE::Extras::ActiveParticipant', nil ],
0
- [ "bravo", 'OpenWFE::Extras::ActiveParticipant', nil ]
0
- ]))
0
- end
0
-
0
- puts
0
- puts "file created ./conf/participants_test.yaml"
0
- puts
0
-end
0
-
0
-#
0
 # other tasks
0
 
0
 load 'tasks/install_workflow_engine.rake'
...
40
41
42
43
 
 
 
 
 
 
 
 
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 
 
 
79
80
81
82
83
84
85
86
87
88
89
90
91
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
40
41
42
 
43
44
45
46
47
48
49
50
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
53
54
55
 
 
 
 
 
 
 
 
 
 
 
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
0
@@ -40,54 +40,50 @@
0
 require 'cgi'
0
 
0
 
0
-helpers do
0
+#
0
+# swap from dots to underscores
0
+#
0
+# swapdots "0_0_1" # => "0.0.1"
0
+#
0
+# swapdots "0.0.1" # => "0_0_1"
0
+#
0
+def swapdots (s)
0
 
0
- #
0
- # swap from dots to underscores
0
- #
0
- # swapdots "0_0_1" # => "0.0.1"
0
- #
0
- # swapdots "0.0.1" # => "0_0_1"
0
- #
0
- def swapdots (s)
0
-
0
- return s.gsub(/\./, '_') if s.index(".")
0
- s.gsub(/\_/, '.')
0
- end
0
-
0
-
0
- #
0
- # render_time(workitem, :dispatch_time)
0
- # # => Sat Mar 1 20:29:44 2008 (1d16h18m)
0
- #
0
- def display_time (object, accessor)
0
-
0
- t = object.send accessor
0
-
0
- return "" unless t
0
-
0
- d = Time.now - t
0
-
0
- "#{t.ctime} (#{Rufus::to_duration_string(d, :drop_seconds => true)})"
0
- end
0
-
0
- #
0
- # Basically, it's CGI escape(), but it makes sure that dots '.' are escaped
0
- # as well.
0
- #
0
- def uri_escape (s)
0
+ return s.gsub(/\./, '_') if s.index(".")
0
+ s.gsub(/\_/, '.')
0
+end
0
 
0
- CGI.escape(s).gsub(/\./, '%2E')
0
- end
0
-
0
- #--
0
- # Basically, it's CGI escape(), but it makes sure that dots '.' are escaped
0
- # as well.
0
- #
0
- #def uri_unescape (s)
0
- # CGI.unescape s
0
- #end
0
- #++
0
 
0
+#
0
+# render_time(workitem, :dispatch_time)
0
+# # => Sat Mar 1 20:29:44 2008 (1d16h18m)
0
+#
0
+def display_time (object, accessor)
0
+
0
+ t = object.send accessor
0
+
0
+ return "" unless t
0
+
0
+ d = Time.now - t
0
+
0
+ "#{t.ctime} (#{Rufus::to_duration_string(d, :drop_seconds => true)})"
0
 end
0
+
0
+#
0
+# Basically, it's CGI escape(), but it makes sure that dots '.' are escaped
0
+# as well.
0
+#
0
+def uri_escape (s)
0
+
0
+ CGI.escape(s).gsub(/\./, '%2E')
0
+end
0
+
0
+#--
0
+# Basically, it's CGI escape(), but it makes sure that dots '.' are escaped
0
+# as well.
0
+#
0
+#def uri_unescape (s)
0
+# CGI.unescape s
0
+#end
0
+#++
...
104
105
106
107
108
109
110
111
112
113
114
115
...
104
105
106
 
 
 
 
 
 
107
108
109
0
@@ -104,12 +104,6 @@
0
         end
0
     end
0
 
0
- #
0
- # As the name implies...
0
- #
0
- def self.reset_participants_test_yaml
0
- end
0
-
0
     protected
0
 
0
         def self.filename
...
25
26
27
28
29
 
 
30
31
32
...
50
51
52
53
54
 
 
55
56
57
...
25
26
27
 
 
28
29
30
31
32
...
50
51
52
 
 
53
54
55
56
57
0
@@ -25,8 +25,8 @@
0
   RUFUSES.each { |e| git_clone(e) }
0
   git_clone "ruote"
0
 
0
- sh "sudo gem install -y json_pure"
0
- sh "sudo gem install -y -v 0.2.2 sinatra"
0
+ sh "sudo gem install --no-rdoc --no-ri -y json_pure"
0
+ sh "sudo gem install --no-rdoc --no-ri -y -v 0.2.2 sinatra"
0
 end
0
 
0
 def git_clone (elt)
0
@@ -50,8 +50,8 @@
0
   GEMS << 'json_pure'
0
   #GEMS << 'xml_simple'
0
 
0
- sh "sudo gem install -y #{GEMS.join(' ')}"
0
- sh "sudo gem install -y -v 0.2.2 sinatra"
0
+ sh "sudo gem install --no-rdoc --no-ri -y #{GEMS.join(' ')}"
0
+ sh "sudo gem install --no-rdoc --no-ri -y -v 0.2.2 sinatra"
0
 
0
   #puts
0
   #puts "installed gems #{GEMS.join(' ')}"
...
45
46
47
48
 
 
49
50
51
...
74
75
76
77
 
 
78
79
80
...
45
46
47
 
48
49
50
51
52
...
75
76
77
 
78
79
80
81
82
0
@@ -45,7 +45,8 @@
0
 
0
         #puts @response.body
0
 
0
- assert_not_nil @response.body.index(' count="3"')
0
+ assert_not_nil(
0
+ @response.body.index(' count="3"'), "expected 3 participants")
0
 
0
         get_it "/participants/toto"
0
 
0
@@ -74,7 +75,8 @@
0
 
0
         get_it "/participants"
0
 
0
- assert_not_nil @response.body.index(' count="3"')
0
+ assert_not_nil(
0
+ @response.body.index(' count="3"'), "expected 3 participants")
0
 
0
         get_it "/participants?pname=toto"
0
 
...
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
22
23
...
17
18
19
 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
0
@@ -17,7 +17,20 @@
0
         OpenWFE::Extras::Workitem.delete_all
0
         OpenWFE::Extras::Field.delete_all
0
 
0
- Participants.reset_participants_test_yaml
0
+ #
0
+ # resetting the participant file
0
+
0
+ FileUtils.rm "conf/participants_test.yaml"
0
+
0
+ File.open "conf/participants_test.yaml", "w" do |f|
0
+ f.puts(YAML.dump([
0
+ [ "alpha", 'OpenWFE::Extras::ActiveParticipant', nil ],
0
+ [ "bravo", 'OpenWFE::Extras::ActiveParticipant', nil ]
0
+ ]))
0
+ end
0
+
0
+ #
0
+ # initting the participant
0
 
0
         $engine.get_participant_map.participants.clear
0
 

Comments

    No one has commented yet.