bovem 1.2.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. data/.travis.yml +1 -1
  2. data/Gemfile +1 -1
  3. data/README.md +5 -2
  4. data/bovem.gemspec +11 -9
  5. data/doc/Bovem.html +7 -25
  6. data/doc/Bovem/Configuration.html +30 -43
  7. data/doc/Bovem/Console.html +225 -4360
  8. data/doc/Bovem/ConsoleMethods.html +125 -0
  9. data/doc/Bovem/ConsoleMethods/Interactions.html +575 -0
  10. data/doc/Bovem/ConsoleMethods/Interactions/ClassMethods.html +231 -0
  11. data/doc/Bovem/ConsoleMethods/Logging.html +2218 -0
  12. data/doc/Bovem/ConsoleMethods/Logging/ClassMethods.html +212 -0
  13. data/doc/Bovem/ConsoleMethods/Output.html +1213 -0
  14. data/doc/Bovem/ConsoleMethods/StyleHandling.html +274 -0
  15. data/doc/Bovem/ConsoleMethods/StyleHandling/ClassMethods.html +653 -0
  16. data/doc/Bovem/Errors.html +3 -3
  17. data/doc/Bovem/Errors/InvalidConfiguration.html +3 -3
  18. data/doc/Bovem/Errors/InvalidLogger.html +3 -3
  19. data/doc/Bovem/Logger.html +112 -12
  20. data/doc/Bovem/Shell.html +58 -1888
  21. data/doc/Bovem/ShellMethods.html +125 -0
  22. data/doc/Bovem/ShellMethods/Directories.html +484 -0
  23. data/doc/Bovem/ShellMethods/Execute.html +565 -0
  24. data/doc/Bovem/ShellMethods/General.html +450 -0
  25. data/doc/Bovem/ShellMethods/Read.html +451 -0
  26. data/doc/Bovem/ShellMethods/Write.html +676 -0
  27. data/doc/Bovem/Version.html +6 -6
  28. data/doc/_index.html +145 -4
  29. data/doc/class_list.html +1 -1
  30. data/doc/file.README.html +10 -7
  31. data/doc/frames.html +1 -1
  32. data/doc/index.html +10 -7
  33. data/doc/method_list.html +119 -79
  34. data/doc/top-level-namespace.html +3 -3
  35. data/lib/bovem.rb +1 -1
  36. data/lib/bovem/configuration.rb +24 -13
  37. data/lib/bovem/console.rb +566 -497
  38. data/lib/bovem/errors.rb +1 -1
  39. data/lib/bovem/logger.rb +4 -4
  40. data/lib/bovem/shell.rb +482 -305
  41. data/lib/bovem/version.rb +4 -4
  42. data/locales/en.yml +43 -0
  43. data/locales/it.yml +43 -0
  44. data/spec/bovem/configuration_spec.rb +3 -3
  45. data/spec/bovem/console_spec.rb +17 -10
  46. data/spec/bovem/logger_spec.rb +1 -1
  47. data/spec/bovem/shell_spec.rb +9 -5
  48. data/spec/coverage_helper.rb +1 -1
  49. data/spec/spec_helper.rb +1 -1
  50. metadata +32 -22
