continuous4r 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/History.txt +4 -0
  2. data/License.txt +20 -0
  3. data/Manifest.txt +83 -0
  4. data/README.txt +1 -0
  5. data/Rakefile +4 -0
  6. data/config/hoe.rb +71 -0
  7. data/config/requirements.rb +17 -0
  8. data/lib/capistrano_formatter.rb +19 -0
  9. data/lib/continuous4r/version.rb +9 -0
  10. data/lib/continuous4r.rb +490 -0
  11. data/lib/flog_formatter.rb +48 -0
  12. data/lib/heckle_formatter.rb +27 -0
  13. data/lib/httperf_formatter.rb +160 -0
  14. data/lib/site/body-capistrano.rhtml +8 -0
  15. data/lib/site/body-changelog.rhtml +8 -0
  16. data/lib/site/body-continuous4r-reports.rhtml +83 -0
  17. data/lib/site/body-dcov.rhtml +27 -0
  18. data/lib/site/body-dependencies.rhtml +52 -0
  19. data/lib/site/body-flog.rhtml +15 -0
  20. data/lib/site/body-heckle.rhtml +16 -0
  21. data/lib/site/body-httperf.rhtml +8 -0
  22. data/lib/site/body-index.rhtml +71 -0
  23. data/lib/site/body-issue-tracking.rhtml +38 -0
  24. data/lib/site/body-kwala.rhtml +35 -0
  25. data/lib/site/body-railroad.rhtml +29 -0
  26. data/lib/site/body-rcov.rhtml +23 -0
  27. data/lib/site/body-rdoc.rhtml +12 -0
  28. data/lib/site/body-scm-usage.rhtml +37 -0
  29. data/lib/site/body-stats.rhtml +8 -0
  30. data/lib/site/body-team-list.rhtml +73 -0
  31. data/lib/site/body-tests.rhtml +8 -0
  32. data/lib/site/body-zentest.rhtml +8 -0
  33. data/lib/site/header.rhtml +41 -0
  34. data/lib/site/images/continuous4r-logo.png +0 -0
  35. data/lib/site/images/external.png +0 -0
  36. data/lib/site/images/icon_error_sml.gif +0 -0
  37. data/lib/site/images/icon_success_sml.gif +0 -0
  38. data/lib/site/images/newwindow.png +0 -0
  39. data/lib/site/menu-capistrano.rhtml +23 -0
  40. data/lib/site/menu-changelog.rhtml +23 -0
  41. data/lib/site/menu-continuous4r-reports.rhtml +31 -0
  42. data/lib/site/menu-dcov.rhtml +23 -0
  43. data/lib/site/menu-dependencies.rhtml +19 -0
  44. data/lib/site/menu-flog.rhtml +23 -0
  45. data/lib/site/menu-heckle.rhtml +23 -0
  46. data/lib/site/menu-httperf.rhtml +23 -0
  47. data/lib/site/menu-index.rhtml +19 -0
  48. data/lib/site/menu-issue-tracking.rhtml +19 -0
  49. data/lib/site/menu-kwala.rhtml +23 -0
  50. data/lib/site/menu-railroad.rhtml +23 -0
  51. data/lib/site/menu-rcov.rhtml +23 -0
  52. data/lib/site/menu-rdoc.rhtml +23 -0
  53. data/lib/site/menu-scm-usage.rhtml +19 -0
  54. data/lib/site/menu-stats.rhtml +23 -0
  55. data/lib/site/menu-team-list.rhtml +19 -0
  56. data/lib/site/menu-tests.rhtml +23 -0
  57. data/lib/site/menu-zentest.rhtml +23 -0
  58. data/lib/site/style/commons-maven.css +113 -0
  59. data/lib/site/style/maven-base.css +151 -0
  60. data/lib/site/style/maven-theme.css +100 -0
  61. data/lib/site/style/project.css +1 -0
  62. data/lib/stats_formatter.rb +51 -0
  63. data/lib/subversion_extractor.rb +64 -0
  64. data/lib/tests_formatter.rb +65 -0
  65. data/lib/zen_test_formatter.rb +48 -0
  66. data/log/debug.log +0 -0
  67. data/script/destroy +14 -0
  68. data/script/destroy.cmd +1 -0
  69. data/script/generate +14 -0
  70. data/script/generate.cmd +1 -0
  71. data/script/txt2html +74 -0
  72. data/script/txt2html.cmd +1 -0
  73. data/setup.rb +1585 -0
  74. data/tasks/deployment.rake +34 -0
  75. data/tasks/environment.rake +7 -0
  76. data/tasks/website.rake +17 -0
  77. data/test/test_continuous4r.rb +11 -0
  78. data/test/test_helper.rb +2 -0
  79. data/website/index.html +411 -0
  80. data/website/index.txt +298 -0
  81. data/website/javascripts/rounded_corners_lite.inc.js +285 -0
  82. data/website/stylesheets/screen.css +138 -0
  83. data/website/template.rhtml +48 -0
  84. metadata +141 -0
