crazy_ivan 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/bin/crazy_ivan CHANGED
@@ -15,16 +15,31 @@ def setup
15
15
  Dir.chdir('.ci') do
16
16
  File.open('update', 'w+') do |f|
17
17
  f.puts "#!/usr/bin/env bash"
18
+ f.puts
19
+ f.puts "# This script updates your code"
20
+ f.puts "#"
21
+ f.puts "# If you're not using a code repository system, this script could just do some"
22
+ f.puts "# some basic copying commands."
23
+ f.puts
18
24
  f.puts "git pull"
19
25
  end
20
26
 
21
27
  File.open('version', 'w+') do |f|
22
28
  f.puts "#!/usr/bin/env ruby -wKU"
29
+ f.puts
30
+ f.puts "# This script grabs a unique hash from your version control system"
31
+ f.puts "#"
32
+ f.puts "# If you're not able to use a VCS, this script could just generate a timestamp."
33
+ f.puts
23
34
  f.puts "puts `git show`[/^commit (.+)$/, 1]"
24
35
  end
25
36
 
26
37
  File.open('test', 'w+') do |f|
27
38
  f.puts "#!/usr/bin/env bash"
39
+ f.puts
40
+ f.puts "# This script runs your testing suite. For a typical Ruby project running"
41
+ f.puts "# test-unit this is probably all you need."
42
+ f.puts
28
43
  f.puts "rake"
29
44
  end
30
45
 
data/crazy_ivan.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{crazy_ivan}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edward Ocampo-Gooding"]
12
- s.date = %q{2009-08-30}
12
+ s.date = %q{2009-09-21}
13
13
  s.default_executable = %q{crazy_ivan}
14
14
  s.description = %q{Continuous integration should really just be a script that captures the output of running your project update & test commands and presents recent results in a static html page.
15
15
 
data/templates/css/ci.css CHANGED
@@ -8,4 +8,9 @@ body {
8
8
 
9
9
  td {
10
10
  vertical-align: top;
11
+ font-size: 75%;
12
+ }
13
+
14
+ .error {
15
+ color: red;
11
16
  }
data/templates/index.html CHANGED
@@ -1,3 +1,5 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+ "http://www.w3.org/TR/html4/loose.dtd">
1
3
  <html>
2
4
  <head>
3
5
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
@@ -60,35 +62,52 @@
60
62
  return report;
61
63
  }
62
64
 
65
+ var expand = function(element) {
66
+ element.siblings().invoke('show');
67
+ element.remove();
68
+ }
69
+
63
70
  var render = function(template_name, json) {
64
71
  var template = jsontemplate.Template(" \
65
72
  {.section projects} \
66
73
  {.repeated section @} \
67
- <h2>{name}</h2> \
68
- {.section reports} \
69
- <table> \
70
- <tr> \
71
- <th>Version</th> \
72
- <th>Update Result</th> \
73
- <th>Update Errors</th> \
74
- <th>Test Result</th> \
75
- <th>Test Errors</th> \
76
- </tr> \
77
- {.repeated section @} \
74
+ <div class='project'> \
75
+ <h2>{name}</h2> \
76
+ {.section reports} \
77
+ <table class='reports'> \
78
78
  <tr> \
79
- <td>{timestamp}</td> \
80
- <td>{version}</td> \
81
- <td>{update}</td> \
82
- <td>{update_error}</td> \
83
- <td>{test}</td> \
84
- <td>{test_error}</td> \
79
+ <th class='timestamp'>Timestamp</th> \
80
+ <th class='version'>Version</th> \
81
+ <th class='update'>Update Result</th> \
82
+ <th class='test'>Test Result</th> \
85
83
  </tr> \
86
- {.end} \
87
- </table> \
88
- {.or} \
89
- <p>No test reports found. Please run the `ci` executable.</p> \
84
+ {.repeated section @} \
85
+ <tr> \
86
+ <td class='timestamp'>{timestamp}</td> \
87
+ <td class='version'>{version}</td> \
88
+ <td class='update'> \
89
+ <pre>{update}</pre> \
90
+ {.section update_error} \
91
+ <div class='error'><pre>{update_error}<pre></div> \
92
+ {.end} \
93
+ </td> \
94
+ <td class='test'> \
95
+ <pre>{test}</pre> \
96
+ {.section test_error} \
97
+ <a href='#' onclick='expand(this)'>Click to see error</a> \
98
+ <div class='error' style='display: hidden'> \
99
+ <pre>{test_error}<pre> \
100
+ </div> \
101
+ {.end} \
102
+ </td> \
103
+ </tr> \
104
+ {.end} \
105
+ </table> \
106
+ {.or} \
107
+ <p>No test reports found. Please run the `ci` executable.</p> \
108
+ {.end} \
90
109
  {.end} \
91
- {.end} \
110
+ </div> \
92
111
  {.or} \
93
112
  <p>No projects found.</p> \
94
113
  {.end} \
@@ -96,6 +115,21 @@
96
115
 
97
116
  var html = template.expand(json);
98
117
  $("replace").update(html);
118
+
119
+ // Hide all errors by default
120
+ $$('.error').invoke('hide');
121
+
122
+ $$('.project').each(function(project) {
123
+ var firstResultsError = project.down('td.test').down('.error')
124
+
125
+ // When the latest test result has an error (i.e. the project is broken)
126
+ if(firstResultsError) {
127
+ project.down('h2').addClassName('error');
128
+
129
+ firstResultsError.show();
130
+ firstResultsError.adjacent('a')[0].onclick();
131
+ }
132
+ });
99
133
  }
100
134
  </script>
101
135
  </head>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crazy_ivan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edward Ocampo-Gooding
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-30 00:00:00 -04:00
12
+ date: 2009-09-21 00:00:00 -04:00
13
13
  default_executable: crazy_ivan
14
14
  dependencies: []
15
15