rspec-formatter-webkit 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/History.md +6 -0
  2. data/LICENSE +27 -0
  3. data/README.md +30 -0
  4. data/Rakefile +51 -0
  5. data/data/rspec-formatter-webkit/css/textmate-rspec.css +332 -0
  6. data/data/rspec-formatter-webkit/images/clock.png +0 -0
  7. data/data/rspec-formatter-webkit/images/cross_circle.png +0 -0
  8. data/data/rspec-formatter-webkit/images/cross_circle_frame.png +0 -0
  9. data/data/rspec-formatter-webkit/images/cross_octagon.png +0 -0
  10. data/data/rspec-formatter-webkit/images/cross_octagon_frame.png +0 -0
  11. data/data/rspec-formatter-webkit/images/cross_shield.png +0 -0
  12. data/data/rspec-formatter-webkit/images/exclamation.png +0 -0
  13. data/data/rspec-formatter-webkit/images/exclamation_frame.png +0 -0
  14. data/data/rspec-formatter-webkit/images/exclamation_shield.png +0 -0
  15. data/data/rspec-formatter-webkit/images/exclamation_small.png +0 -0
  16. data/data/rspec-formatter-webkit/images/plus_circle.png +0 -0
  17. data/data/rspec-formatter-webkit/images/plus_circle_frame.png +0 -0
  18. data/data/rspec-formatter-webkit/images/question.png +0 -0
  19. data/data/rspec-formatter-webkit/images/question_frame.png +0 -0
  20. data/data/rspec-formatter-webkit/images/question_shield.png +0 -0
  21. data/data/rspec-formatter-webkit/images/question_small.png +0 -0
  22. data/data/rspec-formatter-webkit/images/tick.png +0 -0
  23. data/data/rspec-formatter-webkit/images/tick_circle.png +0 -0
  24. data/data/rspec-formatter-webkit/images/tick_circle_frame.png +0 -0
  25. data/data/rspec-formatter-webkit/images/tick_shield.png +0 -0
  26. data/data/rspec-formatter-webkit/images/tick_small.png +0 -0
  27. data/data/rspec-formatter-webkit/images/tick_small_circle.png +0 -0
  28. data/data/rspec-formatter-webkit/images/ticket.png +0 -0
  29. data/data/rspec-formatter-webkit/images/ticket_arrow.png +0 -0
  30. data/data/rspec-formatter-webkit/images/ticket_exclamation.png +0 -0
  31. data/data/rspec-formatter-webkit/images/ticket_minus.png +0 -0
  32. data/data/rspec-formatter-webkit/images/ticket_pencil.png +0 -0
  33. data/data/rspec-formatter-webkit/images/ticket_plus.png +0 -0
  34. data/data/rspec-formatter-webkit/images/ticket_small.png +0 -0
  35. data/data/rspec-formatter-webkit/js/jquery-1.4.2.min.js +154 -0
  36. data/data/rspec-formatter-webkit/js/textmate-rspec.js +402 -0
  37. data/data/rspec-formatter-webkit/templates/failed.rhtml +35 -0
  38. data/data/rspec-formatter-webkit/templates/footer.rhtml +9 -0
  39. data/data/rspec-formatter-webkit/templates/header.rhtml +35 -0
  40. data/data/rspec-formatter-webkit/templates/page.rhtml +131 -0
  41. data/data/rspec-formatter-webkit/templates/passed.rhtml +10 -0
  42. data/data/rspec-formatter-webkit/templates/pending-fixed.rhtml +25 -0
  43. data/data/rspec-formatter-webkit/templates/pending.rhtml +14 -0
  44. data/docs/tmrspec-example.png +0 -0
  45. data/docs/tmrspecopts-shellvar.png +0 -0
  46. data/lib/rspec/core/formatters/web_kit.rb +4 -0
  47. data/lib/rspec/core/formatters/webkit.rb +223 -0
  48. data.tar.gz.sig +0 -0
  49. metadata +202 -0
  50. metadata.gz.sig +0 -0