@@ -0,0 +1,125 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Bovem::ConsoleMethods
8
+
9
+ &mdash; Documentation by YARD 0.8.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span>
36
+ &raquo;
37
+ <span class="title">ConsoleMethods</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Bovem::ConsoleMethods
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/bovem/console.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+ <p>Methods of the <span class='object_link'><a href="Console.html" title="Bovem::Console (class)">Console</a></span> class.</p>
90
+
91
+
92
+ </div>
93
+ </div>
94
+ <div class="tags">
95
+
96
+
97
+ </div><h2>Defined Under Namespace</h2>
98
+ <p class="children">
99
+
100
+
101
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Interactions</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Logging</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Output</a></span>, <span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">StyleHandling</a></span>
102
+
103
+
104
+
105
+
106
+ </p>
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ </div>
117
+
118
+ <div id="footer">
119
+ Generated on Fri Feb 1 23:40:17 2013 by
120
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
+ 0.8.3 (ruby-1.9.3).
122
+ </div>
123
+
124
+ </body>
125
+ </html>
@@ -0,0 +1,575 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Bovem::ConsoleMethods::Interactions
8
+
9
+ &mdash; Documentation by YARD 0.8.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (I)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Bovem.html" title="Bovem (module)">Bovem</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span>
36
+ &raquo;
37
+ <span class="title">Interactions</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Bovem::ConsoleMethods::Interactions
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+ <dt class="r1">Extended by:</dt>
77
+ <dd class="r1">ActiveSupport::Concern</dd>
78
+
79
+
80
+
81
+
82
+
83
+
84
+ <dt class="r2">Included in:</dt>
85
+ <dd class="r2"><span class='object_link'><a href="../Console.html" title="Bovem::Console (class)">Bovem::Console</a></span></dd>
86
+
87
+
88
+
89
+ <dt class="r1 last">Defined in:</dt>
90
+ <dd class="r1 last">lib/bovem/console.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+ <h2>Overview</h2><div class="docstring">
96
+ <div class="discussion">
97
+ <p>Methods to interact with the user and other processes.</p>
98
+
99
+
100
+ </div>
101
+ </div>
102
+ <div class="tags">
103
+
104
+
105
+ </div><h2>Defined Under Namespace</h2>
106
+ <p class="children">
107
+
108
+
109
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Interactions/ClassMethods.html" title="Bovem::ConsoleMethods::Interactions::ClassMethods (module)">ClassMethods</a></span>
110
+
111
+
112
+
113
+
114
+ </p>
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <h2>
124
+ Instance Method Summary
125
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
126
+ </h2>
127
+
128
+ <ul class="summary">
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#read-instance_method" title="#read (instance method)">- (Object) <strong>read</strong>(prompt = true, default_value = nil, validator = nil, echo = true) </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ <span class="summary_desc"><div class='inline'><p>Reads a string from the console.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
153
+ <li class="public ">
154
+ <span class="summary_signature">
155
+
156
+ <a href="#task-instance_method" title="#task (instance method)">- (Symbol) <strong>task</strong>(message = nil, suffix = &quot;\n&quot;, indent = true, wrap = false, plain = false, indented_banner = false, full_colored = false, block_indentation = 2, block_indentation_absolute = false) </a>
157
+
158
+
159
+
160
+ </span>
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ <span class="summary_desc"><div class='inline'><p>Executes a block of code in a indentation region and then prints out and ending status message.</p>
171
+ </div></span>
172
+
173
+ </li>
174
+
175
+
176
+ </ul>
177
+
178
+
179
+
180
+
181
+
182
+ <div id="instance_method_details" class="method_details_list">
183
+ <h2>Instance Method Details</h2>
184
+
185
+
186
+ <div class="method_details first">
187
+ <h3 class="signature first" id="read-instance_method">
188
+
189
+ - (<tt>Object</tt>) <strong>read</strong>(prompt = true, default_value = nil, validator = nil, echo = true)
190
+
191
+
192
+
193
+
194
+
195
+ </h3><div class="docstring">
196
+ <div class="discussion">
197
+ <p>Reads a string from the console.</p>
198
+
199
+
200
+ </div>
201
+ </div>
202
+ <div class="tags">
203
+ <p class="tag_title">Parameters:</p>
204
+ <ul class="param">
205
+
206
+ <li>
207
+
208
+ <span class='name'>prompt</span>
209
+
210
+
211
+ <span class='type'>(<tt>String|Boolean</tt>)</span>
212
+
213
+
214
+ <em class="default">(defaults to: <tt>true</tt>)</em>
215
+
216
+
217
+ &mdash;
218
+ <div class='inline'><p>A prompt to show. If <code>true</code>, <code>Please insert a value:</code> will be used, if <code>nil</code> or <code>false</code> no prompt will be shown.</p>
219
+ </div>
220
+
221
+ </li>
222
+
223
+ <li>
224
+
225
+ <span class='name'>default_value</span>
226
+
227
+
228
+ <span class='type'>(<tt>String</tt>)</span>
229
+
230
+
231
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
232
+
233
+
234
+ &mdash;
235
+ <div class='inline'><p>Default value if user simply pressed the enter key.</p>
236
+ </div>
237
+
238
+ </li>
239
+
240
+ <li>
241
+
242
+ <span class='name'>validator</span>
243
+
244
+
245
+ <span class='type'>(<tt>Array|Regexp</tt>)</span>
246
+
247
+
248
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
249
+
250
+
251
+ &mdash;
252
+ <div class='inline'><p>An array of values or a Regexp to match the submitted value against.</p>
253
+ </div>
254
+
255
+ </li>
256
+
257
+ <li>
258
+
259
+ <span class='name'>echo</span>
260
+
261
+
262
+ <span class='type'>(<tt>Boolean</tt>)</span>
263
+
264
+
265
+ <em class="default">(defaults to: <tt>true</tt>)</em>
266
+
267
+
268
+ &mdash;
269
+ <div class='inline'><p>If to show submitted text to the user.</p>
270
+ </div>
271
+
272
+ </li>
273
+
274
+ </ul>
275
+
276
+
277
+ </div><table class="source_code">
278
+ <tr>
279
+ <td>
280
+ <pre class="lines">
281
+
282
+
283
+ 469
284
+ 470
285
+ 471
286
+ 472
287
+ 473
288
+ 474
289
+ 475
290
+ 476
291
+ 477
292
+ 478
293
+ 479
294
+ 480
295
+ 481
296
+ 482
297
+ 483
298
+ 484
299
+ 485
300
+ 486
301
+ 487</pre>
302
+ </td>
303
+ <td>
304
+ <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 469</span>
305
+
306
+ <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_prompt'>prompt</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_default_value'>default_value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_validator'>validator</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_echo'>echo</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
307
+ <span class='id identifier rubyid_prompt'>prompt</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitize_prompt'>sanitize_prompt</span><span class='lparen'>(</span><span class='id identifier rubyid_prompt'>prompt</span><span class='rparen'>)</span>
308
+
309
+ <span class='comment'># Adjust validator
310
+ </span> <span class='id identifier rubyid_validator'>validator</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitize_validator'>sanitize_validator</span><span class='lparen'>(</span><span class='id identifier rubyid_validator'>validator</span><span class='rparen'>)</span>
311
+
312
+ <span class='id identifier rubyid_with_echo_handling'>with_echo_handling</span><span class='lparen'>(</span><span class='id identifier rubyid_echo'>echo</span><span class='rparen'>)</span> <span class='kw'>do</span>
313
+ <span class='kw'>begin</span>
314
+ <span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:reply</span><span class='rparen'>)</span> <span class='kw'>do</span>
315
+ <span class='kw'>while</span> <span class='kw'>true</span> <span class='kw'>do</span>
316
+ <span class='id identifier rubyid_reply'>reply</span> <span class='op'>=</span> <span class='id identifier rubyid_validate_input_value'>validate_input_value</span><span class='lparen'>(</span><span class='id identifier rubyid_read_input_value'>read_input_value</span><span class='lparen'>(</span><span class='id identifier rubyid_prompt'>prompt</span><span class='comma'>,</span> <span class='id identifier rubyid_default_value'>default_value</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_validator'>validator</span><span class='rparen'>)</span>
317
+ <span class='id identifier rubyid_handle_reply'>handle_reply</span><span class='lparen'>(</span><span class='id identifier rubyid_reply'>reply</span><span class='rparen'>)</span>
318
+ <span class='kw'>end</span>
319
+ <span class='kw'>end</span>
320
+ <span class='kw'>rescue</span> <span class='const'>Interrupt</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
321
+ <span class='id identifier rubyid_default_value'>default_value</span>
322
+ <span class='kw'>end</span>
323
+ <span class='kw'>end</span>
324
+ <span class='kw'>end</span></pre>
325
+ </td>
326
+ </tr>
327
+ </table>
328
+ </div>
329
+
330
+ <div class="method_details ">
331
+ <h3 class="signature " id="task-instance_method">
332
+
333
+ - (<tt>Symbol</tt>) <strong>task</strong>(message = nil, suffix = &quot;\n&quot;, indent = true, wrap = false, plain = false, indented_banner = false, full_colored = false, block_indentation = 2, block_indentation_absolute = false)
334
+
335
+
336
+
337
+
338
+
339
+ </h3><div class="docstring">
340
+ <div class="discussion">
341
+ <p>Executes a block of code in a indentation region and then prints out and ending status message.</p>
342
+
343
+
344
+ </div>
345
+ </div>
346
+ <div class="tags">
347
+ <p class="tag_title">Parameters:</p>
348
+ <ul class="param">
349
+
350
+ <li>
351
+
352
+ <span class='name'>message</span>
353
+
354
+
355
+ <span class='type'>(<tt>String</tt>)</span>
356
+
357
+
358
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
359
+
360
+
361
+ &mdash;
362
+ <div class='inline'><p>The message to format.</p>
363
+ </div>
364
+
365
+ </li>
366
+
367
+ <li>
368
+
369
+ <span class='name'>suffix</span>
370
+
371
+
372
+ <span class='type'>(<tt>Object</tt>)</span>
373
+
374
+
375
+ <em class="default">(defaults to: <tt>&quot;\n&quot;</tt>)</em>
376
+
377
+
378
+ &mdash;
379
+ <div class='inline'><p>If not <code>nil</code> or <code>false</code>, a suffix to add to the message. <code>true</code> means to add <code>\n</code>.</p>
380
+ </div>
381
+
382
+ </li>
383
+
384
+ <li>
385
+
386
+ <span class='name'>indent</span>
387
+
388
+
389
+ <span class='type'>(<tt>Object</tt>)</span>
390
+
391
+
392
+ <em class="default">(defaults to: <tt>true</tt>)</em>
393
+
394
+
395
+ &mdash;
396
+ <div class='inline'><p>If not <code>nil</code> or <code>false</code>, the width to use for indentation. <code>true</code> means to use the current indentation, a negative value of <code>-x</code> will indent of <code>x</code> absolute spaces.</p>
397
+ </div>
398
+
399
+ </li>
400
+
401
+ <li>
402
+
403
+ <span class='name'>wrap</span>
404
+
405
+
406
+ <span class='type'>(<tt>Object</tt>)</span>
407
+
408
+
409
+ <em class="default">(defaults to: <tt>false</tt>)</em>
410
+
411
+
412
+ &mdash;
413
+ <div class='inline'><p>If not <code>nil</code> or <code>false</code>, the maximum length of a line for wrapped text. <code>true</code> means the current line width.</p>
414
+ </div>
415
+
416
+ </li>
417
+
418
+ <li>
419
+
420
+ <span class='name'>plain</span>
421
+
422
+
423
+ <span class='type'>(<tt>Boolean</tt>)</span>
424
+
425
+
426
+ <em class="default">(defaults to: <tt>false</tt>)</em>
427
+
428
+
429
+ &mdash;
430
+ <div class='inline'><p>If ignore color markers into the message.</p>
431
+ </div>
432
+
433
+ </li>
434
+
435
+ <li>
436
+
437
+ <span class='name'>indented_banner</span>
438
+
439
+
440
+ <span class='type'>(<tt>Boolean</tt>)</span>
441
+
442
+
443
+ <em class="default">(defaults to: <tt>false</tt>)</em>
444
+
445
+
446
+ &mdash;
447
+ <div class='inline'><p>If also the banner should be indented.</p>
448
+ </div>
449
+
450
+ </li>
451
+
452
+ <li>
453
+
454
+ <span class='name'>full_colored</span>
455
+
456
+
457
+ <span class='type'>(<tt>Boolean</tt>)</span>
458
+
459
+
460
+ <em class="default">(defaults to: <tt>false</tt>)</em>
461
+
462
+
463
+ &mdash;
464
+ <div class='inline'><p>If the banner should be fully colored.</p>
465
+ </div>
466
+
467
+ </li>
468
+
469
+ <li>
470
+
471
+ <span class='name'>block_indentation</span>
472
+
473
+
474
+ <span class='type'>(<tt>Fixnum</tt>)</span>
475
+
476
+
477
+ <em class="default">(defaults to: <tt>2</tt>)</em>
478
+
479
+
480
+ &mdash;
481
+ <div class='inline'><p>The new width for the indented region.</p>
482
+ </div>
483
+
484
+ </li>
485
+
486
+ <li>
487
+
488
+ <span class='name'>block_indentation_absolute</span>
489
+
490
+
491
+ <span class='type'>(<tt>Boolean</tt>)</span>
492
+
493
+
494
+ <em class="default">(defaults to: <tt>false</tt>)</em>
495
+
496
+
497
+ &mdash;
498
+ <div class='inline'><p>If the new width should not be added to the current one but rather replace it.</p>
499
+ </div>
500
+
501
+ </li>
502
+
503
+ </ul>
504
+
505
+ <p class="tag_title">Returns:</p>
506
+ <ul class="return">
507
+
508
+ <li>
509
+
510
+
511
+ <span class='type'>(<tt>Symbol</tt>)</span>
512
+
513
+
514
+
515
+ &mdash;
516
+ <div class='inline'><p>The exit status for the block.</p>
517
+ </div>
518
+
519
+ </li>
520
+
521
+ </ul>
522
+
523
+ </div><table class="source_code">
524
+ <tr>
525
+ <td>
526
+ <pre class="lines">
527
+
528
+
529
+ 501
530
+ 502
531
+ 503
532
+ 504
533
+ 505
534
+ 506
535
+ 507
536
+ 508
537
+ 509
538
+ 510
539
+ 511
540
+ 512
541
+ 513</pre>
542
+ </td>
543
+ <td>
544
+ <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 501</span>
545
+
546
+ <span class='kw'>def</span> <span class='id identifier rubyid_task'>task</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_suffix'>suffix</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_indent'>indent</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_wrap'>wrap</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_plain'>plain</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_indented_banner'>indented_banner</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_full_colored'>full_colored</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_block_indentation'>block_indentation</span> <span class='op'>=</span> <span class='int'>2</span><span class='comma'>,</span> <span class='id identifier rubyid_block_indentation_absolute'>block_indentation_absolute</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
547
+ <span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='kw'>nil</span>
548
+
549
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_begin'>begin</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_suffix'>suffix</span><span class='comma'>,</span> <span class='id identifier rubyid_indent'>indent</span><span class='comma'>,</span> <span class='id identifier rubyid_wrap'>wrap</span><span class='comma'>,</span> <span class='id identifier rubyid_plain'>plain</span><span class='comma'>,</span> <span class='id identifier rubyid_indented_banner'>indented_banner</span><span class='comma'>,</span> <span class='id identifier rubyid_full_colored'>full_colored</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
550
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_with_indentation'>with_indentation</span><span class='lparen'>(</span><span class='id identifier rubyid_block_indentation'>block_indentation</span><span class='comma'>,</span> <span class='id identifier rubyid_block_indentation_absolute'>block_indentation_absolute</span><span class='rparen'>)</span> <span class='kw'>do</span>
551
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='op'>?</span> <span class='kw'>yield</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='symbol'>:ok</span><span class='rbracket'>]</span> <span class='comment'># Execute block
552
+ </span> <span class='id identifier rubyid_exit_task'>exit_task</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_rv'>rv</span><span class='comma'>,</span> <span class='id identifier rubyid_plain'>plain</span><span class='rparen'>)</span> <span class='comment'># Handle task exit
553
+ </span> <span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_rv'>rv</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='comment'># Return value
554
+ </span>
555
+ <span class='kw'>end</span>
556
+
557
+ <span class='id identifier rubyid_status'>status</span>
558
+ <span class='kw'>end</span></pre>
559
+ </td>
560
+ </tr>
561
+ </table>
562
+ </div>
563
+
564
+ </div>
565
+
566
+ </div>
567
+
568
+ <div id="footer">
569
+ Generated on Fri Feb 1 23:40:18 2013 by
570
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
571
+ 0.8.3 (ruby-1.9.3).
572
+ </div>
573
+
574
+ </body>
575
+ </html>