bauxite 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/Rakefile +69 -0
- data/bin/bauxite +27 -0
- data/doc/Bauxite/Action.html +1463 -0
- data/doc/Bauxite/ActionModule.html +342 -0
- data/doc/Bauxite/Context.html +1439 -0
- data/doc/Bauxite/Errors/AssertionError.html +107 -0
- data/doc/Bauxite/Errors/FileNotFoundError.html +107 -0
- data/doc/Bauxite/Errors.html +100 -0
- data/doc/Bauxite/Loggers/CompositeLogger.html +325 -0
- data/doc/Bauxite/Loggers/EchoLogger.html +164 -0
- data/doc/Bauxite/Loggers/FileLogger.html +215 -0
- data/doc/Bauxite/Loggers/NullLogger.html +334 -0
- data/doc/Bauxite/Loggers/TerminalLogger.html +586 -0
- data/doc/Bauxite/Loggers/XtermLogger.html +287 -0
- data/doc/Bauxite/Loggers.html +103 -0
- data/doc/Bauxite/Selector.html +422 -0
- data/doc/Bauxite/SelectorModule.html +283 -0
- data/doc/Bauxite.html +98 -0
- data/doc/created.rid +37 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/fonts.css +167 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +111 -0
- data/doc/js/darkfish.js +140 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +580 -0
- data/doc/table_of_contents.html +510 -0
- data/lib/bauxite/actions/alias.rb +51 -0
- data/lib/bauxite/actions/assert.rb +49 -0
- data/lib/bauxite/actions/assertv.rb +40 -0
- data/lib/bauxite/actions/break.rb +39 -0
- data/lib/bauxite/actions/click.rb +35 -0
- data/lib/bauxite/actions/debug.rb +99 -0
- data/lib/bauxite/actions/echo.rb +36 -0
- data/lib/bauxite/actions/exec.rb +46 -0
- data/lib/bauxite/actions/js.rb +41 -0
- data/lib/bauxite/actions/load.rb +49 -0
- data/lib/bauxite/actions/open.rb +34 -0
- data/lib/bauxite/actions/params.rb +40 -0
- data/lib/bauxite/actions/replace.rb +37 -0
- data/lib/bauxite/actions/reset.rb +37 -0
- data/lib/bauxite/actions/return.rb +62 -0
- data/lib/bauxite/actions/ruby.rb +58 -0
- data/lib/bauxite/actions/set.rb +39 -0
- data/lib/bauxite/actions/source.rb +44 -0
- data/lib/bauxite/actions/store.rb +38 -0
- data/lib/bauxite/actions/test.rb +61 -0
- data/lib/bauxite/actions/tryload.rb +79 -0
- data/lib/bauxite/actions/wait.rb +38 -0
- data/lib/bauxite/actions/write.rb +40 -0
- data/lib/bauxite/application.rb +150 -0
- data/lib/bauxite/core/Action.rb +205 -0
- data/lib/bauxite/core/Context.rb +575 -0
- data/lib/bauxite/core/Errors.rb +36 -0
- data/lib/bauxite/core/Logger.rb +86 -0
- data/lib/bauxite/core/Selector.rb +156 -0
- data/lib/bauxite/loggers/composite.rb +70 -0
- data/lib/bauxite/loggers/echo.rb +36 -0
- data/lib/bauxite/loggers/file.rb +45 -0
- data/lib/bauxite/loggers/terminal.rb +130 -0
- data/lib/bauxite/loggers/xterm.rb +79 -0
- data/lib/bauxite/selectors/attr.rb +39 -0
- data/lib/bauxite/selectors/default.rb +38 -0
- data/lib/bauxite/selectors/frame.rb +60 -0
- data/lib/bauxite.rb +29 -0
- data/test/alias.bxt +6 -0
- data/test/assertv.bxt +2 -0
- data/test/delay/page.html +5 -0
- data/test/delay.bxt +2 -0
- data/test/exec.bxt +6 -0
- data/test/format/page.html +7 -0
- data/test/format.bxt +17 -0
- data/test/frame/child_frame.html +7 -0
- data/test/frame/grandchild_frame.html +5 -0
- data/test/frame/page.html +5 -0
- data/test/frame.bxt +6 -0
- data/test/js.bxt +5 -0
- data/test/load/child.bxt +13 -0
- data/test/load.bxt +17 -0
- data/test/ruby/custom.rb +5 -0
- data/test/ruby.bxt +2 -0
- data/test/selectors/page.html +7 -0
- data/test/selectors.bxt +7 -0
- data/test/stdin.bxt +1 -0
- data/test/test/test1.bxt +2 -0
- data/test/test/test2.bxt +3 -0
- data/test/test/test3.bxt +2 -0
- data/test/test.bxt.manual +4 -0
- metadata +194 -0
@@ -0,0 +1,586 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Bauxite::Loggers::TerminalLogger - 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-_block">#_block</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-_cmd_color">#_cmd_color</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-_fmt">#_fmt</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-_restore_cursor">#_restore_cursor</a>
|
85
|
+
|
86
|
+
<li ><a href="#method-i-_save_cursor">#_save_cursor</a>
|
87
|
+
|
88
|
+
<li ><a href="#method-i-_screen_width">#_screen_width</a>
|
89
|
+
|
90
|
+
<li class="calls-super" ><a href="#method-i-debug_prompt">#debug_prompt</a>
|
91
|
+
|
92
|
+
<li class="calls-super" ><a href="#method-i-log">#log</a>
|
93
|
+
|
94
|
+
<li ><a href="#method-i-log_cmd">#log_cmd</a>
|
95
|
+
|
96
|
+
<li ><a href="#method-i-progress">#progress</a>
|
97
|
+
|
98
|
+
</ul>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
</nav>
|
103
|
+
|
104
|
+
<main role="main" aria-labelledby="class-Bauxite::Loggers::TerminalLogger">
|
105
|
+
<h1 id="class-Bauxite::Loggers::TerminalLogger" class="class">
|
106
|
+
class Bauxite::Loggers::TerminalLogger
|
107
|
+
</h1>
|
108
|
+
|
109
|
+
<section class="description">
|
110
|
+
|
111
|
+
<p>Terminal logger.</p>
|
112
|
+
|
113
|
+
<p>This logger outputs text using basic text formatting for a terminal window.</p>
|
114
|
+
|
115
|
+
</section>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
131
|
+
<header>
|
132
|
+
<h3>Public Class Methods</h3>
|
133
|
+
</header>
|
134
|
+
|
135
|
+
|
136
|
+
<div id="method-c-new" class="method-detail ">
|
137
|
+
|
138
|
+
<div class="method-heading">
|
139
|
+
<span class="method-name">new</span><span
|
140
|
+
class="method-args">(options)</span>
|
141
|
+
|
142
|
+
<span class="method-click-advice">click to toggle source</span>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
<div class="method-description">
|
148
|
+
|
149
|
+
<p>Constructs a new Terminal logger instance.</p>
|
150
|
+
|
151
|
+
|
152
|
+
<div class="method-calls-super">
|
153
|
+
Calls superclass method
|
154
|
+
<a href="NullLogger.html#method-c-new">Bauxite::Loggers::NullLogger.new</a>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<div class="method-source-code" id="new-source">
|
160
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 30</span>
|
161
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>)
|
162
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>)
|
163
|
+
<span class="ruby-ivar">@max_cmd_size</span> = <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">max_action_name_size</span>
|
164
|
+
<span class="ruby-keyword">end</span></pre>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
</div>
|
173
|
+
|
174
|
+
|
175
|
+
</section>
|
176
|
+
|
177
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
178
|
+
<header>
|
179
|
+
<h3>Public Instance Methods</h3>
|
180
|
+
</header>
|
181
|
+
|
182
|
+
|
183
|
+
<div id="method-i-debug_prompt" class="method-detail ">
|
184
|
+
|
185
|
+
<div class="method-heading">
|
186
|
+
<span class="method-name">debug_prompt</span><span
|
187
|
+
class="method-args">()</span>
|
188
|
+
|
189
|
+
<span class="method-click-advice">click to toggle source</span>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
|
196
|
+
<p>Returns a colorized debug prompt.</p>
|
197
|
+
|
198
|
+
|
199
|
+
<div class="method-calls-super">
|
200
|
+
Calls superclass method
|
201
|
+
<a href="NullLogger.html#method-i-debug_prompt">Bauxite::Loggers::NullLogger#debug_prompt</a>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<div class="method-source-code" id="debug_prompt-source">
|
207
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 65</span>
|
208
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">debug_prompt</span>
|
209
|
+
<span class="ruby-identifier">_fmt</span>(<span class="ruby-value">:white</span>, <span class="ruby-keyword">super</span>)
|
210
|
+
<span class="ruby-keyword">end</span></pre>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
<div id="method-i-log" class="method-detail ">
|
222
|
+
|
223
|
+
<div class="method-heading">
|
224
|
+
<span class="method-name">log</span><span
|
225
|
+
class="method-args">(s, type = :info)</span>
|
226
|
+
|
227
|
+
<span class="method-click-advice">click to toggle source</span>
|
228
|
+
|
229
|
+
</div>
|
230
|
+
|
231
|
+
|
232
|
+
<div class="method-description">
|
233
|
+
|
234
|
+
<p>Prints the specified string.</p>
|
235
|
+
|
236
|
+
<p>See Bauxite::Loggers::NullLogger#print</p>
|
237
|
+
|
238
|
+
|
239
|
+
<div class="method-calls-super">
|
240
|
+
Calls superclass method
|
241
|
+
<a href="NullLogger.html#method-i-log">Bauxite::Loggers::NullLogger#log</a>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
<div class="method-source-code" id="log-source">
|
247
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 80</span>
|
248
|
+
<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>)
|
249
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-value">:gray</span>
|
250
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
|
251
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:error</span>
|
252
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-value">:red</span>
|
253
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:warning</span>
|
254
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-value">:yellow</span>
|
255
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:debug</span>
|
256
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-value">:purple</span>
|
257
|
+
<span class="ruby-keyword">end</span>
|
258
|
+
<span class="ruby-keyword">super</span> <span class="ruby-identifier">_fmt</span>(<span class="ruby-identifier">color</span>, <span class="ruby-identifier">s</span>), <span class="ruby-identifier">type</span>
|
259
|
+
<span class="ruby-keyword">end</span></pre>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
<div id="method-i-log_cmd" class="method-detail ">
|
271
|
+
|
272
|
+
<div class="method-heading">
|
273
|
+
<span class="method-name">log_cmd</span><span
|
274
|
+
class="method-args">(action) { || ... }</span>
|
275
|
+
|
276
|
+
<span class="method-click-advice">click to toggle source</span>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
<div class="method-description">
|
282
|
+
|
283
|
+
<p>Pretty prints action information and status.</p>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
<div class="method-source-code" id="log_cmd-source">
|
289
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 36</span>
|
290
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">log_cmd</span>(<span class="ruby-identifier">action</span>)
|
291
|
+
<span class="ruby-identifier">width</span> = <span class="ruby-identifier">_screen_width</span>
|
292
|
+
<span class="ruby-identifier">cmd</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">downcase</span>
|
293
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-identifier">_cmd_color</span>(<span class="ruby-identifier">cmd</span>)
|
294
|
+
<span class="ruby-identifier">cmd</span> = <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">ljust</span>(<span class="ruby-ivar">@max_cmd_size</span>)
|
295
|
+
<span class="ruby-identifier">max_args_size</span> = <span class="ruby-identifier">width</span><span class="ruby-operator">-</span><span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-value">6</span><span class="ruby-operator">-</span><span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>
|
296
|
+
|
297
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">"#{_fmt(color, cmd)} "</span>
|
298
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">args</span>(<span class="ruby-keyword">true</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
|
299
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">max_args_size</span><span class="ruby-operator">-</span><span class="ruby-value">3</span>]<span class="ruby-operator">+</span><span class="ruby-string">'...'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max_args_size</span>
|
300
|
+
<span class="ruby-identifier">print</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">ljust</span>(<span class="ruby-identifier">max_args_size</span>)
|
301
|
+
<span class="ruby-identifier">_save_cursor</span>
|
302
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-value">:green</span>
|
303
|
+
<span class="ruby-identifier">text</span> = <span class="ruby-string">'OK'</span>
|
304
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword">yield</span>
|
305
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">ret</span>
|
306
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-value">:yellow</span>
|
307
|
+
<span class="ruby-identifier">text</span> = <span class="ruby-string">'SKIP'</span>
|
308
|
+
<span class="ruby-keyword">end</span>
|
309
|
+
<span class="ruby-identifier">_restore_cursor</span>
|
310
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-node">" #{_block(color, text, 5)}"</span>
|
311
|
+
<span class="ruby-identifier">ret</span>
|
312
|
+
<span class="ruby-keyword">rescue</span>
|
313
|
+
<span class="ruby-identifier">_restore_cursor</span>
|
314
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-node">" #{_block(:red, 'ERROR', 5)}"</span>
|
315
|
+
<span class="ruby-identifier">raise</span>
|
316
|
+
<span class="ruby-keyword">end</span></pre>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
</div>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
<div id="method-i-progress" class="method-detail ">
|
328
|
+
|
329
|
+
<div class="method-heading">
|
330
|
+
<span class="method-name">progress</span><span
|
331
|
+
class="method-args">(value)</span>
|
332
|
+
|
333
|
+
<span class="method-click-advice">click to toggle source</span>
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
<div class="method-description">
|
339
|
+
|
340
|
+
<p>Updates action progress.</p>
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
<div class="method-source-code" id="progress-source">
|
346
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 70</span>
|
347
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">progress</span>(<span class="ruby-identifier">value</span>)
|
348
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">_restore_cursor</span>
|
349
|
+
<span class="ruby-identifier">print</span> <span class="ruby-node">" #{_block(:gray, value.to_s, 5)}"</span>
|
350
|
+
<span class="ruby-keyword">end</span>
|
351
|
+
<span class="ruby-keyword">end</span></pre>
|
352
|
+
</div>
|
353
|
+
|
354
|
+
</div>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
</div>
|
360
|
+
|
361
|
+
|
362
|
+
</section>
|
363
|
+
|
364
|
+
<section id="protected-instance-5Buntitled-5D-method-details" class="method-section">
|
365
|
+
<header>
|
366
|
+
<h3>Protected Instance Methods</h3>
|
367
|
+
</header>
|
368
|
+
|
369
|
+
|
370
|
+
<div id="method-i-_block" class="method-detail ">
|
371
|
+
|
372
|
+
<div class="method-heading">
|
373
|
+
<span class="method-name">_block</span><span
|
374
|
+
class="method-args">(color, text, size)</span>
|
375
|
+
|
376
|
+
<span class="method-click-advice">click to toggle source</span>
|
377
|
+
|
378
|
+
</div>
|
379
|
+
|
380
|
+
|
381
|
+
<div class="method-description">
|
382
|
+
|
383
|
+
<p>Prints <code>text</code> centered inside a square-bracketed block.</p>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
<div class="method-source-code" id="_block-source">
|
389
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 110</span>
|
390
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_block</span>(<span class="ruby-identifier">color</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">size</span>)
|
391
|
+
<span class="ruby-node">"#{_fmt(:white, '[')}#{_fmt(color, text, size)}#{_fmt(:white, ']')}"</span>
|
392
|
+
<span class="ruby-keyword">end</span></pre>
|
393
|
+
</div>
|
394
|
+
|
395
|
+
</div>
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
</div>
|
401
|
+
|
402
|
+
|
403
|
+
<div id="method-i-_cmd_color" class="method-detail ">
|
404
|
+
|
405
|
+
<div class="method-heading">
|
406
|
+
<span class="method-name">_cmd_color</span><span
|
407
|
+
class="method-args">(cmd)</span>
|
408
|
+
|
409
|
+
<span class="method-click-advice">click to toggle source</span>
|
410
|
+
|
411
|
+
</div>
|
412
|
+
|
413
|
+
|
414
|
+
<div class="method-description">
|
415
|
+
|
416
|
+
<p>Get the color of <code>cmd</code>.</p>
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
<div class="method-source-code" id="_cmd_color-source">
|
422
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 115</span>
|
423
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_cmd_color</span>(<span class="ruby-identifier">cmd</span>)
|
424
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">cmd</span>
|
425
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'load'</span>
|
426
|
+
<span class="ruby-keyword">return</span> <span class="ruby-value">:cyan</span>
|
427
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'test'</span>
|
428
|
+
<span class="ruby-keyword">return</span> <span class="ruby-value">:purple</span>
|
429
|
+
<span class="ruby-keyword">else</span>
|
430
|
+
<span class="ruby-keyword">return</span> <span class="ruby-value">:blue</span>
|
431
|
+
<span class="ruby-keyword">end</span>
|
432
|
+
<span class="ruby-keyword">end</span></pre>
|
433
|
+
</div>
|
434
|
+
|
435
|
+
</div>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
</div>
|
441
|
+
|
442
|
+
|
443
|
+
<div id="method-i-_fmt" class="method-detail ">
|
444
|
+
|
445
|
+
<div class="method-heading">
|
446
|
+
<span class="method-name">_fmt</span><span
|
447
|
+
class="method-args">(color, text, size = 0)</span>
|
448
|
+
|
449
|
+
<span class="method-click-advice">click to toggle source</span>
|
450
|
+
|
451
|
+
</div>
|
452
|
+
|
453
|
+
|
454
|
+
<div class="method-description">
|
455
|
+
|
456
|
+
<p>Centers <code>text</code> to a fixed size with.</p>
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
<div class="method-source-code" id="_fmt-source">
|
462
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 95</span>
|
463
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_fmt</span>(<span class="ruby-identifier">color</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">size</span> = <span class="ruby-value">0</span>)
|
464
|
+
<span class="ruby-identifier">text</span>.<span class="ruby-identifier">center</span>(<span class="ruby-identifier">size</span>)
|
465
|
+
<span class="ruby-keyword">end</span></pre>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
</div>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
</div>
|
474
|
+
|
475
|
+
|
476
|
+
<div id="method-i-_restore_cursor" class="method-detail ">
|
477
|
+
|
478
|
+
<div class="method-heading">
|
479
|
+
<span class="method-name">_restore_cursor</span><span
|
480
|
+
class="method-args">()</span>
|
481
|
+
|
482
|
+
<span class="method-click-advice">click to toggle source</span>
|
483
|
+
|
484
|
+
</div>
|
485
|
+
|
486
|
+
|
487
|
+
<div class="method-description">
|
488
|
+
|
489
|
+
<p>Restores the cursor to the previously saved cursor position.</p>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
<div class="method-source-code" id="_restore_cursor-source">
|
495
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 105</span>
|
496
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_restore_cursor</span>
|
497
|
+
<span class="ruby-keyword">false</span>
|
498
|
+
<span class="ruby-keyword">end</span></pre>
|
499
|
+
</div>
|
500
|
+
|
501
|
+
</div>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
</div>
|
507
|
+
|
508
|
+
|
509
|
+
<div id="method-i-_save_cursor" class="method-detail ">
|
510
|
+
|
511
|
+
<div class="method-heading">
|
512
|
+
<span class="method-name">_save_cursor</span><span
|
513
|
+
class="method-args">()</span>
|
514
|
+
|
515
|
+
<span class="method-click-advice">click to toggle source</span>
|
516
|
+
|
517
|
+
</div>
|
518
|
+
|
519
|
+
|
520
|
+
<div class="method-description">
|
521
|
+
|
522
|
+
<p>Save the current cursor position,</p>
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
<div class="method-source-code" id="_save_cursor-source">
|
528
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 100</span>
|
529
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_save_cursor</span>
|
530
|
+
<span class="ruby-keyword">false</span>
|
531
|
+
<span class="ruby-keyword">end</span></pre>
|
532
|
+
</div>
|
533
|
+
|
534
|
+
</div>
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
</div>
|
540
|
+
|
541
|
+
|
542
|
+
<div id="method-i-_screen_width" class="method-detail ">
|
543
|
+
|
544
|
+
<div class="method-heading">
|
545
|
+
<span class="method-name">_screen_width</span><span
|
546
|
+
class="method-args">()</span>
|
547
|
+
|
548
|
+
<span class="method-click-advice">click to toggle source</span>
|
549
|
+
|
550
|
+
</div>
|
551
|
+
|
552
|
+
|
553
|
+
<div class="method-description">
|
554
|
+
|
555
|
+
<p>Returns the terminal screen width.</p>
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
<div class="method-source-code" id="_screen_width-source">
|
561
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/terminal.rb, line 127</span>
|
562
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_screen_width</span>
|
563
|
+
<span class="ruby-value">80</span>
|
564
|
+
<span class="ruby-keyword">end</span></pre>
|
565
|
+
</div>
|
566
|
+
|
567
|
+
</div>
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
|
572
|
+
</div>
|
573
|
+
|
574
|
+
|
575
|
+
</section>
|
576
|
+
|
577
|
+
</section>
|
578
|
+
</main>
|
579
|
+
|
580
|
+
|
581
|
+
<footer id="validator-badges" role="contentinfo">
|
582
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
583
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
584
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
585
|
+
</footer>
|
586
|
+
|