ruote-kit 2.1.10 → 2.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/CHANGELOG.txt +10 -0
- data/Gemfile +21 -5
- data/LICENSE.txt +20 -0
- data/README.rdoc +132 -80
- data/Rakefile +4 -15
- data/TODO.txt +12 -0
- data/config.ru +22 -14
- data/lib/ruote-kit/application.rb +46 -22
- data/lib/ruote-kit/helpers/json_helpers.rb +280 -0
- data/lib/ruote-kit/helpers/link_helpers.rb +117 -0
- data/lib/ruote-kit/helpers/misc_helpers.rb +35 -0
- data/lib/ruote-kit/helpers/pagination_helpers.rb +30 -0
- data/lib/ruote-kit/helpers/render_helpers.rb +39 -92
- data/lib/ruote-kit/public/_ruote/images/favicon.ico +0 -0
- data/lib/ruote-kit/public/_ruote/images/ruote.png +0 -0
- data/lib/ruote-kit/public/_ruote/images/ruote_buttons.png +0 -0
- data/lib/ruote-kit/public/_ruote/javascripts/jquery-1.4.2.min.js +154 -0
- data/lib/ruote-kit/public/_ruote/javascripts/rk.js +40 -0
- data/lib/ruote-kit/public/_ruote/javascripts/ruote-fluo-editor.js +548 -0
- data/lib/ruote-kit/public/_ruote/javascripts/ruote-fluo.js +32 -1
- data/lib/ruote-kit/public/_ruote/stylesheets/reset.css +53 -0
- data/lib/ruote-kit/public/_ruote/stylesheets/rk.css +355 -16
- data/lib/ruote-kit/public/_ruote/stylesheets/ruote-fluo-editor.css +108 -0
- data/lib/ruote-kit/resources/errors.rb +46 -43
- data/lib/ruote-kit/resources/expressions.rb +92 -35
- data/lib/ruote-kit/resources/participants.rb +53 -0
- data/lib/ruote-kit/resources/processes.rb +68 -36
- data/lib/ruote-kit/resources/schedules.rb +27 -0
- data/lib/ruote-kit/resources/workitems.rb +93 -31
- data/lib/ruote-kit/spec/ruote_helpers.rb +25 -16
- data/lib/ruote-kit/version.rb +3 -1
- data/lib/ruote-kit/views/_pagination.html.haml +38 -0
- data/lib/ruote-kit/views/_tree_editor.html.haml +52 -0
- data/lib/ruote-kit/views/error.html.haml +69 -0
- data/lib/ruote-kit/views/errors.html.haml +28 -12
- data/lib/ruote-kit/views/expression.html.haml +161 -30
- data/lib/ruote-kit/views/expressions.html.haml +26 -21
- data/lib/ruote-kit/views/http_error.html.haml +11 -0
- data/lib/ruote-kit/views/index.html.haml +4 -0
- data/lib/ruote-kit/views/layout.html.haml +52 -32
- data/lib/ruote-kit/views/participants.html.haml +79 -0
- data/lib/ruote-kit/views/process.html.haml +109 -42
- data/lib/ruote-kit/views/process_launched.html.haml +6 -2
- data/lib/ruote-kit/views/processes.html.haml +55 -24
- data/lib/ruote-kit/views/processes_new.html.haml +36 -0
- data/lib/ruote-kit/views/schedules.html.haml +42 -0
- data/lib/ruote-kit/views/workitem.html.haml +83 -29
- data/lib/ruote-kit/views/workitems.html.haml +42 -19
- data/lib/ruote-kit.rb +17 -88
- data/ruote-kit.gemspec +68 -80
- data/spec/it_has_an_engine.rb +69 -0
- data/spec/resources/errors_spec.rb +198 -270
- data/spec/resources/expressions_spec.rb +308 -52
- data/spec/resources/index_spec.rb +28 -16
- data/spec/resources/participants_spec.rb +102 -0
- data/spec/resources/processes_spec.rb +218 -104
- data/spec/resources/schedules_spec.rb +97 -0
- data/spec/resources/workitems_spec.rb +195 -100
- data/spec/ruote-kit_configure_spec.rb +32 -75
- data/spec/spec.opts +0 -1
- data/spec/spec_helper.rb +31 -92
- data/spec/webapp_helpers_spec.rb +309 -0
- metadata +87 -152
- data/lib/ruote-kit/configuration.rb +0 -83
- data/lib/ruote-kit/helpers/engine_helpers.rb +0 -24
- data/lib/ruote-kit/helpers/form_helpers.rb +0 -11
- data/lib/ruote-kit/helpers/launch_item_parser.rb +0 -59
- data/lib/ruote-kit/helpers/navigation_helpers.rb +0 -54
- data/lib/ruote-kit/helpers.rb +0 -9
- data/lib/ruote-kit/public/_ruote/images/bg.gif +0 -0
- data/lib/ruote-kit/public/_ruote/images/bg_button_left.gif +0 -0
- data/lib/ruote-kit/public/_ruote/images/bg_button_left_cancel.gif +0 -0
- data/lib/ruote-kit/public/_ruote/images/bg_button_left_submit.gif +0 -0
- data/lib/ruote-kit/public/_ruote/images/bg_button_right.gif +0 -0
- data/lib/ruote-kit/public/_ruote/javascripts/SimplyButtons.js +0 -191
- data/lib/ruote-kit/public/_ruote/javascripts/fluo-dial.js +0 -149
- data/lib/ruote-kit/public/_ruote/stylesheets/SimplyButtons.css +0 -226
- data/lib/ruote-kit/public/_ruote/stylesheets/base.css +0 -336
- data/lib/ruote-kit/public/_ruote/stylesheets/style.css +0 -393
- data/lib/ruote-kit/views/launch_process.html.haml +0 -19
- data/lib/ruote-kit/views/process_failed_to_launch.html.haml +0 -7
- data/lib/ruote-kit/views/resource_not_found.html.haml +0 -7
- data/spec/helpers/render_helpers_spec.rb +0 -214
- data/spec/ruote-kit_spec.rb +0 -4
- data/spec/views/expressions.html.haml_spec.rb +0 -31
- data/spec/views/launch_process.html.haml_spec.rb +0 -22
- data/spec/views/process.html.haml_spec.rb +0 -17
- data/spec/views/process_launched.html.haml_spec.rb +0 -16
- data/spec/views/processes.html.haml_spec.rb +0 -31
- data/spec/views/workitems.html.haml_spec.rb +0 -69
@@ -1,214 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
undef :context if defined?(context)
|
4
|
-
|
5
|
-
describe "json helper", :type => :with_engine do
|
6
|
-
|
7
|
-
describe "rendering defaults" do
|
8
|
-
before(:each) do
|
9
|
-
stub_chain( :request, :fullpath ).and_return('/_ruote')
|
10
|
-
|
11
|
-
@hash = Rufus::Json.decode( json( :status, :ok ) )
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should have the key & value" do
|
15
|
-
@hash.should have_key('status')
|
16
|
-
@hash['status'].should == 'ok'
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should have a collection of links" do
|
20
|
-
@hash.should have_key('links')
|
21
|
-
@hash['links'].should_not be_empty
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should link to 'self'" do
|
25
|
-
@hash['links'].detect { |l| l['rel'] == 'self' && l['href'] == '/_ruote' }.should_not be_nil
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should link to the root" do
|
29
|
-
@hash['links'].detect { |l| l['rel'] =~ /#root$/ && l['href'] == '/_ruote' }.should_not be_nil
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should link to the processes" do
|
33
|
-
@hash['links'].detect { |l| l['rel'] =~ /#processes$/ && l['href'] == '/_ruote/processes' }.should_not be_nil
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should not link to the expressions by default" do
|
37
|
-
@hash['links'].detect { |l| l['rel'] =~ /#expressions$/ && l['href'] == '/_ruote/expressions' }.should be_nil
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should link to the workitems" do
|
41
|
-
@hash['links'].detect { |l| l['rel'] =~ /#workitems$/ && l['href'] == '/_ruote/workitems' }.should_not be_nil
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "rendering processes" do
|
46
|
-
before(:each) do
|
47
|
-
stub_chain( :request, :fullpath ).and_return('/_ruote/processes')
|
48
|
-
|
49
|
-
@wfid = launch_test_process
|
50
|
-
process = engine.process( @wfid )
|
51
|
-
|
52
|
-
@hash = Rufus::Json.decode( json( :processes, [process] ) )
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should have a collection of processes" do
|
56
|
-
@hash.should have_key('processes')
|
57
|
-
@hash['processes'].should_not be_empty
|
58
|
-
end
|
59
|
-
|
60
|
-
describe "in detail, and" do
|
61
|
-
before(:each) do
|
62
|
-
@process = @hash['processes'].first
|
63
|
-
|
64
|
-
@process.should have_key('links')
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should link to the process details" do
|
68
|
-
|
69
|
-
@process['links'].detect { |l| l['rel'] =~ /#process/ && l['href'] == "/_ruote/processes/#{@wfid}" }.should_not be_nil
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should link to the process expressions" do
|
73
|
-
|
74
|
-
@process['links'].detect { |l| l['rel'] =~ /#expressions/ && l['href'] == "/_ruote/expressions/#{@wfid}" }.should_not be_nil
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should link to the process workitems" do
|
78
|
-
|
79
|
-
@process['links'].detect { |l| l['rel'] =~ /#workitems/ && l['href'] == "/_ruote/workitems/#{@wfid}" }.should_not be_nil
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
describe "rendering a single process" do
|
86
|
-
before(:each) do
|
87
|
-
@wfid = launch_test_process
|
88
|
-
|
89
|
-
stub_chain( :request, :fullpath ).and_return("/_ruote/processes/#{@wfid}")
|
90
|
-
|
91
|
-
process = engine.process( @wfid )
|
92
|
-
|
93
|
-
@hash = Rufus::Json.decode( json( :process, process ) )
|
94
|
-
end
|
95
|
-
|
96
|
-
it "should have the process details" do
|
97
|
-
@hash.should have_key('process')
|
98
|
-
end
|
99
|
-
|
100
|
-
it "should link to the process details" do
|
101
|
-
|
102
|
-
@hash['process']['links'].detect { |l| l['rel'] =~ /#process/ && l['href'] == "/_ruote/processes/#{@wfid}" }.should_not be_nil
|
103
|
-
end
|
104
|
-
|
105
|
-
it "should link to the process expressions" do
|
106
|
-
|
107
|
-
@hash['process']['links'].detect { |l| l['rel'] =~ /#expressions/ && l['href'] == "/_ruote/expressions/#{@wfid}" }.should_not be_nil
|
108
|
-
end
|
109
|
-
|
110
|
-
it "should link to the process workitems" do
|
111
|
-
|
112
|
-
@hash['process']['links'].detect { |l| l['rel'] =~ /#workitems/ && l['href'] == "/_ruote/workitems/#{@wfid}" }.should_not be_nil
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
describe "render a single expression" do
|
117
|
-
before(:each) do
|
118
|
-
@wfid = launch_test_process do
|
119
|
-
Ruote.process_definition :name => 'foo' do
|
120
|
-
sequence do
|
121
|
-
nada :activity => 'work your magic'
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
@expid = '0_0_0'
|
127
|
-
|
128
|
-
stub_chain( :request, :fullpath ).and_return("/_ruote/expressions/#{@wfid}/#{@expid}")
|
129
|
-
|
130
|
-
process = engine.process( @wfid )
|
131
|
-
expression = process.expressions.detect { |exp| exp.fei.expid == @expid }
|
132
|
-
|
133
|
-
@hash = Rufus::Json.decode( json( :expression, expression ) )
|
134
|
-
end
|
135
|
-
|
136
|
-
it "should contain the expression" do
|
137
|
-
@hash.should have_key('expression')
|
138
|
-
end
|
139
|
-
|
140
|
-
it "should link to the process" do
|
141
|
-
@hash['expression']['links'].detect { |l| l['rel'] =~ /#process/ && l['href'] == "/_ruote/processes/#{@wfid}" }.should_not be_nil
|
142
|
-
end
|
143
|
-
|
144
|
-
it "should link to the parent expression" do
|
145
|
-
@hash['expression']['links'].detect { |l| l['rel'] == 'parent' && l['href'] == "/_ruote/expressions/#{@wfid}/0_0" }.should_not be_nil
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
describe "render an expression tree" do
|
150
|
-
before(:each) do
|
151
|
-
@wfid = launch_test_process do
|
152
|
-
Ruote.process_definition :name => 'foo' do
|
153
|
-
sequence do
|
154
|
-
nada :activity => 'work your magic'
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
stub_chain( :request, :fullpath ).and_return("/_ruote/expressions/#{@wfid}")
|
160
|
-
|
161
|
-
process = engine.process( @wfid )
|
162
|
-
|
163
|
-
@hash = Rufus::Json.decode( json( :expressions, process.expressions ) )
|
164
|
-
end
|
165
|
-
|
166
|
-
it "should have the list of expressions" do
|
167
|
-
@hash.should have_key('expressions')
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
describe "rendering a workitem" do
|
172
|
-
before(:each) do
|
173
|
-
@wfid = launch_test_process do
|
174
|
-
Ruote.process_definition :name => 'foo' do
|
175
|
-
sequence do
|
176
|
-
nada :activity => 'work your magic'
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
|
-
stub_chain( :request, :fullpath ).and_return("/_ruote/workitems/#{@wfid}/0_0_0")
|
182
|
-
|
183
|
-
workitem = find_workitem( @wfid, '0_0_0' )
|
184
|
-
|
185
|
-
@hash = Rufus::Json.decode( json( :workitem, workitem ) )
|
186
|
-
end
|
187
|
-
|
188
|
-
it "should have the workitem" do
|
189
|
-
@hash.should have_key('workitem')
|
190
|
-
end
|
191
|
-
|
192
|
-
end
|
193
|
-
|
194
|
-
describe "rendering workitems" do
|
195
|
-
before(:each) do
|
196
|
-
@wfid = launch_test_process do
|
197
|
-
Ruote.process_definition :name => 'foo' do
|
198
|
-
sequence do
|
199
|
-
nada :activity => 'work your magic'
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
|
-
stub_chain( :request, :fullpath ).and_return("/_ruote/workitems")
|
205
|
-
|
206
|
-
@hash = Rufus::Json.decode( json( :workitems, storage_participant.all ) )
|
207
|
-
end
|
208
|
-
|
209
|
-
it "should have the workitems" do
|
210
|
-
@hash.should have_key('workitems')
|
211
|
-
end
|
212
|
-
|
213
|
-
end
|
214
|
-
end
|
data/spec/ruote-kit_spec.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
|
4
|
-
undef :context if defined?(context)
|
5
|
-
|
6
|
-
|
7
|
-
describe "expressions.html.haml", :type => :with_engine do
|
8
|
-
|
9
|
-
describe "without expressions" do
|
10
|
-
it "should be helpful" do
|
11
|
-
render "expressions.html.haml"
|
12
|
-
|
13
|
-
response.should match(/Expressions are atomic pieces of process instances/)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "with expressions" do
|
18
|
-
before(:each) do
|
19
|
-
@wfid = launch_test_process
|
20
|
-
@process = engine.process( @wfid )
|
21
|
-
|
22
|
-
assigns[:process] = @process
|
23
|
-
|
24
|
-
render 'expressions.html.haml'
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should have the process id" do
|
28
|
-
response.should include(@wfid)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "launch_process.html.haml", :type => :with_engine do
|
4
|
-
|
5
|
-
it "should have a process definition field" do
|
6
|
-
render 'launch_process.html.haml'
|
7
|
-
|
8
|
-
response.should have_selector('textarea', :name => 'process_definition')
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should have a workitem fields field" do
|
12
|
-
render 'launch_process.html.haml'
|
13
|
-
|
14
|
-
response.should have_selector('textarea', :name => 'process_fields')
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should have a workitem variables field" do
|
18
|
-
render 'launch_process.html.haml'
|
19
|
-
|
20
|
-
response.should have_selector('textarea', :name => 'process_variables')
|
21
|
-
end
|
22
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "process.html.haml", :type => :with_engine do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
@wfid = launch_test_process
|
7
|
-
@process = engine.process( @wfid )
|
8
|
-
|
9
|
-
assigns[:process] = @process
|
10
|
-
|
11
|
-
render 'process.html.haml'
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should have the process name" do
|
15
|
-
response.should include(@wfid)
|
16
|
-
end
|
17
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "process_launched.html.haml", :type => :with_engine do
|
4
|
-
|
5
|
-
before(:each) do
|
6
|
-
@wfid = launch_test_process
|
7
|
-
|
8
|
-
assigns[:wfid] = @wfid
|
9
|
-
|
10
|
-
render 'process_launched.html.haml'
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should have the process id" do
|
14
|
-
response.should include(@wfid)
|
15
|
-
end
|
16
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "processes.html.haml", :type => :with_engine do
|
4
|
-
|
5
|
-
describe "without processes" do
|
6
|
-
before(:each) do
|
7
|
-
assigns[:processes] = []
|
8
|
-
|
9
|
-
render 'processes.html.haml'
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should give a nice notice" do
|
13
|
-
response.should contain(/No processes are currently running/)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "with processes" do
|
18
|
-
before(:each) do
|
19
|
-
@wfid = launch_test_process
|
20
|
-
@process = engine.process( @wfid )
|
21
|
-
|
22
|
-
assigns[:processes] = [ @process ]
|
23
|
-
|
24
|
-
render 'processes.html.haml'
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should count the processes" do
|
28
|
-
response.should contain(/Currently running 1 processes/)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "workitems.html.haml", :type => :with_engine do
|
4
|
-
|
5
|
-
describe "rendering no workitems" do
|
6
|
-
before(:each) do
|
7
|
-
assigns[:workitems] = []
|
8
|
-
|
9
|
-
render 'workitems.html.haml'
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should note so" do
|
13
|
-
response.should have_selector('div.warn p', :content => "No workitems are currently available")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "rendering all workitems" do
|
18
|
-
before(:each) do
|
19
|
-
@wfid1 = launch_test_process
|
20
|
-
@wfid2 = launch_test_process
|
21
|
-
|
22
|
-
assigns[:workitems] = storage_participant.all
|
23
|
-
|
24
|
-
render 'workitems.html.haml'
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should have a notice" do
|
28
|
-
response.should have_selector('div.notice p', :content => "2 workitems available")
|
29
|
-
end
|
30
|
-
|
31
|
-
it "should show the processes" do
|
32
|
-
response.should include(@wfid1)
|
33
|
-
response.should include(@wfid2)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe "rendering process workitems" do
|
38
|
-
before(:each) do
|
39
|
-
@wfid = launch_test_process
|
40
|
-
|
41
|
-
assigns[:wfid] = @wfid
|
42
|
-
assigns[:workitems] = find_workitems( @wfid )
|
43
|
-
|
44
|
-
render "workitems.html.haml"
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should have a notice" do
|
48
|
-
response.should have_selector('div.notice p', :content => "1 workitem available for #{@wfid}")
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should show the process" do
|
52
|
-
response.should include(@wfid)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe "rendering filtered workitems" do
|
57
|
-
before(:each) do
|
58
|
-
assigns[:workitems] = []
|
59
|
-
end
|
60
|
-
|
61
|
-
it "should show the participants used" do
|
62
|
-
assigns[:participants] = ['jack']
|
63
|
-
|
64
|
-
render 'workitems.html.haml'
|
65
|
-
|
66
|
-
response.should have_selector('div.notice p', :content => "Filtered for participant(s): jack")
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|