@@ -0,0 +1,113 @@
1
+ body {
2
+ color: #000;
3
+ background-color: #fff;
4
+ font-size: 13px;
5
+ }
6
+
7
+ p {
8
+ margin-left: 4px;
9
+ margin-top: 8px;
10
+ margin-bottom: 4px;
11
+ }
12
+ ul, ol {
13
+ margin-top: 4px;
14
+ margin-bottom: 4px;
15
+ }
16
+
17
+ h2 {
18
+ color: #fff;
19
+ border: none;
20
+ margin-top: 8px;
21
+ margin-bottom: 4px;
22
+ padding: 4px 4px 4px 6px;
23
+ background-color: #036;
24
+ font-weight: 900;
25
+ font-size: 13px;
26
+ background-image: url(../images/nw_maj_rond.gif);
27
+ background-repeat: no-repeat;
28
+ }
29
+
30
+ h3 {
31
+ color: #fff;
32
+ background-color: #888;
33
+ margin-top: 12px;
34
+ margin-bottom: 4px;
35
+ padding: 4px 4px 4px 6px;
36
+ border: none;
37
+ font-weight: 900;
38
+ font-size: 13px;
39
+ background-image: url(../images/nw_maj_rond.gif);
40
+ background-repeat: no-repeat;
41
+ }
42
+
43
+ div#bodyColumn {
44
+ margin-top: 0px;
45
+ margin-left: 158px;
46
+ }
47
+
48
+ div#bodyColumn a {
49
+ text-decoration: underline;
50
+ }
51
+ div#bodyColumn a:link {
52
+ color: #00f;
53
+ }
54
+ div#bodyColumn a:visited {
55
+ color: #00f;
56
+ }
57
+ a:active, a:hover {
58
+ color: #f30 !important;
59
+ }
60
+
61
+ div.source {
62
+ background-color: #eee;
63
+ color: #000;
64
+ margin-right: 0px;
65
+ margin-left: 4px;
66
+ margin-top: 1em;
67
+ }
68
+
69
+ div#leftColumn {
70
+ color: #000;
71
+ background-color: #eee;
72
+ margin-left: 0px;
73
+ margin-top: 0px;
74
+ border-right: 1px solid #aaa;
75
+ border-bottom: 1px solid #aaa;
76
+ border-top: none;
77
+ border-left: none;
78
+ width: 150px;
79
+
80
+ background-image:url(http://www.apache.org/ads/ApacheCon/2008-europe-125x125.png);
81
+ background-repeat: no-repeat;
82
+ background-position: 50% 1%;
83
+ }
84
+ div#navcolumn {
85
+ margin-top: 129px;
86
+
87
+ color: #000;
88
+ border: none;
89
+ padding: 6px 4px 0 8px;
90
+ }
91
+
92
+ #navcolumn li {
93
+ padding-left: 8px;
94
+ }
95
+
96
+ #navcolumn h5 {
97
+ padding-top: 3px;
98
+ }
99
+
100
+ #banner, #banner td {
101
+ background-color: #fff;
102
+ color: #000;
103
+ }
104
+
105
+ #banner td {
106
+ height: 100%;
107
+ vertical-align: middle;
108
+ }
109
+
110
+ #menuCommons a.externalLink, #menuCommons a.externalLink:link, #menuCommons a.externalLink:visited, #menuCommons a.externalLink:active, #menuCommons a.externalLink:hover {
111
+ background-image: none;
112
+ padding-right: 0px;
113
+ }
@@ -0,0 +1,151 @@
1
+ body {
2
+ margin: 0px;
3
+ padding: 0px 0px 10px 0px;
4
+ }
5
+ img {
6
+ border:none;
7
+ }
8
+ table {
9
+ padding:0px;
10
+ width: 100%;
11
+ margin-left: -2px;
12
+ margin-right: -2px;
13
+ }
14
+ acronym {
15
+ cursor: help;
16
+ border-bottom: 1px dotted #feb;
17
+ }
18
+ table.bodyTable th, table.bodyTable td {
19
+ padding: 2px 4px 2px 4px;
20
+ vertical-align: top;
21
+ }
22
+ div.clear{
23
+ clear:both;
24
+ visibility: hidden;
25
+ }
26
+ div.clear hr{
27
+ display: none;
28
+ }
29
+ #projectLogo {
30
+ font-size: xx-large;
31
+ font-weight: bold;
32
+ }
33
+ #organizationLogo img, #projectLogo img, #projectLogo span{
34
+ margin: 8px;
35
+ }
36
+ #projectLogo span{
37
+ border: 1px solid;
38
+ padding: 4px 10px 4px 10px;
39
+ background-color: #eee;
40
+ cursor: pointer;
41
+ }
42
+ .xleft, #organizationLogo img{
43
+ float:left;
44
+ }
45
+ .xright, #projectLogo img, #projectLogo span{
46
+ float:right;
47
+ text-shadow: #7CFC00;
48
+ }
49
+ #banner {
50
+ border-bottom: 1px solid #fff;
51
+ }
52
+ #banner img {
53
+ border: none;
54
+ }
55
+ #footer, #breadcrumbs {
56
+ padding: 3px 10px 3px 10px;
57
+ }
58
+ #leftColumn {
59
+ width: 18%;
60
+ float:left;
61
+ }
62
+ #bodyColumn {
63
+ margin-left: 20%;
64
+ }
65
+ #legend {
66
+ padding: 8px 0 8px 0;
67
+ }
68
+ #navcolumn {
69
+ padding: 8px 4px 0 8px;
70
+ }
71
+ #navcolumn h5, #navcolumn ul {
72
+ margin: 0;
73
+ padding: 0;
74
+ font-size: small;
75
+ }
76
+ #navcolumn li {
77
+ list-style-type: none;
78
+ background-image: none;
79
+ background-repeat: no-repeat;
80
+ background-position: 0 0.4em;
81
+ padding-left: 16px;
82
+ list-style-position: ouside;
83
+ line-height: 1.2em;
84
+ font-size: smaller;
85
+ }
86
+ #navcolumn li.expanded {
87
+ background-image: url(../images/expanded.gif);
88
+ }
89
+ #navcolumn li.collapsed {
90
+ background-image: url(../images/collapsed.gif);
91
+ }
92
+ #poweredBy {
93
+ text-align: center;
94
+ }
95
+ #navcolumn img {
96
+ margin-top: 10px;
97
+ margin-bottom: 3px;
98
+ }
99
+ #poweredBy img {
100
+ display:block;
101
+ margin: 20px 0 20px 17px;
102
+ border: 1px solid black;
103
+ width: 90px;
104
+ height: 30px;
105
+ }
106
+ #searchbar img {
107
+ margin: 0px;
108
+ display: block;
109
+ }
110
+ #searchbar #q, #searchbar #btnG {
111
+ border: 1px solid #999;
112
+ margin-bottom:10px;
113
+ }
114
+ #searchbar form {
115
+ margin: 0px;
116
+ }
117
+ #lastPublished {
118
+ font-size: x-small;
119
+ }
120
+ .navSection {
121
+ margin-bottom: 2px;
122
+ padding: 8px;
123
+ }
124
+ .navSectionHead {
125
+ font-weight: bold;
126
+ font-size: x-small;
127
+ }
128
+ .section {
129
+ padding: 4px;
130
+ }
131
+ #footer {
132
+ font-size: x-small;
133
+ }
134
+ #breadcrumbs {
135
+ font-size: x-small;
136
+ margin: 0pt;
137
+ }
138
+ .source {
139
+ padding: 12px;
140
+ margin: 1em 7px 1em 7px;
141
+ }
142
+ .source pre {
143
+ margin: 0px;
144
+ padding: 0px;
145
+ }
146
+ .error {
147
+ background-color: #f00;
148
+ }
149
+ .ok {
150
+ background-color: #00f000;
151
+ }
@@ -0,0 +1,100 @@
1
+ body, td, select, input, li{
2
+ font-family: Verdana, Helvetica, Arial, sans-serif;
3
+ font-size: 13px;
4
+ }
5
+ code{
6
+ font-size: 13px;
7
+ font-family: Courier New, Verdana, Helvetica, Arial, sans-serif;
8
+ }
9
+ a {
10
+ text-decoration: none;
11
+ }
12
+ a:link {
13
+ color:#36a;
14
+ }
15
+ a:visited {
16
+ color:#47a;
17
+ }
18
+ a:active, a:hover {
19
+ color:#69c;
20
+ }
21
+ #legend li.externalLink {
22
+ background: url(../images/external.png) left top no-repeat;
23
+ padding-left: 18px;
24
+ }
25
+ a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover {
26
+ background: url(../images/external.png) right center no-repeat;
27
+ padding-right: 18px;
28
+ }
29
+ #legend li.newWindow {
30
+ background: url(../images/newwindow.png) left top no-repeat;
31
+ padding-left: 18px;
32
+ }
33
+ a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover {
34
+ background: url(../images/newwindow.png) right center no-repeat;
35
+ padding-right: 18px;
36
+ }
37
+ h2 {
38
+ padding: 4px 4px 4px 6px;
39
+ border: 1px solid #999;
40
+ color: #900;
41
+ background-color: #ddd;
42
+ font-weight:900;
43
+ font-size: x-large;
44
+ }
45
+ h3 {
46
+ padding: 4px 4px 4px 6px;
47
+ border: 1px solid #aaa;
48
+ color: #900;
49
+ background-color: #eee;
50
+ font-weight: normal;
51
+ font-size: large;
52
+ }
53
+ p {
54
+ line-height: 1.3em;
55
+ font-size: small;
56
+ }
57
+ #breadcrumbs {
58
+ border-top: 1px solid #aaa;
59
+ border-bottom: 1px solid #aaa;
60
+ background-color: #ccc;
61
+ }
62
+ #leftColumn {
63
+ margin: 10px 0 0 5px;
64
+ border: 1px solid #999;
65
+ background-color: #eee;
66
+ }
67
+ #navcolumn h5 {
68
+ font-size: smaller;
69
+ border-bottom: 1px solid #aaaaaa;
70
+ padding-top: 2px;
71
+ }
72
+
73
+ table.bodyTable th {
74
+ color: white;
75
+ background-color: #bbb;
76
+ text-align: left;
77
+ font-weight: bold;
78
+ }
79
+
80
+ table.bodyTable th, table.bodyTable td {
81
+ font-size: 1em;
82
+ }
83
+
84
+ table.bodyTable tr.a {
85
+ background-color: #ddd;
86
+ }
87
+
88
+ table.bodyTable tr.b {
89
+ background-color: #eee;
90
+ }
91
+
92
+ .source {
93
+ border: 1px solid #999;
94
+ font-family: Courier New, Verdana, Helvetica, Arial, sans-serif;
95
+ }
96
+
97
+ dt.question {
98
+ color: #900;
99
+ background-color: #eee;
100
+ }
@@ -0,0 +1 @@
1
+ @import url("../style/commons-maven.css");
@@ -0,0 +1,51 @@
1
+ # =========================================================
2
+ # Classe de formatage des resultats renvoyes par rake stats
3
+ # Author: Vincent Dubois
4
+ # =========================================================
5
+ class StatsFormatter
6
+ attr_accessor :result
7
+
8
+ # Constructeur
9
+ def initialize result
10
+ self.result = result
11
+ end
12
+
13
+ # Methode qui permet de fabriquer le flux HTML a partir des flux console
14
+ def to_html
15
+ html = "<table class='bodyTable'><thead><th>Name</th><th>Lines</th><th>LOC</th><th>Classes</th><th>Methods</th><th>M/C</th><th>LOC/M</th></thead><tbody>"
16
+ i = 0
17
+ results = self.result.split(/$/)
18
+ bottom = 4
19
+ while !results[bottom].nil? and results[bottom][0..1] != "\n+" do
20
+ bottom = bottom + 1
21
+ end
22
+ lines = results[4..bottom-1]
23
+ lines.each do |line|
24
+ elements = line.split(/\|/)
25
+ html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'>"
26
+ html = html + "<td><strong>#{elements[1]}</strong></td>"
27
+ html = html + "<td style='text-align: right;'>#{elements[2]}</td>"
28
+ html = html + "<td style='text-align: right;'>#{elements[3]}</td>"
29
+ html = html + "<td style='text-align: right;'>#{elements[4]}</td>"
30
+ html = html + "<td style='text-align: right;'>#{elements[5]}</td>"
31
+ html = html + "<td style='text-align: right;'>#{elements[6]}</td>"
32
+ html = html + "<td style='text-align: right;'>#{elements[7]}</td>"
33
+ html = html + "</tr>"
34
+ i = i + 1
35
+ end
36
+ total = results[bottom + 1]
37
+ elements = total.split(/\|/)
38
+ html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'>"
39
+ html = html + "<td><strong>#{elements[1]}</strong></td>"
40
+ [2,3,4,5,6,7].each do |j|
41
+ html = html + "<td style='text-align: right;'><strong>#{elements[j]}</strong></td>"
42
+ end
43
+ html = html + "</tr>"
44
+ html = html + "</tbody></table>"
45
+ extra = results[bottom + 3]
46
+ elements = extra.split(/:| /)
47
+ html = html + "<p><strong>#{elements[0]} : </strong>#{elements[1]}&#160;&#160;&#160;&#160;&#160;&#160;"
48
+ html = html + "<strong>#{elements[2]} : </strong>#{elements[3]}&#160;&#160;&#160;&#160;&#160;&#160;"
49
+ html = html + "<strong>#{elements[4]} : </strong>#{elements[5]}:#{elements[6]}</p><br/>"
50
+ end
51
+ end
@@ -0,0 +1,64 @@
1
+ require 'iconv'
2
+ # ====================================================
3
+ # Classe d'extraction des informations de Subversion
4
+ # Author: Vincent Dubois
5
+ # ====================================================
6
+ module SubversionExtractor
7
+
8
+ # Methode qui permet de fabriquer le flux HTML a partir des informations
9
+ # presentes dans le referentiel
10
+ def self.extract_changelog scm_current_version, scm, file_name
11
+ post_command= ""
12
+ begin
13
+ post_command = post_command + " --username " + scm.user.text
14
+ post_command = post_command + " --password " + scm.password.text
15
+ rescue
16
+ post_command = ""
17
+ end
18
+ get_head_log = `svn log -r 'HEAD'#{post_command}`
19
+ get_head_log_lines = get_head_log.split(/$/)
20
+ revision = get_head_log_lines[1].split(/ \| /)[0]
21
+ revision = revision[2..(revision.length-1)]
22
+ puts " Computing changelog for #{scm.url.text}, from revision #{scm_current_version} to revision #{revision}..."
23
+ i = 0
24
+ html = "<table class='bodyTable'><thead><th>Revision</th><th>Date</th><th>Author</th><th>File(s)</th><th>Comment</th></thead><tbody>"
25
+ (scm_current_version.to_i..revision.to_i).to_a.reverse_each do |rev|
26
+ puts " Changelog for revision #{rev}..."
27
+ rev_files = Array.new
28
+ if rev == 1 or (!scm['min_revision'].nil? and rev == scm['min_revision'].to_i)
29
+ rev_result = `svn diff -r #{rev}#{post_command}|grep ^Index:`
30
+ else
31
+ rev_result = `svn diff -r #{rev-1}:#{rev} --summarize#{post_command}`
32
+ end
33
+ rev_result_lines = rev_result.split(/$/)
34
+ rev_result_lines.each do |line|
35
+ rev_files.push line[7..(line.length-1)]
36
+ end
37
+ rev_files.pop
38
+ rev_log_result = `svn log -r #{rev}`
39
+ rev_log_result_lines = rev_log_result.split(/$/)
40
+ rev_line = rev_log_result_lines[1].split(/ \| /)
41
+ html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'><td><strong>#{rev_line[0][2..(rev_line[0].length-1)]}</strong></td>"
42
+ html = html + "<td>#{rev_line[2][0..18]}</td><td>#{rev_line[1]}</td><td>"
43
+ rev_files.each do |rev_file|
44
+ html = html + rev_file + "<br/>"
45
+ end
46
+ html = html + "</td><td>"
47
+ (3..(rev_log_result_lines.length-3)).to_a.each do |line|
48
+ begin
49
+ html = html + Iconv.conv('ISO-8859-1', 'UTF-8', rev_log_result_lines[line]) + "<br/>"
50
+ rescue
51
+ html = html + rev_log_result_lines[line] + "<br/>"
52
+ end
53
+ end
54
+ html = html + "</td></tr>"
55
+ i = i + 1
56
+ end
57
+ html = html + "</tbody></table>"
58
+ changelog_file = File.open(file_name,"w")
59
+ changelog_file.write(html)
60
+ changelog_file.close
61
+ return revision
62
+ end
63
+
64
+ end
@@ -0,0 +1,65 @@
1
+ require 'rubygems'
2
+ require 'XmlElements'
3
+ # =====================================================
4
+ # Classe de formatage des resultats renvoyes par les
5
+ # differents tests unitaires
6
+ # Author: Vincent Dubois
7
+ # =====================================================
8
+ class TestsFormatter
9
+ attr_accessor :params
10
+
11
+ # Constructeur
12
+ def initialize params
13
+ self.params = params
14
+ end
15
+
16
+ # Methode qui permet de fabriquer le flux HTML a partir des flux console
17
+ # de tests unitaires
18
+ def to_html
19
+ html = "<table class='bodyTable'><thead><th>Testing element</th><th>Pass</th><th>Result</th></thead><tbody>"
20
+ i = 0
21
+ self.params.each('runner') do |runner|
22
+ puts " Running #{runner['type']} tests..."
23
+ pass = true
24
+ html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'><td><strong>#{runner['type']}</strong></td>"
25
+ case runner['type']
26
+ when "units"
27
+ pass = system("rake test:units > test_units.log")
28
+ if !pass
29
+ puts " #{File.read("test_units.log")}"
30
+ raise " BUILD FAILED."
31
+ end
32
+ html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
33
+ html = html + "<td><pre>#{File.read("test_units.log")}</pre></td></tr>"
34
+ when "functionals"
35
+ pass = system("rake test:functionals > test_functionals.log")
36
+ if !pass
37
+ puts " #{File.read("test_functionals.log")}"
38
+ raise " BUILD FAILED."
39
+ end
40
+ html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
41
+ html = html + "<td><pre>#{File.read("test_functionals.log")}</pre></td></tr>"
42
+ when "integration"
43
+ pass = system("rake test:integration > test_integration.log")
44
+ if !pass
45
+ puts " #{File.read("test_integration.log")}"
46
+ raise " BUILD FAILED."
47
+ end
48
+ html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
49
+ html = html + "<td><pre>#{File.read("test_integration.log")}</pre></td></tr>"
50
+ when "rspec"
51
+ pass = system("rake spec > test_rspec.log")
52
+ if !pass
53
+ puts " #{File.read("test_rspec.log")}"
54
+ raise " BUILD FAILED."
55
+ end
56
+ html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
57
+ html = html + "<td><pre>#{File.read("test_rspec.log").gsub(/\[32m|\[0m|\[31m/,"")}</pre></td></tr>"
58
+ else
59
+ raise " Don't know how to run '#{runner['type']}' test.\n BUILD FAILED."
60
+ end
61
+ i = i + 1
62
+ end
63
+ html = html + "</tbody></table>"
64
+ end
65
+ end
@@ -0,0 +1,48 @@
1
+ require 'rubygems'
2
+ require 'XmlElements'
3
+ # =====================================================
4
+ # Classe de formatage des resultats renvoyes par les
5
+ # differents resultats de ZenTest
6
+ # Author: Vincent Dubois
7
+ # =====================================================
8
+ class ZenTestFormatter
9
+ attr_accessor :params
10
+
11
+ # Constructeur
12
+ def initialize params
13
+ self.params = params
14
+ end
15
+
16
+ # Methode qui permet de fabriquer le flux HTML a partir des flux console
17
+ # de ZenTest
18
+ def to_html
19
+ html = "<table class='bodyTable'><thead><th>Element</th><th>Pass</th><th>Errors</th><th>Generated class</th></thead><tbody>"
20
+ i = 0
21
+ self.params.each('runner') do |runner|
22
+ puts " Running ZenTest on #{runner['class']} against #{runner['test']}..."
23
+ html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'><td><strong>#{runner['class']}</strong> against <strong>#{runner['test']}</strong></td>"
24
+ system("zentest -r #{runner['class']} #{runner['test']} > continuous4r_build/zentest.log")
25
+ file_content = File.read("continuous4r_build/zentest.log")
26
+ file_lines = file_content.split(/$/)
27
+ start_line = 0
28
+ while file_lines[start_line].index("Code Generated by ZenTest").nil?
29
+ start_line = start_line + 1
30
+ end
31
+ end_line = start_line
32
+ while file_lines[end_line].index("Number of errors detected").nil?
33
+ end_line = end_line + 1
34
+ end
35
+ number_of_errors = file_lines[end_line][29..(file_lines[end_line].length - 1)]
36
+ end_line = end_line - 1
37
+ html = html + "<td style='text-align: center;'><img src='images/icon_#{(number_of_errors.to_i == 0) ? 'success' : 'error'}_sml.gif'/></td>"
38
+ html = html + "<td style='text-align: center;'>#{number_of_errors}</td>"
39
+ html = html + "<td style='width: 75%;'><pre style='font-family: Courier New;'>"
40
+ (start_line..end_line).to_a.each do |index|
41
+ html = html + file_lines[index]
42
+ end
43
+ html = html + "</pre></td></tr>"
44
+ i = i + 1
45
+ end
46
+ html = html + "</tbody></table>"
47
+ end
48
+ end
data/log/debug.log ADDED
File without changes
data/script/destroy ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/destroy'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -0,0 +1 @@
1
+ @ruby script/destroy %*
data/script/generate ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Generate.new.run(ARGV)
@@ -0,0 +1 @@
1
+ @ruby script/generate %*