bauxite 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Bauxite/Loggers/HtmlLogger.html +15 -109
- data/doc/Bauxite/Loggers/ReportLogger.html +338 -0
- data/doc/created.rid +54 -54
- data/doc/index.html +2 -0
- data/doc/js/jquery.js +4 -18
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +65 -52
- data/lib/bauxite/core/logger.rb +78 -0
- data/lib/bauxite/loggers/html.rb +13 -48
- data/lib/bauxite/parsers/csv.rb +0 -6
- data/lib/bauxite.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0a12464fac55698b51c38d3aac40315c7f83d7c
|
4
|
+
data.tar.gz: 158527f237bad6ac07a44f8e8c99ae137c529e65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ad74ae440c740796ca55b1b4e88ae006b2565b6bd72d533c98c486ab48323d75f437b740e40c62ad409e0809994da6cd2f13bbc4cd9018e73d915993ada7045
|
7
|
+
data.tar.gz: efd929c30dbeee930f37abdd7e515a630cc46ac60303a6b57a28988f1b113f9f711bfd4609c94c3c5f8196f890455c0eac4088c014022cad5d82261459a8a4e7
|
@@ -61,7 +61,7 @@
|
|
61
61
|
<h3>Parent</h3>
|
62
62
|
|
63
63
|
|
64
|
-
<p class="link"><a href="
|
64
|
+
<p class="link"><a href="ReportLogger.html">Bauxite::Loggers::ReportLogger</a>
|
65
65
|
|
66
66
|
</div>
|
67
67
|
|
@@ -77,10 +77,6 @@
|
|
77
77
|
|
78
78
|
<li ><a href="#method-i-finalize">#finalize</a>
|
79
79
|
|
80
|
-
<li ><a href="#method-i-log">#log</a>
|
81
|
-
|
82
|
-
<li ><a href="#method-i-log_cmd">#log_cmd</a>
|
83
|
-
|
84
80
|
</ul>
|
85
81
|
</div>
|
86
82
|
|
@@ -150,7 +146,7 @@ the filesystem.</p>
|
|
150
146
|
|
151
147
|
<div class="method-calls-super">
|
152
148
|
Calls superclass method
|
153
|
-
<a href="
|
149
|
+
<a href="ReportLogger.html#method-c-new">Bauxite::Loggers::ReportLogger.new</a>
|
154
150
|
</div>
|
155
151
|
|
156
152
|
|
@@ -159,7 +155,6 @@ the filesystem.</p>
|
|
159
155
|
<pre><span class="ruby-comment"># File lib/bauxite/loggers/html.rb, line 42</span>
|
160
156
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>)
|
161
157
|
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>)
|
162
|
-
<span class="ruby-ivar">@data</span> = []
|
163
158
|
<span class="ruby-ivar">@file</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:html</span>] <span class="ruby-operator">||</span> <span class="ruby-string">'test.html'</span>
|
164
159
|
<span class="ruby-ivar">@imgs</span> = []
|
165
160
|
<span class="ruby-keyword">end</span></pre>
|
@@ -200,7 +195,7 @@ the filesystem.</p>
|
|
200
195
|
|
201
196
|
|
202
197
|
<div class="method-source-code" id="finalize-source">
|
203
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/html.rb, line
|
198
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/html.rb, line 50</span>
|
204
199
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">finalize</span>(<span class="ruby-identifier">ctx</span>)
|
205
200
|
<span class="ruby-identifier">output</span> = <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">variables</span>[<span class="ruby-string">'__OUTPUT__'</span>] <span class="ruby-operator">||</span> <span class="ruby-string">''</span>
|
206
201
|
|
@@ -211,16 +206,18 @@ the filesystem.</p>
|
|
211
206
|
body { font: 10pt sans-serif; }
|
212
207
|
.action div { display: inline-block; }
|
213
208
|
.cmd { width: 100px }
|
214
|
-
.status {
|
209
|
+
.status { float: right; text-align: center; }
|
210
|
+
.status .text { width: 100px; font-weight: bold }
|
215
211
|
.test { background-color: #DFDFFF; margin-top: 20px }
|
216
|
-
.ok .status { background-color: #DFFFDF }
|
217
|
-
.error .status { background-color: #FFDFDF }
|
218
|
-
.skip .status { background-color: #FFDFFF }
|
212
|
+
.ok .status .text { background-color: #DFFFDF }
|
213
|
+
.error .status .text { background-color: #FFDFDF }
|
214
|
+
.skip .status .text { background-color: #FFDFFF }
|
219
215
|
.capture { border: 1px solid black }
|
220
216
|
.capture img { max-width: 100% }
|
221
217
|
.odd { background-color: #EEEEEE }
|
222
218
|
.summary th { background-color: #DFDFFF; text-align: left }
|
223
219
|
.summary td { cursor: pointer; }
|
220
|
+
.top { position: absolute; top: 0px; right: 0px; background-color: #DFDFFF; padding: 5px; border-radius: 0px 0px 0px 5px; }
|
224
221
|
|
225
222
|
</style>
|
226
223
|
<script type='text/javascript'>
|
@@ -231,7 +228,7 @@ the filesystem.</p>
|
|
231
228
|
</script>
|
232
229
|
</head>
|
233
230
|
<body>"</span>
|
234
|
-
|
231
|
+
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">2</span>, <span class="ruby-node">"<div class='top'>Created using <a href='https://github.com/pzavolinsky/bauxite'>bauxite</a> on #{Time.new}</div>"</span>)
|
235
232
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">tests</span>.<span class="ruby-identifier">any?</span>
|
236
233
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">2</span>, <span class="ruby-string">"<h1>Test Summary</h1>"</span>)
|
237
234
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">2</span>, <span class="ruby-string">"<table class='summary'>"</span>)
|
@@ -253,14 +250,17 @@ the filesystem.</p>
|
|
253
250
|
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">test</span>[<span class="ruby-value">:name</span>]
|
254
251
|
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">test</span>[<span class="ruby-value">:actions</span>].<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>[<span class="ruby-value">:status</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:error</span> } <span class="ruby-operator">?</span> <span class="ruby-value">:error</span> <span class="ruby-operator">:</span> <span class="ruby-value">:ok</span>
|
255
252
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">2</span>, <span class="ruby-node">"<a name='#{name}'></a>"</span>)
|
256
|
-
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">2</span>, <span class="ruby-node">"<div class='test #{status}'>#{name}<div class='status'>#{status.upcase}</div></div>"</span>)
|
253
|
+
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">2</span>, <span class="ruby-node">"<div class='test #{status}'>#{name}<div class='status'><div class='text'>#{status.upcase}</div></div></div>"</span>)
|
257
254
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">2</span>, <span class="ruby-node">"<div id='#{name}_content' class='test-content'>"</span>)
|
258
255
|
|
259
256
|
<span class="ruby-identifier">test</span>[<span class="ruby-value">:actions</span>].<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">action</span>,<span class="ruby-identifier">idx</span><span class="ruby-operator">|</span>
|
260
257
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">3</span>, <span class="ruby-node">"<div class='action #{action[:status]} #{(idx % 2) == 1 ? 'odd' : 'even'}'>"</span>)
|
261
258
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">4</span>, <span class="ruby-node">"<div class='cmd'>#{action[:cmd]}</div>"</span>)
|
262
259
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">4</span>, <span class="ruby-node">"<div class='args'>#{action[:args].join(' ')}</div>"</span>)
|
263
|
-
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">4</span>, <span class="ruby-
|
260
|
+
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">4</span>, <span class="ruby-string">"<div class='status'>"</span>)
|
261
|
+
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">5</span>, <span class="ruby-node">"<div class='time'>(#{action[:time].round(2).to_s}s)</div>"</span>)
|
262
|
+
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">5</span>, <span class="ruby-node">"<div class='text'>#{action[:status].upcase}</div>"</span>)
|
263
|
+
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">4</span>, <span class="ruby-string">"</div>"</span>)
|
264
264
|
<span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_d</span>(<span class="ruby-value">3</span>, <span class="ruby-string">"</div>"</span>)
|
265
265
|
<span class="ruby-identifier">capture</span> = <span class="ruby-identifier">action</span>[<span class="ruby-value">:capture</span>]
|
266
266
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">capture</span>
|
@@ -292,100 +292,6 @@ the filesystem.</p>
|
|
292
292
|
|
293
293
|
|
294
294
|
|
295
|
-
</div>
|
296
|
-
|
297
|
-
|
298
|
-
<div id="method-i-log" class="method-detail ">
|
299
|
-
|
300
|
-
<div class="method-heading">
|
301
|
-
<span class="method-name">log</span><span
|
302
|
-
class="method-args">(s, type = :info)</span>
|
303
|
-
|
304
|
-
<span class="method-click-advice">click to toggle source</span>
|
305
|
-
|
306
|
-
</div>
|
307
|
-
|
308
|
-
|
309
|
-
<div class="method-description">
|
310
|
-
|
311
|
-
<p>Logs the specified string.</p>
|
312
|
-
|
313
|
-
<p><code>type</code>, if specified, should be one of <code>:error</code>,
|
314
|
-
<code>:warning</code>, <code>:info</code> (default), <code>:debug</code>.</p>
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
<div class="method-source-code" id="log-source">
|
320
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/html.rb, line 54</span>
|
321
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">type</span> = <span class="ruby-value">:info</span>)
|
322
|
-
<span class="ruby-keyword">end</span></pre>
|
323
|
-
</div>
|
324
|
-
|
325
|
-
</div>
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
</div>
|
331
|
-
|
332
|
-
|
333
|
-
<div id="method-i-log_cmd" class="method-detail ">
|
334
|
-
|
335
|
-
<div class="method-heading">
|
336
|
-
<span class="method-name">log_cmd</span><span
|
337
|
-
class="method-args">(action) { ||| false| ... }</span>
|
338
|
-
|
339
|
-
<span class="method-click-advice">click to toggle source</span>
|
340
|
-
|
341
|
-
</div>
|
342
|
-
|
343
|
-
|
344
|
-
<div class="method-description">
|
345
|
-
|
346
|
-
<p>Echoes the raw action text.</p>
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
<div class="method-source-code" id="log_cmd-source">
|
352
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/html.rb, line 58</span>
|
353
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">log_cmd</span>(<span class="ruby-identifier">action</span>)
|
354
|
-
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword">yield</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">false</span>
|
355
|
-
<span class="ruby-keyword">ensure</span>
|
356
|
-
<span class="ruby-identifier">status</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">ret</span>; <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>; <span class="ruby-value">:error</span>; <span class="ruby-keyword">when</span> <span class="ruby-keyword">false</span>; <span class="ruby-value">:skip</span>; <span class="ruby-keyword">else</span> <span class="ruby-value">:ok</span>; <span class="ruby-keyword">end</span>
|
357
|
-
|
358
|
-
<span class="ruby-identifier">test_name</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">variables</span>[<span class="ruby-string">'__TEST__'</span>] <span class="ruby-operator">||</span> <span class="ruby-string">'Main'</span>
|
359
|
-
<span class="ruby-identifier">test</span> = <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>[<span class="ruby-value">:name</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">test_name</span> }
|
360
|
-
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">test</span>
|
361
|
-
<span class="ruby-identifier">test</span> = { <span class="ruby-value">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">test_name</span>, <span class="ruby-value">:actions</span> =<span class="ruby-operator">></span> [] }
|
362
|
-
<span class="ruby-ivar">@data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">test</span>
|
363
|
-
<span class="ruby-keyword">end</span>
|
364
|
-
|
365
|
-
<span class="ruby-identifier">capture</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">variables</span>[<span class="ruby-string">'__CAPTURE__'</span>]
|
366
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">capture</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@last_capture</span>
|
367
|
-
<span class="ruby-identifier">capture</span> = <span class="ruby-keyword">nil</span>
|
368
|
-
<span class="ruby-keyword">else</span>
|
369
|
-
<span class="ruby-ivar">@last_capture</span> = <span class="ruby-identifier">capture</span>
|
370
|
-
<span class="ruby-keyword">end</span>
|
371
|
-
|
372
|
-
<span class="ruby-identifier">test</span>[<span class="ruby-value">:actions</span>] <span class="ruby-operator"><<</span> {
|
373
|
-
<span class="ruby-value">:cmd</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>.<span class="ruby-identifier">cmd</span>,
|
374
|
-
<span class="ruby-value">:args</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>.<span class="ruby-identifier">args</span>(<span class="ruby-keyword">true</span>),
|
375
|
-
<span class="ruby-value">:action</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>,
|
376
|
-
<span class="ruby-value">:status</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">status</span>,
|
377
|
-
<span class="ruby-value">:capture</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">capture</span>
|
378
|
-
}
|
379
|
-
|
380
|
-
<span class="ruby-identifier">ret</span>
|
381
|
-
<span class="ruby-keyword">end</span></pre>
|
382
|
-
</div>
|
383
|
-
|
384
|
-
</div>
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
295
|
</div>
|
390
296
|
|
391
297
|
|
@@ -0,0 +1,338 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Bauxite::Loggers::ReportLogger - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="../../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../../js/jquery.js"></script>
|
17
|
+
<script src="../../js/navigation.js"></script>
|
18
|
+
<script src="../../js/search_index.js"></script>
|
19
|
+
<script src="../../js/search.js"></script>
|
20
|
+
<script src="../../js/searcher.js"></script>
|
21
|
+
<script src="../../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
63
|
+
|
64
|
+
<p class="link"><a href="NullLogger.html">Bauxite::Loggers::NullLogger</a>
|
65
|
+
|
66
|
+
</div>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
|
76
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-i-finalize">#finalize</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-log">#log</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-log_cmd">#log_cmd</a>
|
83
|
+
|
84
|
+
</ul>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
</nav>
|
89
|
+
|
90
|
+
<main role="main" aria-labelledby="class-Bauxite::Loggers::ReportLogger">
|
91
|
+
<h1 id="class-Bauxite::Loggers::ReportLogger" class="class">
|
92
|
+
class Bauxite::Loggers::ReportLogger
|
93
|
+
</h1>
|
94
|
+
|
95
|
+
<section class="description">
|
96
|
+
|
97
|
+
<p>Report logger.</p>
|
98
|
+
|
99
|
+
<p>This base logger class can be inherited to create reporting loggers.</p>
|
100
|
+
|
101
|
+
<p>Descendent classes must override the <a
|
102
|
+
href="ReportLogger.html#method-i-finalize">finalize</a> method and iterate
|
103
|
+
the <code>@data</code> array to produce the report.</p>
|
104
|
+
|
105
|
+
<p>The items included in the <code>@data</code> array contain the following
|
106
|
+
fields:</p>
|
107
|
+
<dl class="rdoc-list label-list"><dt>:name
|
108
|
+
<dd>
|
109
|
+
<p>Name of the current test.</p>
|
110
|
+
</dd><dt>:actions
|
111
|
+
<dd>
|
112
|
+
<p>Array of actions with the following fields</p>
|
113
|
+
<ul><li>
|
114
|
+
<p><code>:cmd</code>: name of the action.</p>
|
115
|
+
</li><li>
|
116
|
+
<p><code>:args</code>: action arguments.</p>
|
117
|
+
</li><li>
|
118
|
+
<p><code>:action</code>: action object.</p>
|
119
|
+
</li><li>
|
120
|
+
<p><code>:status</code>: action execution status: <code>:ok</code>,
|
121
|
+
<code>:skip</code> or <code>:error</code>.</p>
|
122
|
+
</li><li>
|
123
|
+
<p><code>:capture</code>: path to the current capture, if any.</p>
|
124
|
+
</li></ul>
|
125
|
+
</dd></dl>
|
126
|
+
|
127
|
+
<p>For an example of a <a href="ReportLogger.html">ReportLogger</a>
|
128
|
+
implementation see the <a href="HtmlLogger.html">HtmlLogger</a> class.</p>
|
129
|
+
|
130
|
+
</section>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
146
|
+
<header>
|
147
|
+
<h3>Public Class Methods</h3>
|
148
|
+
</header>
|
149
|
+
|
150
|
+
|
151
|
+
<div id="method-c-new" class="method-detail ">
|
152
|
+
|
153
|
+
<div class="method-heading">
|
154
|
+
<span class="method-name">new</span><span
|
155
|
+
class="method-args">(options)</span>
|
156
|
+
|
157
|
+
<span class="method-click-advice">click to toggle source</span>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
|
164
|
+
<p>Constructs a new report logger instance.</p>
|
165
|
+
|
166
|
+
|
167
|
+
<div class="method-calls-super">
|
168
|
+
Calls superclass method
|
169
|
+
<a href="NullLogger.html#method-c-new">Bauxite::Loggers::NullLogger.new</a>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<div class="method-source-code" id="new-source">
|
175
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/logger.rb, line 116</span>
|
176
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>)
|
177
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>)
|
178
|
+
<span class="ruby-ivar">@data</span> = []
|
179
|
+
<span class="ruby-keyword">end</span></pre>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</div>
|
188
|
+
|
189
|
+
|
190
|
+
</section>
|
191
|
+
|
192
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
193
|
+
<header>
|
194
|
+
<h3>Public Instance Methods</h3>
|
195
|
+
</header>
|
196
|
+
|
197
|
+
|
198
|
+
<div id="method-i-finalize" class="method-detail ">
|
199
|
+
|
200
|
+
<div class="method-heading">
|
201
|
+
<span class="method-name">finalize</span><span
|
202
|
+
class="method-args">(ctx)</span>
|
203
|
+
|
204
|
+
<span class="method-click-advice">click to toggle source</span>
|
205
|
+
|
206
|
+
</div>
|
207
|
+
|
208
|
+
|
209
|
+
<div class="method-description">
|
210
|
+
|
211
|
+
<p>Completes the log execution.</p>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<div class="method-source-code" id="finalize-source">
|
217
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/logger.rb, line 165</span>
|
218
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">finalize</span>(<span class="ruby-identifier">ctx</span>)
|
219
|
+
<span class="ruby-keyword">end</span></pre>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
</div>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
</div>
|
228
|
+
|
229
|
+
|
230
|
+
<div id="method-i-log" class="method-detail ">
|
231
|
+
|
232
|
+
<div class="method-heading">
|
233
|
+
<span class="method-name">log</span><span
|
234
|
+
class="method-args">(s, type = :info)</span>
|
235
|
+
|
236
|
+
<span class="method-click-advice">click to toggle source</span>
|
237
|
+
|
238
|
+
</div>
|
239
|
+
|
240
|
+
|
241
|
+
<div class="method-description">
|
242
|
+
|
243
|
+
<p>Logs the specified string.</p>
|
244
|
+
|
245
|
+
<p><code>type</code>, if specified, should be one of <code>:error</code>,
|
246
|
+
<code>:warning</code>, <code>:info</code> (default), <code>:debug</code>.</p>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
<div class="method-source-code" id="log-source">
|
252
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/logger.rb, line 126</span>
|
253
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">type</span> = <span class="ruby-value">:info</span>)
|
254
|
+
<span class="ruby-keyword">end</span></pre>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
<div id="method-i-log_cmd" class="method-detail ">
|
266
|
+
|
267
|
+
<div class="method-heading">
|
268
|
+
<span class="method-name">log_cmd</span><span
|
269
|
+
class="method-args">(action) { ||| false| ... }</span>
|
270
|
+
|
271
|
+
<span class="method-click-advice">click to toggle source</span>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
<div class="method-description">
|
277
|
+
|
278
|
+
<p>Echoes the raw action text.</p>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
<div class="method-source-code" id="log_cmd-source">
|
284
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/logger.rb, line 130</span>
|
285
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">log_cmd</span>(<span class="ruby-identifier">action</span>)
|
286
|
+
<span class="ruby-identifier">stime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>
|
287
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword">yield</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">false</span>
|
288
|
+
<span class="ruby-identifier">etime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>
|
289
|
+
<span class="ruby-keyword">ensure</span>
|
290
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">ret</span>; <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>; <span class="ruby-value">:error</span>; <span class="ruby-keyword">when</span> <span class="ruby-keyword">false</span>; <span class="ruby-value">:skip</span>; <span class="ruby-keyword">else</span> <span class="ruby-value">:ok</span>; <span class="ruby-keyword">end</span>
|
291
|
+
|
292
|
+
<span class="ruby-identifier">test_name</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">variables</span>[<span class="ruby-string">'__TEST__'</span>] <span class="ruby-operator">||</span> <span class="ruby-string">'Main'</span>
|
293
|
+
<span class="ruby-identifier">test</span> = <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>[<span class="ruby-value">:name</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">test_name</span> }
|
294
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">test</span>
|
295
|
+
<span class="ruby-identifier">test</span> = { <span class="ruby-value">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">test_name</span>, <span class="ruby-value">:actions</span> =<span class="ruby-operator">></span> [] }
|
296
|
+
<span class="ruby-ivar">@data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">test</span>
|
297
|
+
<span class="ruby-keyword">end</span>
|
298
|
+
|
299
|
+
<span class="ruby-identifier">capture</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">variables</span>[<span class="ruby-string">'__CAPTURE__'</span>]
|
300
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">capture</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@last_capture</span>
|
301
|
+
<span class="ruby-identifier">capture</span> = <span class="ruby-keyword">nil</span>
|
302
|
+
<span class="ruby-keyword">else</span>
|
303
|
+
<span class="ruby-ivar">@last_capture</span> = <span class="ruby-identifier">capture</span>
|
304
|
+
<span class="ruby-keyword">end</span>
|
305
|
+
|
306
|
+
<span class="ruby-identifier">test</span>[<span class="ruby-value">:actions</span>] <span class="ruby-operator"><<</span> {
|
307
|
+
<span class="ruby-value">:cmd</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>.<span class="ruby-identifier">cmd</span>,
|
308
|
+
<span class="ruby-value">:args</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>.<span class="ruby-identifier">args</span>(<span class="ruby-keyword">true</span>),
|
309
|
+
<span class="ruby-value">:action</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>,
|
310
|
+
<span class="ruby-value">:status</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">status</span>,
|
311
|
+
<span class="ruby-value">:time</span> =<span class="ruby-operator">></span> (<span class="ruby-identifier">etime</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">stime</span>),
|
312
|
+
<span class="ruby-value">:capture</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">capture</span>
|
313
|
+
}
|
314
|
+
|
315
|
+
<span class="ruby-identifier">ret</span>
|
316
|
+
<span class="ruby-keyword">end</span></pre>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
</div>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
</section>
|
328
|
+
|
329
|
+
</section>
|
330
|
+
</main>
|
331
|
+
|
332
|
+
|
333
|
+
<footer id="validator-badges" role="contentinfo">
|
334
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
335
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
336
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
337
|
+
</footer>
|
338
|
+
|