level_up 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.txt +4 -0
- data/app/assets/stylesheets/level_up/application.css.scss +1 -1
- data/app/controllers/level_up/flowcharts_controller.rb +38 -0
- data/app/controllers/level_up/jobs_controller.rb +7 -30
- data/app/models/level_up/graph_builder.rb +80 -0
- data/app/views/layouts/level_up/_header.html.erb +3 -2
- data/app/views/level_up/flowcharts/index.html.erb +36 -0
- data/app/views/level_up/flowcharts/show.html.erb +20 -0
- data/config/routes.rb +4 -0
- data/lib/level_up/version.rb +1 -1
- data/test/dummy/config/environments/development.rb +3 -3
- data/test/dummy/config/initializers/preload_sti_models.rb +5 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +845 -3294
- data/test/dummy/log/test.log +6557 -14587
- data/test/dummy/tmp/{job_1.svg → account_banish.svg} +0 -0
- data/test/dummy/tmp/account_downgrade.svg +123 -0
- data/test/dummy/tmp/account_upgrade.svg +48 -0
- data/test/dummy/tmp/cache/assets/C2C/CE0/sprockets%2F33f519d653c9b4886c417440a0993824 +0 -0
- data/test/dummy/tmp/cache/assets/C6A/F00/sprockets%2F177385361781d5fe78d217f1f48b8566 +0 -0
- data/test/dummy/tmp/cache/assets/C6C/ED0/sprockets%2F320c25374f5ea136824c04c256e1605b +0 -0
- data/test/dummy/tmp/cache/assets/C87/110/sprockets%2Fc4428c04b8830f451f7636c2811f975d +0 -0
- data/test/dummy/tmp/cache/assets/CB9/E40/sprockets%2F43e6286ecc7751fc65d32b72c6158940 +0 -0
- data/test/dummy/tmp/cache/assets/CCE/7E0/sprockets%2F7d295633b50bfa8b04345d5e600b343a +0 -0
- data/test/dummy/tmp/cache/assets/CD5/450/sprockets%2F2ac0e7e07211a99107e0ba7e2680c885 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/220/sprockets%2Ff1a78dd6750c553265fd3a242d76c277 +0 -0
- data/test/dummy/tmp/cache/assets/CF7/BA0/sprockets%2F8f9487ea6943415e46a5d895e0920ebe +0 -0
- data/test/dummy/tmp/cache/assets/D0E/2B0/sprockets%2F3e386ff8d231b92766061c4fad4ad504 +0 -0
- data/test/dummy/tmp/cache/assets/D19/660/sprockets%2F018d64588c824dd3e7e6c8d6d0d6510e +0 -0
- data/test/dummy/tmp/cache/assets/D25/E10/sprockets%2F989ec024c5db6ae875689b410f8e6d53 +0 -0
- data/test/dummy/tmp/cache/assets/D33/200/sprockets%2Fc291105cf21ca8e744c65f3d4f446aa1 +0 -0
- data/test/dummy/tmp/cache/assets/D34/610/sprockets%2Fcc081ecb5b32894151f16a144383befe +0 -0
- data/test/dummy/tmp/cache/assets/D4D/110/sprockets%2Fc16dfb491d9b98f482b4f0059dd355b8 +0 -0
- data/test/dummy/tmp/cache/assets/D4F/890/sprockets%2Fe3f96e9aa9b032c43788676c5ce066db +0 -0
- data/test/dummy/tmp/cache/assets/D53/370/sprockets%2F1cf0ca91840a1483edcac4d0c403b149 +0 -0
- data/test/dummy/tmp/cache/assets/D69/B90/sprockets%2Fdb0ee3e51128419c85616ceaca66ab58 +0 -0
- data/test/dummy/tmp/cache/assets/D75/B20/sprockets%2Fb659146edbe91be3b1b9d64cb9370c76 +0 -0
- data/test/dummy/tmp/cache/assets/D79/430/sprockets%2Fc030f9d26fab468c49dc494195d77eab +0 -0
- data/test/dummy/tmp/cache/assets/D9D/3C0/sprockets%2F3019d99c7bae1e55eb7c2bf4688b1b1a +0 -0
- data/test/dummy/tmp/cache/assets/DAA/1A0/sprockets%2Fba643993838fce8ddc1d42e6ce1fc346 +0 -0
- data/test/dummy/tmp/cache/assets/DD4/DA0/sprockets%2F17fadf3354a429c53acfe9fca6268d5d +0 -0
- data/test/dummy/tmp/cache/assets/DF8/880/sprockets%2F255d8bde2bf6681724e4ddedcc3cbc02 +0 -0
- data/test/dummy/tmp/job_2.svg +109 -64
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/unit/level_up/graph_builder_test.rb +77 -0
- data/test/unit/level_up/job_test.rb +7 -7
- metadata +20 -8
- data/test/dummy/tmp/job_3.svg +0 -78
|
File without changes
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 2.30.1 (20130311.1815)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: G Pages: 1 -->
|
|
7
|
+
<svg width="342pt" height="548pt"
|
|
8
|
+
viewBox="0.00 0.00 342.00 548.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 544)">
|
|
10
|
+
<title>G</title>
|
|
11
|
+
<polygon fill="#fafbfb" stroke="#fafbfb" points="-4,5 -4,-544 339,-544 339,5 -4,5"/>
|
|
12
|
+
<!-- start -->
|
|
13
|
+
<g id="node1" class="node"><title>start</title>
|
|
14
|
+
<polygon fill="#5db1a4" stroke="#048282" points="158,-540 104,-540 104,-504 158,-504 158,-540"/>
|
|
15
|
+
<text text-anchor="middle" x="131" y="-518.209" font-family="Verdana" font-size="14.00" fill="white">start</text>
|
|
16
|
+
</g>
|
|
17
|
+
<!-- account validation -->
|
|
18
|
+
<g id="node2" class="node"><title>account validation</title>
|
|
19
|
+
<polygon fill="#666666" stroke="#111111" points="202.201,-468 59.7986,-468 59.7986,-432 202.201,-432 202.201,-468"/>
|
|
20
|
+
<text text-anchor="middle" x="131" y="-446.209" font-family="Verdana" font-size="14.00" fill="white">account validation</text>
|
|
21
|
+
</g>
|
|
22
|
+
<!-- start->account validation -->
|
|
23
|
+
<g id="edge1" class="edge"><title>start->account validation</title>
|
|
24
|
+
<path fill="none" stroke="#000000" d="M131,-503.697C131,-495.983 131,-486.712 131,-478.112"/>
|
|
25
|
+
<polygon fill="#000000" stroke="#000000" points="131,-468.104 135.5,-478.104 131,-473.104 131,-478.104 131,-478.104 131,-478.104 131,-473.104 126.5,-478.104 131,-468.104 131,-468.104"/>
|
|
26
|
+
</g>
|
|
27
|
+
<!-- account update -->
|
|
28
|
+
<g id="node3" class="node"><title>account update</title>
|
|
29
|
+
<polygon fill="#666666" stroke="#111111" points="244.165,-396 119.835,-396 119.835,-360 244.165,-360 244.165,-396"/>
|
|
30
|
+
<text text-anchor="middle" x="182" y="-374.209" font-family="Verdana" font-size="14.00" fill="white">account update</text>
|
|
31
|
+
</g>
|
|
32
|
+
<!-- account validation->account update -->
|
|
33
|
+
<g id="edge2" class="edge"><title>account validation->account update</title>
|
|
34
|
+
<path fill="none" stroke="#000000" d="M143.607,-431.697C149.597,-423.474 156.876,-413.483 163.479,-404.421"/>
|
|
35
|
+
<polygon fill="#000000" stroke="#000000" points="169.538,-396.104 167.287,-406.837 166.594,-400.146 163.65,-404.187 163.65,-404.187 163.65,-404.187 166.594,-400.146 160.013,-401.537 169.538,-396.104 169.538,-396.104"/>
|
|
36
|
+
</g>
|
|
37
|
+
<!-- service delete -->
|
|
38
|
+
<g id="node8" class="node"><title>service delete</title>
|
|
39
|
+
<polygon fill="#666666" stroke="#111111" points="112.543,-324 -0.543174,-324 -0.543174,-288 112.543,-288 112.543,-324"/>
|
|
40
|
+
<text text-anchor="middle" x="56" y="-302.209" font-family="Verdana" font-size="14.00" fill="white">service delete</text>
|
|
41
|
+
</g>
|
|
42
|
+
<!-- account validation->service delete -->
|
|
43
|
+
<g id="edge3" class="edge"><title>account validation->service delete</title>
|
|
44
|
+
<path fill="none" stroke="#000000" d="M121.953,-431.871C109.002,-407.35 85.0663,-362.032 69.8691,-333.259"/>
|
|
45
|
+
<polygon fill="#000000" stroke="#000000" points="65.0788,-324.189 73.7283,-330.93 67.414,-328.61 69.7492,-333.032 69.7492,-333.032 69.7492,-333.032 67.414,-328.61 65.7701,-335.133 65.0788,-324.189 65.0788,-324.189"/>
|
|
46
|
+
</g>
|
|
47
|
+
<!-- account update->service delete -->
|
|
48
|
+
<g id="edge4" class="edge"><title>account update->service delete</title>
|
|
49
|
+
<path fill="none" stroke="#000000" d="M151.177,-359.876C134.55,-350.639 113.835,-339.131 95.9808,-329.212"/>
|
|
50
|
+
<polygon fill="#000000" stroke="#000000" points="86.9416,-324.19 97.8686,-325.113 91.3123,-326.618 95.6831,-329.046 95.6831,-329.046 95.6831,-329.046 91.3123,-326.618 93.4977,-332.98 86.9416,-324.19 86.9416,-324.19"/>
|
|
51
|
+
</g>
|
|
52
|
+
<!-- mail suspension -->
|
|
53
|
+
<g id="node4" class="node"><title>mail suspension</title>
|
|
54
|
+
<polygon fill="#666666" stroke="#111111" points="259.37,-324 130.63,-324 130.63,-288 259.37,-288 259.37,-324"/>
|
|
55
|
+
<text text-anchor="middle" x="195" y="-302.209" font-family="Verdana" font-size="14.00" fill="white">mail suspension</text>
|
|
56
|
+
</g>
|
|
57
|
+
<!-- account update->mail suspension -->
|
|
58
|
+
<g id="edge5" class="edge"><title>account update->mail suspension</title>
|
|
59
|
+
<path fill="none" stroke="#000000" d="M185.213,-359.697C186.646,-351.983 188.368,-342.712 189.965,-334.112"/>
|
|
60
|
+
<polygon fill="#000000" stroke="#000000" points="191.823,-324.104 194.422,-334.758 190.91,-329.02 189.997,-333.936 189.997,-333.936 189.997,-333.936 190.91,-329.02 185.573,-333.115 191.823,-324.104 191.823,-324.104"/>
|
|
61
|
+
</g>
|
|
62
|
+
<!-- service update -->
|
|
63
|
+
<g id="node5" class="node"><title>service update</title>
|
|
64
|
+
<polygon fill="#666666" stroke="#111111" points="254.146,-252 135.854,-252 135.854,-216 254.146,-216 254.146,-252"/>
|
|
65
|
+
<text text-anchor="middle" x="195" y="-230.209" font-family="Verdana" font-size="14.00" fill="white">service update</text>
|
|
66
|
+
</g>
|
|
67
|
+
<!-- mail suspension->service update -->
|
|
68
|
+
<g id="edge6" class="edge"><title>mail suspension->service update</title>
|
|
69
|
+
<path fill="none" stroke="#000000" d="M195,-287.697C195,-279.983 195,-270.712 195,-262.112"/>
|
|
70
|
+
<polygon fill="#000000" stroke="#000000" points="195,-252.104 199.5,-262.104 195,-257.104 195,-262.104 195,-262.104 195,-262.104 195,-257.104 190.5,-262.104 195,-252.104 195,-252.104"/>
|
|
71
|
+
</g>
|
|
72
|
+
<!-- waiting renewal -->
|
|
73
|
+
<g id="node6" class="node"><title>waiting renewal</title>
|
|
74
|
+
<polygon fill="#666666" stroke="#111111" points="257.889,-180 132.111,-180 132.111,-144 257.889,-144 257.889,-180"/>
|
|
75
|
+
<text text-anchor="middle" x="195" y="-158.209" font-family="Verdana" font-size="14.00" fill="white">waiting renewal</text>
|
|
76
|
+
</g>
|
|
77
|
+
<!-- service update->waiting renewal -->
|
|
78
|
+
<g id="edge7" class="edge"><title>service update->waiting renewal</title>
|
|
79
|
+
<path fill="none" stroke="#000000" d="M195,-215.697C195,-207.983 195,-198.712 195,-190.112"/>
|
|
80
|
+
<polygon fill="#000000" stroke="#000000" points="195,-180.104 199.5,-190.104 195,-185.104 195,-190.104 195,-190.104 195,-190.104 195,-185.104 190.5,-190.104 195,-180.104 195,-180.104"/>
|
|
81
|
+
</g>
|
|
82
|
+
<!-- manual deletion -->
|
|
83
|
+
<g id="node7" class="node"><title>manual deletion</title>
|
|
84
|
+
<polygon fill="#666666" stroke="#111111" points="334.157,-108 205.843,-108 205.843,-72 334.157,-72 334.157,-108"/>
|
|
85
|
+
<text text-anchor="middle" x="270" y="-86.2088" font-family="Verdana" font-size="14.00" fill="white">manual deletion</text>
|
|
86
|
+
</g>
|
|
87
|
+
<!-- waiting renewal->manual deletion -->
|
|
88
|
+
<g id="edge8" class="edge"><title>waiting renewal->manual deletion</title>
|
|
89
|
+
<path fill="none" stroke="#000000" d="M213.539,-143.697C222.803,-135.05 234.162,-124.449 244.257,-115.027"/>
|
|
90
|
+
<polygon fill="#000000" stroke="#000000" points="251.674,-108.104 247.434,-118.217 248.019,-111.516 244.363,-114.928 244.363,-114.928 244.363,-114.928 248.019,-111.516 241.293,-111.638 251.674,-108.104 251.674,-108.104"/>
|
|
91
|
+
</g>
|
|
92
|
+
<!-- mail activation -->
|
|
93
|
+
<g id="node9" class="node"><title>mail activation</title>
|
|
94
|
+
<polygon fill="#666666" stroke="#111111" points="171.12,-108 52.8799,-108 52.8799,-72 171.12,-72 171.12,-108"/>
|
|
95
|
+
<text text-anchor="middle" x="112" y="-86.2088" font-family="Verdana" font-size="14.00" fill="white">mail activation</text>
|
|
96
|
+
</g>
|
|
97
|
+
<!-- waiting renewal->mail activation -->
|
|
98
|
+
<g id="edge9" class="edge"><title>waiting renewal->mail activation</title>
|
|
99
|
+
<path fill="none" stroke="#000000" d="M174.483,-143.697C164.131,-134.965 151.414,-124.24 140.161,-114.75"/>
|
|
100
|
+
<polygon fill="#000000" stroke="#000000" points="132.281,-108.104 142.826,-111.111 136.103,-111.328 139.925,-114.551 139.925,-114.551 139.925,-114.551 136.103,-111.328 137.024,-117.991 132.281,-108.104 132.281,-108.104"/>
|
|
101
|
+
</g>
|
|
102
|
+
<!-- manual deletion->account update -->
|
|
103
|
+
<g id="edge10" class="edge"><title>manual deletion->account update</title>
|
|
104
|
+
<path fill="none" stroke="#000000" d="M275.129,-108.227C286.181,-148.903 308.143,-252.825 268,-324 260.72,-336.908 248.876,-347.069 236.274,-354.891"/>
|
|
105
|
+
<polygon fill="#000000" stroke="#000000" points="227.475,-359.937 233.911,-351.058 231.813,-357.449 236.15,-354.962 236.15,-354.962 236.15,-354.962 231.813,-357.449 238.389,-358.865 227.475,-359.937 227.475,-359.937"/>
|
|
106
|
+
</g>
|
|
107
|
+
<!-- service delete->mail activation -->
|
|
108
|
+
<g id="edge11" class="edge"><title>service delete->mail activation</title>
|
|
109
|
+
<path fill="none" stroke="#000000" d="M60.4881,-287.849C70.1954,-250.753 93.2086,-162.81 104.908,-118.103"/>
|
|
110
|
+
<polygon fill="#000000" stroke="#000000" points="107.491,-108.232 109.312,-119.046 106.225,-113.07 104.959,-117.907 104.959,-117.907 104.959,-117.907 106.225,-113.07 100.606,-116.767 107.491,-108.232 107.491,-108.232"/>
|
|
111
|
+
</g>
|
|
112
|
+
<!-- end -->
|
|
113
|
+
<g id="node10" class="node"><title>end</title>
|
|
114
|
+
<polygon fill="#b40d28" stroke="#600615" points="139,-36 85,-36 85,-0 139,-0 139,-36"/>
|
|
115
|
+
<text text-anchor="middle" x="112" y="-14.2088" font-family="Verdana" font-size="14.00" fill="white">end</text>
|
|
116
|
+
</g>
|
|
117
|
+
<!-- mail activation->end -->
|
|
118
|
+
<g id="edge12" class="edge"><title>mail activation->end</title>
|
|
119
|
+
<path fill="none" stroke="#000000" d="M112,-71.6966C112,-63.9827 112,-54.7125 112,-46.1124"/>
|
|
120
|
+
<polygon fill="#000000" stroke="#000000" points="112,-36.1043 116.5,-46.1043 112,-41.1043 112,-46.1043 112,-46.1043 112,-46.1043 112,-41.1043 107.5,-46.1044 112,-36.1043 112,-36.1043"/>
|
|
121
|
+
</g>
|
|
122
|
+
</g>
|
|
123
|
+
</svg>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
|
3
|
+
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Generated by graphviz version 2.30.1 (20130311.1815)
|
|
5
|
+
-->
|
|
6
|
+
<!-- Title: G Pages: 1 -->
|
|
7
|
+
<svg width="144pt" height="260pt"
|
|
8
|
+
viewBox="0.00 0.00 144.00 260.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 256)">
|
|
10
|
+
<title>G</title>
|
|
11
|
+
<polygon fill="#fafbfb" stroke="#fafbfb" points="-4,5 -4,-256 141,-256 141,5 -4,5"/>
|
|
12
|
+
<!-- start -->
|
|
13
|
+
<g id="node1" class="node"><title>start</title>
|
|
14
|
+
<polygon fill="#5db1a4" stroke="#048282" points="95,-252 41,-252 41,-216 95,-216 95,-252"/>
|
|
15
|
+
<text text-anchor="middle" x="68" y="-230.209" font-family="Verdana" font-size="14.00" fill="white">start</text>
|
|
16
|
+
</g>
|
|
17
|
+
<!-- upgrade -->
|
|
18
|
+
<g id="node2" class="node"><title>upgrade</title>
|
|
19
|
+
<polygon fill="#666666" stroke="#111111" points="104.132,-180 31.8679,-180 31.8679,-144 104.132,-144 104.132,-180"/>
|
|
20
|
+
<text text-anchor="middle" x="68" y="-158.209" font-family="Verdana" font-size="14.00" fill="white">upgrade</text>
|
|
21
|
+
</g>
|
|
22
|
+
<!-- start->upgrade -->
|
|
23
|
+
<g id="edge1" class="edge"><title>start->upgrade</title>
|
|
24
|
+
<path fill="none" stroke="#000000" d="M68,-215.697C68,-207.983 68,-198.712 68,-190.112"/>
|
|
25
|
+
<polygon fill="#000000" stroke="#000000" points="68,-180.104 72.5001,-190.104 68,-185.104 68.0001,-190.104 68.0001,-190.104 68.0001,-190.104 68,-185.104 63.5001,-190.104 68,-180.104 68,-180.104"/>
|
|
26
|
+
</g>
|
|
27
|
+
<!-- email notification -->
|
|
28
|
+
<g id="node3" class="node"><title>email notification</title>
|
|
29
|
+
<polygon fill="#666666" stroke="#111111" points="136.15,-108 -0.149935,-108 -0.149935,-72 136.15,-72 136.15,-108"/>
|
|
30
|
+
<text text-anchor="middle" x="68" y="-86.2088" font-family="Verdana" font-size="14.00" fill="white">email notification</text>
|
|
31
|
+
</g>
|
|
32
|
+
<!-- upgrade->email notification -->
|
|
33
|
+
<g id="edge2" class="edge"><title>upgrade->email notification</title>
|
|
34
|
+
<path fill="none" stroke="#000000" d="M68,-143.697C68,-135.983 68,-126.712 68,-118.112"/>
|
|
35
|
+
<polygon fill="#000000" stroke="#000000" points="68,-108.104 72.5001,-118.104 68,-113.104 68.0001,-118.104 68.0001,-118.104 68.0001,-118.104 68,-113.104 63.5001,-118.104 68,-108.104 68,-108.104"/>
|
|
36
|
+
</g>
|
|
37
|
+
<!-- end -->
|
|
38
|
+
<g id="node4" class="node"><title>end</title>
|
|
39
|
+
<polygon fill="#b40d28" stroke="#600615" points="95,-36 41,-36 41,-0 95,-0 95,-36"/>
|
|
40
|
+
<text text-anchor="middle" x="68" y="-14.2088" font-family="Verdana" font-size="14.00" fill="white">end</text>
|
|
41
|
+
</g>
|
|
42
|
+
<!-- email notification->end -->
|
|
43
|
+
<g id="edge3" class="edge"><title>email notification->end</title>
|
|
44
|
+
<path fill="none" stroke="#000000" d="M68,-71.6966C68,-63.9827 68,-54.7125 68,-46.1124"/>
|
|
45
|
+
<polygon fill="#000000" stroke="#000000" points="68,-36.1043 72.5001,-46.1043 68,-41.1043 68.0001,-46.1043 68.0001,-46.1043 68.0001,-46.1043 68,-41.1043 63.5001,-46.1044 68,-36.1043 68,-36.1043"/>
|
|
46
|
+
</g>
|
|
47
|
+
</g>
|
|
48
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/test/dummy/tmp/job_2.svg
CHANGED
|
@@ -4,75 +4,120 @@
|
|
|
4
4
|
<!-- Generated by graphviz version 2.30.1 (20130311.1815)
|
|
5
5
|
-->
|
|
6
6
|
<!-- Title: G Pages: 1 -->
|
|
7
|
-
<svg width="
|
|
8
|
-
viewBox="0.00 0.00
|
|
9
|
-
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4
|
|
7
|
+
<svg width="342pt" height="548pt"
|
|
8
|
+
viewBox="0.00 0.00 342.00 548.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
9
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 544)">
|
|
10
10
|
<title>G</title>
|
|
11
|
-
<polygon fill="#fafbfb" stroke="#fafbfb" points="-4,5 -4,-
|
|
11
|
+
<polygon fill="#fafbfb" stroke="#fafbfb" points="-4,5 -4,-544 339,-544 339,5 -4,5"/>
|
|
12
12
|
<!-- start -->
|
|
13
13
|
<g id="node1" class="node"><title>start</title>
|
|
14
|
-
<polygon fill="#5db1a4" stroke="#048282" points="
|
|
15
|
-
<text text-anchor="middle" x="
|
|
16
|
-
</g>
|
|
17
|
-
<!--
|
|
18
|
-
<g id="node2" class="node"><title>
|
|
19
|
-
<polygon fill="#666666" stroke="#111111" points="
|
|
20
|
-
<text text-anchor="middle" x="
|
|
21
|
-
</g>
|
|
22
|
-
<!-- start->
|
|
23
|
-
<g id="edge1" class="edge"><title>start->
|
|
24
|
-
<path fill="none" stroke="#000000" d="
|
|
25
|
-
<polygon fill="#000000" stroke="#000000" points="
|
|
26
|
-
</g>
|
|
27
|
-
<!--
|
|
28
|
-
<g id="node3" class="node"><title>
|
|
29
|
-
<polygon fill="#666666" stroke="#111111" points="
|
|
30
|
-
<text text-anchor="middle" x="
|
|
31
|
-
</g>
|
|
32
|
-
<!--
|
|
33
|
-
<g id="edge2" class="edge"><title>
|
|
34
|
-
<path fill="none" stroke="#000000" d="
|
|
35
|
-
<polygon fill="#000000" stroke="#000000" points="
|
|
36
|
-
</g>
|
|
37
|
-
<!--
|
|
38
|
-
<g id="
|
|
39
|
-
<polygon fill="#666666" stroke="#111111" points="
|
|
40
|
-
<text text-anchor="middle" x="
|
|
41
|
-
</g>
|
|
42
|
-
<!--
|
|
43
|
-
<g id="edge3" class="edge"><title>
|
|
44
|
-
<path fill="none" stroke="#000000" d="
|
|
45
|
-
<polygon fill="#000000" stroke="#000000" points="
|
|
46
|
-
</g>
|
|
47
|
-
<!--
|
|
48
|
-
<g id="edge4" class="edge"><title>
|
|
49
|
-
<path fill="none" stroke="#000000" d="
|
|
50
|
-
<polygon fill="#000000" stroke="#000000" points="
|
|
51
|
-
</g>
|
|
52
|
-
<!--
|
|
53
|
-
<g id="node4" class="node"><title>
|
|
54
|
-
<polygon fill="#666666" stroke="#111111" points="
|
|
55
|
-
<text text-anchor="middle" x="
|
|
56
|
-
</g>
|
|
57
|
-
<!--
|
|
58
|
-
<g id="edge5" class="edge"><title>
|
|
59
|
-
<path fill="none" stroke="#000000" d="
|
|
60
|
-
<polygon fill="#000000" stroke="#000000" points="
|
|
14
|
+
<polygon fill="#5db1a4" stroke="#048282" points="158,-540 104,-540 104,-504 158,-504 158,-540"/>
|
|
15
|
+
<text text-anchor="middle" x="131" y="-518.209" font-family="Verdana" font-size="14.00" fill="white">start</text>
|
|
16
|
+
</g>
|
|
17
|
+
<!-- account validation -->
|
|
18
|
+
<g id="node2" class="node"><title>account validation</title>
|
|
19
|
+
<polygon fill="#666666" stroke="#111111" points="202.201,-468 59.7986,-468 59.7986,-432 202.201,-432 202.201,-468"/>
|
|
20
|
+
<text text-anchor="middle" x="131" y="-446.209" font-family="Verdana" font-size="14.00" fill="white">account validation</text>
|
|
21
|
+
</g>
|
|
22
|
+
<!-- start->account validation -->
|
|
23
|
+
<g id="edge1" class="edge"><title>start->account validation</title>
|
|
24
|
+
<path fill="none" stroke="#000000" d="M131,-503.697C131,-495.983 131,-486.712 131,-478.112"/>
|
|
25
|
+
<polygon fill="#000000" stroke="#000000" points="131,-468.104 135.5,-478.104 131,-473.104 131,-478.104 131,-478.104 131,-478.104 131,-473.104 126.5,-478.104 131,-468.104 131,-468.104"/>
|
|
26
|
+
</g>
|
|
27
|
+
<!-- account update -->
|
|
28
|
+
<g id="node3" class="node"><title>account update</title>
|
|
29
|
+
<polygon fill="#666666" stroke="#111111" points="244.165,-396 119.835,-396 119.835,-360 244.165,-360 244.165,-396"/>
|
|
30
|
+
<text text-anchor="middle" x="182" y="-374.209" font-family="Verdana" font-size="14.00" fill="white">account update</text>
|
|
31
|
+
</g>
|
|
32
|
+
<!-- account validation->account update -->
|
|
33
|
+
<g id="edge2" class="edge"><title>account validation->account update</title>
|
|
34
|
+
<path fill="none" stroke="#000000" d="M143.607,-431.697C149.597,-423.474 156.876,-413.483 163.479,-404.421"/>
|
|
35
|
+
<polygon fill="#000000" stroke="#000000" points="169.538,-396.104 167.287,-406.837 166.594,-400.146 163.65,-404.187 163.65,-404.187 163.65,-404.187 166.594,-400.146 160.013,-401.537 169.538,-396.104 169.538,-396.104"/>
|
|
36
|
+
</g>
|
|
37
|
+
<!-- service delete -->
|
|
38
|
+
<g id="node8" class="node"><title>service delete</title>
|
|
39
|
+
<polygon fill="#666666" stroke="#111111" points="112.543,-324 -0.543174,-324 -0.543174,-288 112.543,-288 112.543,-324"/>
|
|
40
|
+
<text text-anchor="middle" x="56" y="-302.209" font-family="Verdana" font-size="14.00" fill="white">service delete</text>
|
|
41
|
+
</g>
|
|
42
|
+
<!-- account validation->service delete -->
|
|
43
|
+
<g id="edge3" class="edge"><title>account validation->service delete</title>
|
|
44
|
+
<path fill="none" stroke="#000000" d="M121.953,-431.871C109.002,-407.35 85.0663,-362.032 69.8691,-333.259"/>
|
|
45
|
+
<polygon fill="#000000" stroke="#000000" points="65.0788,-324.189 73.7283,-330.93 67.414,-328.61 69.7492,-333.032 69.7492,-333.032 69.7492,-333.032 67.414,-328.61 65.7701,-335.133 65.0788,-324.189 65.0788,-324.189"/>
|
|
46
|
+
</g>
|
|
47
|
+
<!-- account update->service delete -->
|
|
48
|
+
<g id="edge4" class="edge"><title>account update->service delete</title>
|
|
49
|
+
<path fill="none" stroke="#000000" d="M151.177,-359.876C134.55,-350.639 113.835,-339.131 95.9808,-329.212"/>
|
|
50
|
+
<polygon fill="#000000" stroke="#000000" points="86.9416,-324.19 97.8686,-325.113 91.3123,-326.618 95.6831,-329.046 95.6831,-329.046 95.6831,-329.046 91.3123,-326.618 93.4977,-332.98 86.9416,-324.19 86.9416,-324.19"/>
|
|
51
|
+
</g>
|
|
52
|
+
<!-- mail suspension -->
|
|
53
|
+
<g id="node4" class="node"><title>mail suspension</title>
|
|
54
|
+
<polygon fill="#666666" stroke="#111111" points="259.37,-324 130.63,-324 130.63,-288 259.37,-288 259.37,-324"/>
|
|
55
|
+
<text text-anchor="middle" x="195" y="-302.209" font-family="Verdana" font-size="14.00" fill="white">mail suspension</text>
|
|
56
|
+
</g>
|
|
57
|
+
<!-- account update->mail suspension -->
|
|
58
|
+
<g id="edge5" class="edge"><title>account update->mail suspension</title>
|
|
59
|
+
<path fill="none" stroke="#000000" d="M185.213,-359.697C186.646,-351.983 188.368,-342.712 189.965,-334.112"/>
|
|
60
|
+
<polygon fill="#000000" stroke="#000000" points="191.823,-324.104 194.422,-334.758 190.91,-329.02 189.997,-333.936 189.997,-333.936 189.997,-333.936 190.91,-329.02 185.573,-333.115 191.823,-324.104 191.823,-324.104"/>
|
|
61
|
+
</g>
|
|
62
|
+
<!-- service update -->
|
|
63
|
+
<g id="node5" class="node"><title>service update</title>
|
|
64
|
+
<polygon fill="#666666" stroke="#111111" points="254.146,-252 135.854,-252 135.854,-216 254.146,-216 254.146,-252"/>
|
|
65
|
+
<text text-anchor="middle" x="195" y="-230.209" font-family="Verdana" font-size="14.00" fill="white">service update</text>
|
|
66
|
+
</g>
|
|
67
|
+
<!-- mail suspension->service update -->
|
|
68
|
+
<g id="edge6" class="edge"><title>mail suspension->service update</title>
|
|
69
|
+
<path fill="none" stroke="#000000" d="M195,-287.697C195,-279.983 195,-270.712 195,-262.112"/>
|
|
70
|
+
<polygon fill="#000000" stroke="#000000" points="195,-252.104 199.5,-262.104 195,-257.104 195,-262.104 195,-262.104 195,-262.104 195,-257.104 190.5,-262.104 195,-252.104 195,-252.104"/>
|
|
71
|
+
</g>
|
|
72
|
+
<!-- waiting renewal -->
|
|
73
|
+
<g id="node6" class="node"><title>waiting renewal</title>
|
|
74
|
+
<polygon fill="#666666" stroke="#111111" points="257.889,-180 132.111,-180 132.111,-144 257.889,-144 257.889,-180"/>
|
|
75
|
+
<text text-anchor="middle" x="195" y="-158.209" font-family="Verdana" font-size="14.00" fill="white">waiting renewal</text>
|
|
76
|
+
</g>
|
|
77
|
+
<!-- service update->waiting renewal -->
|
|
78
|
+
<g id="edge7" class="edge"><title>service update->waiting renewal</title>
|
|
79
|
+
<path fill="none" stroke="#000000" d="M195,-215.697C195,-207.983 195,-198.712 195,-190.112"/>
|
|
80
|
+
<polygon fill="#000000" stroke="#000000" points="195,-180.104 199.5,-190.104 195,-185.104 195,-190.104 195,-190.104 195,-190.104 195,-185.104 190.5,-190.104 195,-180.104 195,-180.104"/>
|
|
81
|
+
</g>
|
|
82
|
+
<!-- manual deletion -->
|
|
83
|
+
<g id="node7" class="node"><title>manual deletion</title>
|
|
84
|
+
<polygon fill="#666666" stroke="#111111" points="334.157,-108 205.843,-108 205.843,-72 334.157,-72 334.157,-108"/>
|
|
85
|
+
<text text-anchor="middle" x="270" y="-86.2088" font-family="Verdana" font-size="14.00" fill="white">manual deletion</text>
|
|
86
|
+
</g>
|
|
87
|
+
<!-- waiting renewal->manual deletion -->
|
|
88
|
+
<g id="edge8" class="edge"><title>waiting renewal->manual deletion</title>
|
|
89
|
+
<path fill="none" stroke="#000000" d="M213.539,-143.697C222.803,-135.05 234.162,-124.449 244.257,-115.027"/>
|
|
90
|
+
<polygon fill="#000000" stroke="#000000" points="251.674,-108.104 247.434,-118.217 248.019,-111.516 244.363,-114.928 244.363,-114.928 244.363,-114.928 248.019,-111.516 241.293,-111.638 251.674,-108.104 251.674,-108.104"/>
|
|
91
|
+
</g>
|
|
92
|
+
<!-- mail activation -->
|
|
93
|
+
<g id="node9" class="node"><title>mail activation</title>
|
|
94
|
+
<polygon fill="#666666" stroke="#111111" points="171.12,-108 52.8799,-108 52.8799,-72 171.12,-72 171.12,-108"/>
|
|
95
|
+
<text text-anchor="middle" x="112" y="-86.2088" font-family="Verdana" font-size="14.00" fill="white">mail activation</text>
|
|
96
|
+
</g>
|
|
97
|
+
<!-- waiting renewal->mail activation -->
|
|
98
|
+
<g id="edge9" class="edge"><title>waiting renewal->mail activation</title>
|
|
99
|
+
<path fill="none" stroke="#000000" d="M174.483,-143.697C164.131,-134.965 151.414,-124.24 140.161,-114.75"/>
|
|
100
|
+
<polygon fill="#000000" stroke="#000000" points="132.281,-108.104 142.826,-111.111 136.103,-111.328 139.925,-114.551 139.925,-114.551 139.925,-114.551 136.103,-111.328 137.024,-117.991 132.281,-108.104 132.281,-108.104"/>
|
|
101
|
+
</g>
|
|
102
|
+
<!-- manual deletion->account update -->
|
|
103
|
+
<g id="edge10" class="edge"><title>manual deletion->account update</title>
|
|
104
|
+
<path fill="none" stroke="#000000" d="M275.129,-108.227C286.181,-148.903 308.143,-252.825 268,-324 260.72,-336.908 248.876,-347.069 236.274,-354.891"/>
|
|
105
|
+
<polygon fill="#000000" stroke="#000000" points="227.475,-359.937 233.911,-351.058 231.813,-357.449 236.15,-354.962 236.15,-354.962 236.15,-354.962 231.813,-357.449 238.389,-358.865 227.475,-359.937 227.475,-359.937"/>
|
|
106
|
+
</g>
|
|
107
|
+
<!-- service delete->mail activation -->
|
|
108
|
+
<g id="edge11" class="edge"><title>service delete->mail activation</title>
|
|
109
|
+
<path fill="none" stroke="#000000" d="M60.4881,-287.849C70.1954,-250.753 93.2086,-162.81 104.908,-118.103"/>
|
|
110
|
+
<polygon fill="#000000" stroke="#000000" points="107.491,-108.232 109.312,-119.046 106.225,-113.07 104.959,-117.907 104.959,-117.907 104.959,-117.907 106.225,-113.07 100.606,-116.767 107.491,-108.232 107.491,-108.232"/>
|
|
61
111
|
</g>
|
|
62
112
|
<!-- end -->
|
|
63
|
-
<g id="
|
|
64
|
-
<polygon fill="#b40d28" stroke="#600615" points="
|
|
65
|
-
<text text-anchor="middle" x="
|
|
66
|
-
</g>
|
|
67
|
-
<!--
|
|
68
|
-
<g id="
|
|
69
|
-
<path fill="none" stroke="#000000" d="
|
|
70
|
-
<polygon fill="#000000" stroke="#000000" points="
|
|
71
|
-
</g>
|
|
72
|
-
<!-- email notification->end -->
|
|
73
|
-
<g id="edge7" class="edge"><title>email notification->end</title>
|
|
74
|
-
<path fill="none" stroke="#000000" d="M151.663,-71.6966C144.709,-63.3046 136.23,-53.0705 128.599,-43.8613"/>
|
|
75
|
-
<polygon fill="#000000" stroke="#000000" points="122.172,-36.1043 132.017,-40.9335 125.362,-39.9545 128.552,-43.8046 128.552,-43.8046 128.552,-43.8046 125.362,-39.9545 125.087,-46.6757 122.172,-36.1043 122.172,-36.1043"/>
|
|
113
|
+
<g id="node10" class="node"><title>end</title>
|
|
114
|
+
<polygon fill="#b40d28" stroke="#600615" points="139,-36 85,-36 85,-0 139,-0 139,-36"/>
|
|
115
|
+
<text text-anchor="middle" x="112" y="-14.2088" font-family="Verdana" font-size="14.00" fill="white">end</text>
|
|
116
|
+
</g>
|
|
117
|
+
<!-- mail activation->end -->
|
|
118
|
+
<g id="edge12" class="edge"><title>mail activation->end</title>
|
|
119
|
+
<path fill="none" stroke="#000000" d="M112,-71.6966C112,-63.9827 112,-54.7125 112,-46.1124"/>
|
|
120
|
+
<polygon fill="#000000" stroke="#000000" points="112,-36.1043 116.5,-46.1043 112,-41.1043 112,-46.1043 112,-46.1043 112,-46.1043 112,-41.1043 107.5,-46.1044 112,-36.1043 112,-36.1043"/>
|
|
76
121
|
</g>
|
|
77
122
|
</g>
|
|
78
123
|
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
41563
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module LevelUp
|
|
4
|
+
class GraphTestJob < Job
|
|
5
|
+
job do
|
|
6
|
+
task :start, transitions: :first_node
|
|
7
|
+
task :first_node, transitions: [:second_node, :end]
|
|
8
|
+
task :second_node, transitions: [:end]
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class GraphBuilderTest < ActiveSupport::TestCase
|
|
13
|
+
def setup
|
|
14
|
+
@job = GraphTestJob.create
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
test "should return the default configuration" do
|
|
18
|
+
builder = GraphBuilder.new(@job)
|
|
19
|
+
assert_equal(GraphBuilder.default_configuration, builder.configuration)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
test "should return the configuration with a custom background color" do
|
|
23
|
+
builder = GraphBuilder.new(@job, bgcolor: '#ff0000')
|
|
24
|
+
custom_configuration = GraphBuilder.default_configuration
|
|
25
|
+
custom_configuration[:bgcolor] = '#ff0000'
|
|
26
|
+
|
|
27
|
+
assert_equal(custom_configuration, builder.configuration)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
test "should return the configuration with a custom node font color" do
|
|
31
|
+
builder = GraphBuilder.new(@job, node: {fontcolor: '#000000'})
|
|
32
|
+
custom_configuration = GraphBuilder.default_configuration
|
|
33
|
+
custom_configuration[:node][:fontcolor] = '#000000'
|
|
34
|
+
|
|
35
|
+
assert_equal(custom_configuration, builder.configuration)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
test "should return the configuration with a custom node fillcolor for 'first_node'" do
|
|
39
|
+
builder = GraphBuilder.new(@job, node: {first_node: {fillcolor: '#00ff00'}})
|
|
40
|
+
custom_configuration = GraphBuilder.default_configuration
|
|
41
|
+
custom_configuration[:node][:first_node] = {fillcolor: '#00ff00'}
|
|
42
|
+
|
|
43
|
+
assert_equal(custom_configuration, builder.configuration)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
test "should have the correct number of nodes" do
|
|
47
|
+
builder = GraphBuilder.new(@job)
|
|
48
|
+
graph = builder.graph
|
|
49
|
+
|
|
50
|
+
assert_equal(@job.tasks.size, graph.node_count)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
test "should have the correct number of edges" do
|
|
54
|
+
builder = GraphBuilder.new(@job)
|
|
55
|
+
graph = builder.graph
|
|
56
|
+
|
|
57
|
+
assert_equal(@job.schema.values.flatten.size, graph.edge_count)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
test "should have the same schema that the job" do
|
|
61
|
+
builder = GraphBuilder.new(@job)
|
|
62
|
+
graph = builder.graph
|
|
63
|
+
|
|
64
|
+
assert_equal(@job.transitions(:start).size, graph.find_node("start").neighbors.size)
|
|
65
|
+
assert_equal(@job.transitions(:start)[0].to_s.humanize.downcase, graph.find_node("start").neighbors[0].id)
|
|
66
|
+
|
|
67
|
+
assert_equal(@job.transitions(:first_node).size, graph.find_node("first node").neighbors.size)
|
|
68
|
+
assert_equal(@job.transitions(:first_node)[0].to_s.humanize.downcase, graph.find_node("first node").neighbors[0].id)
|
|
69
|
+
assert_equal(@job.transitions(:first_node)[1].to_s.humanize.downcase, graph.find_node("first node").neighbors[1].id)
|
|
70
|
+
|
|
71
|
+
assert_equal(@job.transitions(:second_node).size, graph.find_node("second node").neighbors.size)
|
|
72
|
+
assert_equal(@job.transitions(:second_node)[0].to_s.humanize.downcase, graph.find_node("second node").neighbors[0].id)
|
|
73
|
+
|
|
74
|
+
assert_equal(@job.transitions(:end).size, graph.find_node("end").neighbors.size)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -3,11 +3,11 @@ require 'delayed_job_active_record'
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
module LevelUp
|
|
6
|
-
class TestJob < Job
|
|
6
|
+
class TestJob < LevelUp::Job
|
|
7
7
|
job do
|
|
8
8
|
task :start, transitions: :first_node
|
|
9
9
|
task :first_node, transitions: [:second_node, :error_node, :timer_node, :task_node]
|
|
10
|
-
task :second_node, transitions:
|
|
10
|
+
task :second_node, transitions: :end
|
|
11
11
|
task :error_node
|
|
12
12
|
task :timer_node
|
|
13
13
|
task :task_node
|
|
@@ -33,13 +33,13 @@ module LevelUp
|
|
|
33
33
|
class CustomTaskError < StandardError
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
class CustomTask < Task
|
|
36
|
+
class CustomTask < LevelUp::Task
|
|
37
37
|
def run
|
|
38
38
|
raise CustomTaskError.new("raised from task #{job.task}")
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
class AbstractFirstNode < Task
|
|
42
|
+
class AbstractFirstNode < LevelUp::Task
|
|
43
43
|
def run
|
|
44
44
|
move_to! :second_node
|
|
45
45
|
end
|
|
@@ -48,19 +48,19 @@ module LevelUp
|
|
|
48
48
|
class TestJob::FirstNode < AbstractFirstNode
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
class TestJob::ErrorNode < Task
|
|
51
|
+
class TestJob::ErrorNode < LevelUp::Task
|
|
52
52
|
def run
|
|
53
53
|
raise "bad news"
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
class TestJob::TimerNode < Task
|
|
57
|
+
class TestJob::TimerNode < LevelUp::Task
|
|
58
58
|
def run
|
|
59
59
|
retry_in! 1.hour
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
class TestJob::TaskNode < Task
|
|
63
|
+
class TestJob::TaskNode < LevelUp::Task
|
|
64
64
|
def run
|
|
65
65
|
manual_task! "a lot of work"
|
|
66
66
|
end
|