data/History.md ADDED
@@ -0,0 +1,6 @@
1
+
2
+ ## 2.1.0 [2010-12-21] Michael Granger <ged@FaerieMUD.org>
3
+
4
+ * Converted to Hoe
5
+ * Renamed from 'rspec-formatter-webkit' to better match gem-naming convention
6
+ * Updated for RSpec 2.3.0.
data/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2009-2010, Michael Granger
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ * Neither the name of the author/s, nor the names of the project's
15
+ contributors may be used to endorse or promote products derived from this
16
+ software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # A WebKit RSpec Formatter
2
+
3
+ http://deveiate.org/webkit-rspec-formatter.html
4
+
5
+ ## Description
6
+
7
+ This is a formatter for RSpec 2 that takes advantage of features in [WebKit](http://webkit.org/) to make the output from RSpec in Textmate more fun.
8
+
9
+ Test output looks like this:
10
+
11
+ ![Example Output](http://deveiate.org/images/tmrspec-example.png)
12
+
13
+ ## Installation
14
+
15
+ To get started, install the `rspec-formatter-webkit` gem:
16
+
17
+ $ gem install rspec-formatter-webkit
18
+
19
+ If you're running specs in Textmate via [the RSpec bundle](http://github.com/rspec/rspec-tmbundle), you can use the webkit formatter by opening Textmate's 'Advanced' Preferences and adding a `TM_RSPEC_OPTS` Shell Variable with the value `--format RSpec::Core::Formatters::WebKit`:
20
+
21
+ ![Setting TM_RSPEC_OPTS](http://deveiate.org/images/tmrspecopts-shellvar.png)
22
+
23
+ That's it!
24
+
25
+ ## Miscellaneous
26
+
27
+ It's also usable anywhere else the standard HTML formatter is, of course. Also, while it's specifically intended to be used under the Textmate HTML viewer that the RSpec bundle uses, the output should work fine under recent Gecko/Firefox-based viewers, as well.
28
+
29
+ Patches/suggestions welcomed.
30
+
data/Rakefile ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env rake
2
+
3
+ require 'hoe'
4
+
5
+ Hoe.plugin :hg
6
+ Hoe.plugin :yard
7
+ Hoe.plugin :signing
8
+
9
+ Hoe.plugins.delete :rubyforge
10
+
11
+ hoespec = Hoe.spec 'rspec-formatter-webkit' do
12
+ self.readme_file = 'README.md'
13
+
14
+ self.developer 'Michael Granger', 'ged@FaerieMUD.org'
15
+
16
+ self.extra_deps <<
17
+ ['rspec', '~> 2.3.0']
18
+
19
+ self.spec_extras[:licenses] = ["BSD"]
20
+ self.spec_extras[:post_install_message] = %{
21
+
22
+ You can use this formatter from TextMate (if you're using RSpec 2.0.0
23
+ or later) bysetting the TM_RSPEC_OPTS shell variable (in the
24
+ 'Advanced' preference pane) to:
25
+
26
+ --format RSpec::Core::Formatters::WebKit
27
+
28
+ Have fun!
29
+
30
+ }.gsub( /^\t+/m, '' )
31
+ self.spec_extras[:signing_key] = '/Volumes/Keys/ged-private_gem_key.pem'
32
+
33
+ self.require_ruby_version( '>=1.8.7' )
34
+
35
+ self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags )
36
+ self.yard_opts = [ '--use-cache', '--protected', '--verbose' ] if
37
+ self.respond_to?( :yard_opts )
38
+
39
+ self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
40
+ end
41
+
42
+ ENV['VERSION'] ||= hoespec.spec.version.to_s
43
+
44
+ task :legacy_gem do
45
+ Dir.chdir( 'legacy' ) do
46
+ sh 'rake gem'
47
+ end
48
+ end
49
+ CLEAN.include( 'legacy/pkg' )
50
+
51
+
@@ -0,0 +1,332 @@
1
+ /* @override http://tenar.home.faeriemud.org/rspec-formatter/textmate-rspec.css */
2
+
3
+ /*
4
+ * Textmate RSpec Outputter Stylesheet
5
+ * $Id: textmate-rspec.css,v 406646ae0941 2010/10/21 23:25:09 ged $
6
+ *
7
+ * Author: Michael Granger <ged@FaerieMUD.org>
8
+ *
9
+ */
10
+
11
+ body {
12
+ margin: 0;
13
+ padding: 0;
14
+ background: #999;
15
+ font: 80% "Lucida Sans", "Lucida Grande", sans-serif;
16
+ }
17
+
18
+ pre, code {
19
+ font: 0.8em Menlo, Monaco, mono;
20
+ }
21
+
22
+ #rspec-header {
23
+ padding-top: 20px;
24
+ top: 0;
25
+ left: 0;
26
+ right: 0;
27
+ height: 93px;
28
+ margin-left: -1px;
29
+ border-left: 1px solid rgb(102, 102, 102);
30
+ background-color: rgb(101, 111, 130);
31
+ text-shadow: black 0 1px 3px;
32
+ white-space: nowrap;
33
+ color: white;
34
+ position: fixed;
35
+ -webkit-box-shadow: rgba(25,25,25,0.5) 0 3px 3px;
36
+ -moz-box-shadow: rgba(25,25,25,0.5) 0 3px 3px;
37
+ background-image: -webkit-gradient(
38
+ linear,
39
+ left top,
40
+ left bottom,
41
+ color-stop(0, rgb(101,110,130)),
42
+ color-stop(0.2, rgb(144,152,168)),
43
+ color-stop(1, rgb(101,110,130))
44
+ );
45
+ background-image: -moz-linear-gradient(
46
+ center top,
47
+ rgb(101,110,130) 0%,
48
+ rgb(144,152,168) 20%,
49
+ rgb(101,110,130) 100%
50
+ );
51
+ }
52
+
53
+ #rspec-title-section {
54
+ position: absolute;
55
+ width: 260px;
56
+ top: 0;
57
+ text-align: right;
58
+ }
59
+ #rspec-title-section h1 {
60
+ margin-bottom: 0.2em;
61
+ }
62
+ #rspec-summary {
63
+ margin-left: 280px;
64
+ }
65
+
66
+ #rspec-summary-graph-legend {
67
+ margin-top: -10px;
68
+ padding-left: 15px;
69
+ }
70
+
71
+ #rspec-details {
72
+ margin-top: 120px;
73
+ }
74
+
75
+ #summary {
76
+ margin: 0;
77
+ padding: 1em 3em;
78
+ background-color: rgb(101, 111, 130);
79
+ color: white;
80
+ }
81
+ #summary p {
82
+ margin: 0;
83
+ }
84
+
85
+ .rspec-graph-legend-item {
86
+ display: inline-block;
87
+ font-weight: bold;
88
+ margin-right: 15px;
89
+ vertical-align: top;
90
+ }
91
+ .rspec-graph-legend-item.hidden {
92
+ opacity: 0.5;
93
+ }
94
+
95
+ .rspec-graph-legend-item.total {
96
+ margin-left: 10px;
97
+ }
98
+
99
+ .rspec-graph-legend-label {
100
+ display: inline-block;
101
+ text-align: left;
102
+ }
103
+
104
+ .rspec-graph-legend-header {
105
+ font-size: 12px;
106
+ }
107
+
108
+ .rspec-graph-legend-value {
109
+ font-size: 10px;
110
+ }
111
+
112
+ .rspec-graph-legend-swatch {
113
+ vertical-align: top;
114
+ margin-top: 1px;
115
+ margin-right: 3px;
116
+ }
117
+
118
+ #rspec-details {
119
+ padding: 0.2em 3em;
120
+ }
121
+
122
+ .example-group {
123
+ background: white;
124
+ padding: 0 0 0.5em;
125
+ margin: 1em 0;
126
+ -webkit-box-shadow: 0 2px 5px #333;
127
+ -webkit-border-radius: 5px;
128
+ -moz-box-shadow: 0 2px 5px #333;
129
+ -moz-border-radius: 5px;
130
+ background-image: -webkit-gradient(
131
+ linear,
132
+ left top,
133
+ left bottom,
134
+ color-stop(0, rgb(214,211,214)),
135
+ color-stop(0.25, rgb(189,189,189)),
136
+ color-stop(1, rgb(214,211,214))
137
+ );
138
+ background-image: -moz-linear-gradient(
139
+ center top,
140
+ rgb(214,211,214) 0%,
141
+ rgb(189,189,189) 25%,
142
+ rgb(214,211,214) 100%
143
+ );
144
+ }
145
+
146
+ .example-group dl dt {
147
+ padding: 0.2em 0.4em;
148
+ font-size: 18px;
149
+ border-bottom: 1px solid #999;
150
+ }
151
+ .example-group dl dd + dd {
152
+ border-top: 1px solid rgba(64,64,64,0.3);
153
+ }
154
+ .example-group dl dd.spec {
155
+ margin: 0;
156
+ padding: 0.3em 1.2em 0.3em 22px;
157
+ background: #ddd url(../images/clock.png) no-repeat 2px 2px;
158
+ }
159
+ .example-group dl dd.spec.passed {
160
+ background-color: #aacba3;
161
+ background-image: url(../images/tick_shield.png);
162
+ }
163
+ .example-group dl dd.spec.pending {
164
+ background-color: #cac574;
165
+ background-image: url(../images/exclamation_shield.png);
166
+ }
167
+ .example-group dl dd.spec.pending-fixed {
168
+ background-color: #8a9dca;
169
+ background-image: url(../images/question_shield.png);
170
+ }
171
+ .example-group dl dd.spec.failed {
172
+ background-color: #d39595;
173
+ background-image: url(../images/cross_shield.png);
174
+ }
175
+ .example-group dl dd.spec.logged .spec-name:after {
176
+ content: " *";
177
+ }
178
+ .example-group dl dd.spec.logged .spec-name {
179
+ cursor: pointer;
180
+ }
181
+
182
+ dd.nested-group {
183
+ margin: 0;
184
+ }
185
+ dd.nested-group dl {
186
+ margin: 0;
187
+ }
188
+ dd.nested-group dl dt {
189
+ font-size: 14px;
190
+ }
191
+ dd.nested-group dl dt:before {
192
+ content: "…";
193
+ }
194
+ dd.nested-group section.example-group {
195
+ margin: 0;
196
+ padding: 0 1em;
197
+ -webkit-box-shadow: none;
198
+ -moz-box-shadow: none;
199
+ -webkit-border-radius: 0;
200
+ -moz-border-radius: none;
201
+ background-image: -webkit-gradient(
202
+ linear,
203
+ left bottom,
204
+ left top,
205
+ color-stop(0, rgb(219,219,219)),
206
+ color-stop(1, rgb(240,240,240))
207
+ );
208
+ background-image: -moz-linear-gradient(
209
+ center bottom,
210
+ rgb(219,219,219) 0%,
211
+ rgb(240,240,240) 100%
212
+ );
213
+ }
214
+
215
+
216
+ .failure {
217
+ /*display: none;*/
218
+ }
219
+ .failure .message {
220
+ margin-top: 0.2em;
221
+ background: #dedede;
222
+ padding: 0.2em 1em;
223
+ }
224
+ .failure .backtrace {
225
+ overflow: auto;
226
+ }
227
+ .failure .backtrace p {
228
+ margin: 0;
229
+ line-height: 135%;
230
+ }
231
+ .failure .backtrace .backtrace-frame {
232
+ white-space: pre;
233
+ }
234
+
235
+ /* Ruby code, style similar to vibrant ink */
236
+ .ruby {
237
+ font-size: 12px;
238
+ font-family: Menlo, Monaco, monospace;
239
+ color: white;
240
+ background-color: black;
241
+ padding: 0.1em 0 0.2em 0;
242
+ }
243
+
244
+ .ruby .keyword { color: #FF6600; }
245
+ .ruby .constant { color: #339999; }
246
+ .ruby .attribute { color: white; }
247
+ .ruby .global { color: white; }
248
+ .ruby .module { color: white; }
249
+ .ruby .class { color: white; }
250
+ .ruby .string { color: #66FF00; }
251
+ .ruby .ident { color: white; }
252
+ .ruby .method { color: #FFCC00; }
253
+ .ruby .number { color: white; }
254
+ .ruby .char { color: white; }
255
+ .ruby .comment { color: #9933CC; }
256
+ .ruby .symbol { color: white; }
257
+ .ruby .regex { color: #44B4CC; }
258
+ .ruby .punct { color: white; }
259
+ .ruby .escape { color: white; }
260
+ .ruby .interp { color: white; }
261
+ .ruby .expr { color: white; }
262
+
263
+ .ruby .offending { background-color: rgba(255,55,55,0.35); }
264
+ .ruby .linenum {
265
+ width: 75px;
266
+ padding: 0.1em 1em 0.2em 0;
267
+ color: #000000;
268
+ background-color: #FFFBD3;
269
+ }
270
+
271
+ /* Style for log output */
272
+ div.log-messages {
273
+ display: none;
274
+ margin: 0;
275
+ padding: 0;
276
+ background-color: #999;
277
+ font: 0.8em "Vera Sans Mono", "Andale Mono", Monaco, mono;
278
+ }
279
+ div.log-message {
280
+ background: #eee;
281
+ padding: 0 1.2em;
282
+ margin: 0 1em;
283
+ border-top: 1px solid #999;
284
+ text-indent: -1em;
285
+ }
286
+
287
+ /* Parts of the message */
288
+ div.log-message .log-time {
289
+ font-weight: bold;
290
+ }
291
+ div.log-message .log-time:after {
292
+ content: ": ";
293
+ }
294
+ div.log-message .log-level {
295
+ font-variant: small-caps;
296
+ border: 1px solid #ccc;
297
+ padding: 1px 2px;
298
+ }
299
+ div.log-message .log-name {
300
+ font-size: 1.2em;
301
+ color: #1e51b2;
302
+ }
303
+ div.log-message .log-name:before { content: "«"; }
304
+ div.log-message .log-name:after { content: "»"; }
305
+
306
+ div.log-message .log-message-text {
307
+ padding-left: 4px;
308
+ font-family: Monaco, "Andale Mono", "Vera Sans Mono", mono;
309
+ }
310
+
311
+
312
+ /* Distinguish levels */
313
+ div.log-message.debug { color: #666; }
314
+ div.log-message.info {}
315
+
316
+ div.log-message.warn,
317
+ div.log-message.error {
318
+ background: #ff9;
319
+ }
320
+ div.log-message.error .log-level,
321
+ div.log-message.error .log-message-text {
322
+ color: #900;
323
+ }
324
+ div.log-message.fatal {
325
+ background: #900;
326
+ color: white;
327
+ font-weight: bold;
328
+ border: 0;
329
+ }
330
+ div.log-message.fatal .log-name {
331
+ color: white;
332
+ }