bovem 3.0.5 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -3
- data/.rubocop.yml +82 -0
- data/.travis-gemfile +4 -5
- data/.travis.yml +8 -6
- data/CHANGELOG.md +12 -0
- data/Gemfile +9 -8
- data/README.md +1 -1
- data/Rakefile +22 -6
- data/bovem.gemspec +5 -5
- data/doc/Bovem.html +10 -10
- data/doc/Bovem/Application.html +670 -318
- data/doc/Bovem/Command.html +1447 -1125
- data/doc/Bovem/CommandMethods.html +4 -4
- data/doc/Bovem/CommandMethods/Children.html +173 -179
- data/doc/Bovem/CommandMethods/Help.html +9 -9
- data/doc/Bovem/Configuration.html +239 -24
- data/doc/Bovem/Console.html +267 -128
- data/doc/Bovem/ConsoleMethods.html +4 -4
- data/doc/Bovem/ConsoleMethods/Interactions.html +57 -70
- data/doc/Bovem/ConsoleMethods/Interactions/ClassMethods.html +9 -9
- data/doc/Bovem/ConsoleMethods/Logging.html +258 -298
- data/doc/Bovem/ConsoleMethods/Logging/ClassMethods.html +8 -8
- data/doc/Bovem/ConsoleMethods/Output.html +96 -118
- data/doc/Bovem/ConsoleMethods/StyleHandling.html +8 -8
- data/doc/Bovem/ConsoleMethods/StyleHandling/ClassMethods.html +26 -39
- data/doc/Bovem/Errors.html +4 -4
- data/doc/Bovem/Errors/Error.html +4 -4
- data/doc/Bovem/Errors/InvalidConfiguration.html +4 -4
- data/doc/Bovem/Errors/InvalidLogger.html +4 -4
- data/doc/Bovem/I18n.html +175 -0
- data/doc/Bovem/Logger.html +95 -83
- data/doc/Bovem/Option.html +669 -862
- data/doc/Bovem/Parser.html +10 -10
- data/doc/Bovem/ParserMethods.html +4 -4
- data/doc/Bovem/ParserMethods/General.html +4 -4
- data/doc/Bovem/ParserMethods/General/ClassMethods.html +26 -38
- data/doc/Bovem/Shell.html +169 -48
- data/doc/Bovem/ShellMethods.html +4 -4
- data/doc/Bovem/ShellMethods/Directories.html +46 -62
- data/doc/Bovem/ShellMethods/Execute.html +51 -99
- data/doc/Bovem/ShellMethods/General.html +4 -445
- data/doc/Bovem/ShellMethods/Read.html +56 -61
- data/doc/Bovem/ShellMethods/Write.html +22 -242
- data/doc/Bovem/Version.html +6 -6
- data/doc/_index.html +18 -18
- data/doc/class_list.html +6 -2
- data/doc/css/style.css +1 -0
- data/doc/file.README.html +5 -5
- data/doc/file_list.html +5 -1
- data/doc/frames.html +1 -1
- data/doc/index.html +5 -5
- data/doc/js/full_list.js +4 -1
- data/doc/method_list.html +161 -157
- data/doc/top-level-namespace.html +4 -4
- data/lib/bovem.rb +3 -4
- data/lib/bovem/application.rb +47 -39
- data/lib/bovem/command.rb +175 -193
- data/lib/bovem/configuration.rb +28 -29
- data/lib/bovem/console.rb +244 -171
- data/lib/bovem/errors.rb +1 -1
- data/lib/bovem/i18n.rb +18 -0
- data/lib/bovem/logger.rb +26 -26
- data/lib/bovem/option.rb +49 -58
- data/lib/bovem/parser.rb +174 -222
- data/lib/bovem/shell.rb +272 -320
- data/lib/bovem/version.rb +2 -2
- data/locales/en.yml +39 -38
- data/locales/it.yml +39 -38
- data/spec/bovem/application_spec.rb +6 -5
- data/spec/bovem/command_spec.rb +23 -23
- data/spec/bovem/console_spec.rb +101 -102
- data/spec/bovem/i18n_spec.rb +21 -0
- data/spec/bovem/logger_spec.rb +4 -4
- data/spec/bovem/option_spec.rb +43 -43
- data/spec/bovem/parser_spec.rb +13 -13
- data/spec/bovem/shell_spec.rb +106 -115
- data/spec/spec_helper.rb +19 -6
- metadata +14 -13
- data/doc/Bovem/Localizer.html +0 -376
- data/lib/bovem/localizer.rb +0 -27
- data/spec/coverage_helper.rb +0 -20
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Bovem::CommandMethods::Help
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!"
|
20
|
+
framesUrl = "../../frames.html#!Bovem/CommandMethods/Help.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -183,11 +183,11 @@
|
|
183
183
|
<pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 13</span>
|
184
184
|
|
185
185
|
<span class='kw'>def</span> <span class='id identifier rubyid_show_help'>show_help</span>
|
186
|
-
<span class='id identifier rubyid_console'>console</span> <span class='op'>=</span> <span class='id identifier
|
187
|
-
<span class='id identifier
|
188
|
-
<span class='id identifier rubyid_show_help_banner'>show_help_banner</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier
|
189
|
-
<span class='id identifier rubyid_show_help_options'>show_help_options</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier
|
190
|
-
<span class='id identifier rubyid_show_help_commands'>show_help_commands</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier
|
186
|
+
<span class='id identifier rubyid_console'>console</span> <span class='op'>=</span> <span class='id identifier rubyid_application?'>application?</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_console'>console</span> <span class='op'>:</span> <span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_console'>console</span>
|
187
|
+
<span class='id identifier rubyid_application?'>application?</span> <span class='op'>?</span> <span class='id identifier rubyid_show_help_application_summary'>show_help_application_summary</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_show_help_command_summary'>show_help_command_summary</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span>
|
188
|
+
<span class='id identifier rubyid_show_help_banner'>show_help_banner</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_banner?'>banner?</span>
|
189
|
+
<span class='id identifier rubyid_show_help_options'>show_help_options</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_options?'>options?</span>
|
190
|
+
<span class='id identifier rubyid_show_help_commands'>show_help_commands</span><span class='lparen'>(</span><span class='id identifier rubyid_console'>console</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_commands?'>commands?</span>
|
191
191
|
<span class='const'>Kernel</span><span class='period'>.</span><span class='id identifier rubyid_exit'>exit</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
|
192
192
|
<span class='kw'>end</span></pre>
|
193
193
|
</td>
|
@@ -200,9 +200,9 @@
|
|
200
200
|
</div>
|
201
201
|
|
202
202
|
<div id="footer">
|
203
|
-
Generated on
|
203
|
+
Generated on Tue Mar 29 20:43:16 2016 by
|
204
204
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
205
|
-
0.8.7.
|
205
|
+
0.8.7.6 (ruby-2.3.0).
|
206
206
|
</div>
|
207
207
|
|
208
208
|
</body>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Bovem::Configuration
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '../';
|
20
|
-
framesUrl = "../frames.html#!"
|
20
|
+
framesUrl = "../frames.html#!Bovem/Configuration.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -127,6 +127,39 @@ end</p>
|
|
127
127
|
|
128
128
|
|
129
129
|
|
130
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
131
|
+
<ul class="summary">
|
132
|
+
|
133
|
+
<li class="public ">
|
134
|
+
<span class="summary_signature">
|
135
|
+
|
136
|
+
<a href="#i18n-instance_method" title="#i18n (instance method)">- (I18n) <strong>i18n</strong> </a>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
</span>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="note title readonly">readonly</span>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<span class="summary_desc"><div class='inline'><p>A i18n helper.</p>
|
156
|
+
</div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
</ul>
|
162
|
+
|
130
163
|
|
131
164
|
|
132
165
|
|
@@ -282,20 +315,20 @@ end</p>
|
|
282
315
|
<pre class="lines">
|
283
316
|
|
284
317
|
|
285
|
-
30
|
286
|
-
31
|
287
|
-
32
|
288
|
-
33
|
289
318
|
34
|
290
|
-
35
|
319
|
+
35
|
320
|
+
36
|
321
|
+
37
|
322
|
+
38
|
323
|
+
39</pre>
|
291
324
|
</td>
|
292
325
|
<td>
|
293
|
-
<pre class="code"><span class="info file"># File 'lib/bovem/configuration.rb', line
|
326
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/configuration.rb', line 34</span>
|
294
327
|
|
295
328
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_overrides'>overrides</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
296
329
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
297
330
|
|
298
|
-
<span class='
|
331
|
+
<span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bovem.configuration</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Application</span><span class='op'>::</span><span class='const'>LOCALE_ROOT</span><span class='rparen'>)</span>
|
299
332
|
<span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span><span class='rparen'>)</span>
|
300
333
|
<span class='kw'>end</span></pre>
|
301
334
|
</td>
|
@@ -305,6 +338,194 @@ end</p>
|
|
305
338
|
|
306
339
|
</div>
|
307
340
|
|
341
|
+
<div id="instance_attr_details" class="attr_details">
|
342
|
+
<h2>Instance Attribute Details</h2>
|
343
|
+
|
344
|
+
|
345
|
+
<span id=""></span>
|
346
|
+
<div class="method_details first">
|
347
|
+
<h3 class="signature first" id="i18n-instance_method">
|
348
|
+
|
349
|
+
- (<tt><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></tt>) <strong>i18n</strong> <span class="extras">(readonly)</span>
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
</h3><div class="docstring">
|
356
|
+
<div class="discussion">
|
357
|
+
<p>Returns A i18n helper.</p>
|
358
|
+
|
359
|
+
|
360
|
+
</div>
|
361
|
+
</div>
|
362
|
+
<div class="tags">
|
363
|
+
|
364
|
+
<p class="tag_title">Returns:</p>
|
365
|
+
<ul class="return">
|
366
|
+
|
367
|
+
<li>
|
368
|
+
|
369
|
+
|
370
|
+
<span class='type'>(<tt><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></tt>)</span>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
—
|
375
|
+
<div class='inline'><p>A i18n helper.</p>
|
376
|
+
</div>
|
377
|
+
|
378
|
+
</li>
|
379
|
+
|
380
|
+
</ul>
|
381
|
+
|
382
|
+
</div><table class="source_code">
|
383
|
+
<tr>
|
384
|
+
<td>
|
385
|
+
<pre class="lines">
|
386
|
+
|
387
|
+
|
388
|
+
24
|
389
|
+
25
|
390
|
+
26
|
391
|
+
27
|
392
|
+
28
|
393
|
+
29
|
394
|
+
30
|
395
|
+
31
|
396
|
+
32
|
397
|
+
33
|
398
|
+
34
|
399
|
+
35
|
400
|
+
36
|
401
|
+
37
|
402
|
+
38
|
403
|
+
39
|
404
|
+
40
|
405
|
+
41
|
406
|
+
42
|
407
|
+
43
|
408
|
+
44
|
409
|
+
45
|
410
|
+
46
|
411
|
+
47
|
412
|
+
48
|
413
|
+
49
|
414
|
+
50
|
415
|
+
51
|
416
|
+
52
|
417
|
+
53
|
418
|
+
54
|
419
|
+
55
|
420
|
+
56
|
421
|
+
57
|
422
|
+
58
|
423
|
+
59
|
424
|
+
60
|
425
|
+
61
|
426
|
+
62
|
427
|
+
63
|
428
|
+
64
|
429
|
+
65
|
430
|
+
66
|
431
|
+
67
|
432
|
+
68
|
433
|
+
69
|
434
|
+
70
|
435
|
+
71
|
436
|
+
72
|
437
|
+
73
|
438
|
+
74
|
439
|
+
75
|
440
|
+
76
|
441
|
+
77
|
442
|
+
78
|
443
|
+
79
|
444
|
+
80
|
445
|
+
81
|
446
|
+
82
|
447
|
+
83
|
448
|
+
84
|
449
|
+
85
|
450
|
+
86
|
451
|
+
87
|
452
|
+
88</pre>
|
453
|
+
</td>
|
454
|
+
<td>
|
455
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/configuration.rb', line 24</span>
|
456
|
+
|
457
|
+
<span class='kw'>class</span> <span class='const'>Configuration</span> <span class='op'><</span> <span class='const'>Lazier</span><span class='op'>::</span><span class='const'>Configuration</span>
|
458
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:i18n</span>
|
459
|
+
<span class='comment'># Creates a new configuration.
|
460
|
+
</span> <span class='comment'>#
|
461
|
+
</span> <span class='comment'># A configuration file is a plain Ruby file with a top-level {Configuration config} object.
|
462
|
+
</span> <span class='comment'>#
|
463
|
+
</span> <span class='comment'># @param file [String] The file to read.
|
464
|
+
</span> <span class='comment'># @param overrides [Hash] A set of values which override those set in the configuration file.
|
465
|
+
</span> <span class='comment'># @param logger [Logger] The logger to use for notifications.
|
466
|
+
</span> <span class='comment'># @see #parse
|
467
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_overrides'>overrides</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
468
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
469
|
+
|
470
|
+
<span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bovem.configuration</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Application</span><span class='op'>::</span><span class='const'>LOCALE_ROOT</span><span class='rparen'>)</span>
|
471
|
+
<span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span><span class='rparen'>)</span>
|
472
|
+
<span class='kw'>end</span>
|
473
|
+
|
474
|
+
<span class='comment'># Parses a configuration file.
|
475
|
+
</span> <span class='comment'>#
|
476
|
+
</span> <span class='comment'># A configuration file is a plain Ruby file with a top-level {Configuration config} object.
|
477
|
+
</span> <span class='comment'>#
|
478
|
+
</span> <span class='comment'># Example:
|
479
|
+
</span> <span class='comment'>#
|
480
|
+
</span> <span class='comment'># ```ruby
|
481
|
+
</span> <span class='comment'># config.property = "VALUE"
|
482
|
+
</span> <span class='comment'># ```
|
483
|
+
</span> <span class='comment'>#
|
484
|
+
</span> <span class='comment'># @param file [String] The file to read.
|
485
|
+
</span> <span class='comment'># @param logger [Logger] The logger to use for notifications.
|
486
|
+
</span> <span class='comment'># @param overrides [Hash] A set of values which override those set in the configuration file.
|
487
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_overrides'>overrides</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
488
|
+
<span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>?</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
489
|
+
|
490
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_file'>file</span>
|
491
|
+
<span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>InvalidConfiguration</span><span class='comma'>,</span> <span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_not_found'>not_found</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_readable?'>readable?</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
492
|
+
<span class='id identifier rubyid_read_configuration_file'>read_configuration_file</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span><span class='rparen'>)</span>
|
493
|
+
<span class='kw'>end</span>
|
494
|
+
|
495
|
+
<span class='comment'># Apply overrides
|
496
|
+
</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
497
|
+
|
498
|
+
<span class='kw'>self</span>
|
499
|
+
<span class='kw'>end</span>
|
500
|
+
|
501
|
+
<span class='id identifier rubyid_private'>private</span>
|
502
|
+
|
503
|
+
<span class='comment'># :nodoc:
|
504
|
+
</span> <span class='comment'># rubocop:disable RescueException
|
505
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_read_configuration_file'>read_configuration_file</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span><span class='rparen'>)</span>
|
506
|
+
<span class='comment'># Open the file
|
507
|
+
</span> <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_file'>file</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^</span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='op'>::</span><span class='const'>SEPARATOR</span><span class='embexpr_end'>}</span><span class='regexp_end'>/</span></span> <span class='op'>?</span> <span class='id identifier rubyid_file'>file</span> <span class='op'>:</span> <span class='op'>::</span><span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_realpath'>realpath</span>
|
508
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span><span class='period'>.</span><span class='id identifier rubyid_using'>using</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_logger'>logger</span>
|
509
|
+
<span class='id identifier rubyid_eval_file'>eval_file</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
510
|
+
<span class='kw'>rescue</span> <span class='const'>Exception</span>
|
511
|
+
<span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>InvalidConfiguration</span><span class='comma'>,</span> <span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_invalid'>invalid</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
512
|
+
<span class='kw'>end</span>
|
513
|
+
<span class='comment'># rubocop:enable RescueException
|
514
|
+
</span>
|
515
|
+
<span class='comment'># :nodoc:
|
516
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_eval_file'>eval_file</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
517
|
+
<span class='comment'># rubocop:disable UnusedBlockArgument, Eval
|
518
|
+
</span> <span class='id identifier rubyid_tap'>tap</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span> <span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
519
|
+
<span class='comment'># rubocop:enable UnusedBlockArgument, Eval
|
520
|
+
</span> <span class='kw'>end</span>
|
521
|
+
<span class='kw'>end</span></pre>
|
522
|
+
</td>
|
523
|
+
</tr>
|
524
|
+
</table>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
</div>
|
528
|
+
|
308
529
|
|
309
530
|
<div id="instance_method_details" class="method_details_list">
|
310
531
|
<h2>Instance Method Details</h2>
|
@@ -398,10 +619,6 @@ config.property = "VALUE"
|
|
398
619
|
<pre class="lines">
|
399
620
|
|
400
621
|
|
401
|
-
50
|
402
|
-
51
|
403
|
-
52
|
404
|
-
53
|
405
622
|
54
|
406
623
|
55
|
407
624
|
56
|
@@ -413,24 +630,22 @@ config.property = "VALUE"
|
|
413
630
|
62
|
414
631
|
63
|
415
632
|
64
|
416
|
-
65
|
633
|
+
65
|
634
|
+
66</pre>
|
417
635
|
</td>
|
418
636
|
<td>
|
419
|
-
<pre class="code"><span class="info file"># File 'lib/bovem/configuration.rb', line
|
637
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/configuration.rb', line 54</span>
|
420
638
|
|
421
639
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_overrides'>overrides</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
422
640
|
<span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>?</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
423
641
|
|
424
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_file'>file</span>
|
425
|
-
<span class='
|
426
|
-
|
427
|
-
<span class='kw'>else</span>
|
428
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>InvalidConfiguration</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span><span class='period'>.</span><span class='id identifier rubyid_not_found'>not_found</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
429
|
-
<span class='kw'>end</span>
|
642
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_file'>file</span>
|
643
|
+
<span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>InvalidConfiguration</span><span class='comma'>,</span> <span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_not_found'>not_found</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_readable?'>readable?</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
644
|
+
<span class='id identifier rubyid_read_configuration_file'>read_configuration_file</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span><span class='rparen'>)</span>
|
430
645
|
<span class='kw'>end</span>
|
431
646
|
|
432
647
|
<span class='comment'># Apply overrides
|
433
|
-
</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='
|
648
|
+
</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_overrides'>overrides</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
434
649
|
|
435
650
|
<span class='kw'>self</span>
|
436
651
|
<span class='kw'>end</span></pre>
|
@@ -444,9 +659,9 @@ config.property = "VALUE"
|
|
444
659
|
</div>
|
445
660
|
|
446
661
|
<div id="footer">
|
447
|
-
Generated on
|
662
|
+
Generated on Tue Mar 29 20:43:18 2016 by
|
448
663
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
449
|
-
0.8.7.
|
664
|
+
0.8.7.6 (ruby-2.3.0).
|
450
665
|
</div>
|
451
666
|
|
452
667
|
</body>
|
data/doc/Bovem/Console.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Bovem::Console
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '../';
|
20
|
-
framesUrl = "../frames.html#!"
|
20
|
+
framesUrl = "../frames.html#!Bovem/Console.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -91,7 +91,7 @@
|
|
91
91
|
|
92
92
|
|
93
93
|
<dt class="r2">Includes:</dt>
|
94
|
-
<dd class="r2"><span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Bovem::ConsoleMethods::Interactions</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Bovem::ConsoleMethods::Logging</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Bovem::ConsoleMethods::Output</a></span>, <span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">Bovem::ConsoleMethods::StyleHandling</a></span
|
94
|
+
<dd class="r2"><span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Bovem::ConsoleMethods::Interactions</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Bovem::ConsoleMethods::Logging</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Bovem::ConsoleMethods::Output</a></span>, <span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">Bovem::ConsoleMethods::StyleHandling</a></span></dd>
|
95
95
|
|
96
96
|
|
97
97
|
|
@@ -114,12 +114,49 @@
|
|
114
114
|
|
115
115
|
|
116
116
|
</div>
|
117
|
+
<h2>Constant Summary</h2>
|
118
|
+
|
119
|
+
|
117
120
|
|
118
121
|
|
122
|
+
<h2>Constant Summary</h2>
|
123
|
+
|
124
|
+
<h3 class="inherited">Constants included
|
125
|
+
from <span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Bovem::ConsoleMethods::Logging</a></span></h3>
|
126
|
+
<p class="inherited"><span class='object_link'><a href="ConsoleMethods/Logging.html#DEFAULT_STATUSES-constant" title="Bovem::ConsoleMethods::Logging::DEFAULT_STATUSES (constant)">Bovem::ConsoleMethods::Logging::DEFAULT_STATUSES</a></span></p>
|
127
|
+
|
119
128
|
|
120
129
|
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
121
130
|
<ul class="summary">
|
122
131
|
|
132
|
+
<li class="public ">
|
133
|
+
<span class="summary_signature">
|
134
|
+
|
135
|
+
<a href="#i18n-instance_method" title="#i18n (instance method)">- (I18n) <strong>i18n</strong> </a>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
</span>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="note title readonly">readonly</span>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<span class="summary_desc"><div class='inline'><p>A i18n helper.</p>
|
155
|
+
</div></span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
123
160
|
<li class="public ">
|
124
161
|
<span class="summary_signature">
|
125
162
|
|
@@ -315,7 +352,6 @@
|
|
315
352
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">Bovem::ConsoleMethods::StyleHandling</a></span></h3>
|
316
353
|
<p class="inherited"><span class='object_link'><a href="ConsoleMethods/StyleHandling.html#replace_markers-instance_method" title="Bovem::ConsoleMethods::StyleHandling#replace_markers (method)">#replace_markers</a></span></p>
|
317
354
|
|
318
|
-
|
319
355
|
<div id="constructor_details" class="method_details_list">
|
320
356
|
<h2>Constructor Details</h2>
|
321
357
|
|
@@ -344,19 +380,19 @@
|
|
344
380
|
<pre class="lines">
|
345
381
|
|
346
382
|
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
383
|
+
705
|
384
|
+
706
|
385
|
+
707
|
386
|
+
708
|
387
|
+
709</pre>
|
352
388
|
</td>
|
353
389
|
<td>
|
354
|
-
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line
|
390
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 705</span>
|
355
391
|
|
356
392
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
357
393
|
<span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
|
358
394
|
<span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
359
|
-
<span class='
|
395
|
+
<span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Application</span><span class='op'>::</span><span class='const'>LOCALE_ROOT</span><span class='rparen'>)</span>
|
360
396
|
<span class='kw'>end</span></pre>
|
361
397
|
</td>
|
362
398
|
</tr>
|
@@ -369,9 +405,128 @@
|
|
369
405
|
<h2>Instance Attribute Details</h2>
|
370
406
|
|
371
407
|
|
372
|
-
<span id="
|
408
|
+
<span id=""></span>
|
373
409
|
<div class="method_details first">
|
374
|
-
<h3 class="signature first" id="
|
410
|
+
<h3 class="signature first" id="i18n-instance_method">
|
411
|
+
|
412
|
+
- (<tt><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></tt>) <strong>i18n</strong> <span class="extras">(readonly)</span>
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
</h3><div class="docstring">
|
419
|
+
<div class="discussion">
|
420
|
+
<p>Returns A i18n helper.</p>
|
421
|
+
|
422
|
+
|
423
|
+
</div>
|
424
|
+
</div>
|
425
|
+
<div class="tags">
|
426
|
+
|
427
|
+
<p class="tag_title">Returns:</p>
|
428
|
+
<ul class="return">
|
429
|
+
|
430
|
+
<li>
|
431
|
+
|
432
|
+
|
433
|
+
<span class='type'>(<tt><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></tt>)</span>
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
—
|
438
|
+
<div class='inline'><p>A i18n helper.</p>
|
439
|
+
</div>
|
440
|
+
|
441
|
+
</li>
|
442
|
+
|
443
|
+
</ul>
|
444
|
+
|
445
|
+
</div><table class="source_code">
|
446
|
+
<tr>
|
447
|
+
<td>
|
448
|
+
<pre class="lines">
|
449
|
+
|
450
|
+
|
451
|
+
688
|
452
|
+
689
|
453
|
+
690
|
454
|
+
691
|
455
|
+
692
|
456
|
+
693
|
457
|
+
694
|
458
|
+
695
|
459
|
+
696
|
460
|
+
697
|
461
|
+
698
|
462
|
+
699
|
463
|
+
700
|
464
|
+
701
|
465
|
+
702
|
466
|
+
703
|
467
|
+
704
|
468
|
+
705
|
469
|
+
706
|
470
|
+
707
|
471
|
+
708
|
472
|
+
709
|
473
|
+
710
|
474
|
+
711
|
475
|
+
712
|
476
|
+
713
|
477
|
+
714
|
478
|
+
715
|
479
|
+
716
|
480
|
+
717
|
481
|
+
718
|
482
|
+
719
|
483
|
+
720</pre>
|
484
|
+
</td>
|
485
|
+
<td>
|
486
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 688</span>
|
487
|
+
|
488
|
+
<span class='kw'>class</span> <span class='const'>Console</span>
|
489
|
+
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span><span class='comma'>,</span> <span class='symbol'>:indentation_string</span>
|
490
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:i18n</span>
|
491
|
+
|
492
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>StyleHandling</span>
|
493
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>Output</span>
|
494
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>Logging</span>
|
495
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>Interactions</span>
|
496
|
+
|
497
|
+
<span class='comment'># Returns a unique instance for Console.
|
498
|
+
</span> <span class='comment'>#
|
499
|
+
</span> <span class='comment'># @return [Console] A new instance.
|
500
|
+
</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
|
501
|
+
<span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Console</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
502
|
+
<span class='kw'>end</span>
|
503
|
+
|
504
|
+
<span class='comment'># Initializes a new Console.
|
505
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
506
|
+
<span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
|
507
|
+
<span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
508
|
+
<span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Application</span><span class='op'>::</span><span class='const'>LOCALE_ROOT</span><span class='rparen'>)</span>
|
509
|
+
<span class='kw'>end</span>
|
510
|
+
|
511
|
+
<span class='comment'># Get the width of the terminal.
|
512
|
+
</span> <span class='comment'>#
|
513
|
+
</span> <span class='comment'># @return [Fixnum] The current width of the terminal. If not possible to retrieve the width, it returns `80.
|
514
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
|
515
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>io/console</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
|
516
|
+
<span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
517
|
+
<span class='kw'>rescue</span>
|
518
|
+
<span class='int'>80</span>
|
519
|
+
<span class='kw'>end</span>
|
520
|
+
<span class='kw'>end</span></pre>
|
521
|
+
</td>
|
522
|
+
</tr>
|
523
|
+
</table>
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
<span id="indentation=-instance_method"></span>
|
528
|
+
<div class="method_details ">
|
529
|
+
<h3 class="signature " id="indentation-instance_method">
|
375
530
|
|
376
531
|
- (<tt>Fixnum</tt>) <strong>indentation</strong>
|
377
532
|
|
@@ -412,51 +567,47 @@
|
|
412
567
|
<pre class="lines">
|
413
568
|
|
414
569
|
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
645
|
449
|
-
646
|
450
|
-
647</pre>
|
570
|
+
688
|
571
|
+
689
|
572
|
+
690
|
573
|
+
691
|
574
|
+
692
|
575
|
+
693
|
576
|
+
694
|
577
|
+
695
|
578
|
+
696
|
579
|
+
697
|
580
|
+
698
|
581
|
+
699
|
582
|
+
700
|
583
|
+
701
|
584
|
+
702
|
585
|
+
703
|
586
|
+
704
|
587
|
+
705
|
588
|
+
706
|
589
|
+
707
|
590
|
+
708
|
591
|
+
709
|
592
|
+
710
|
593
|
+
711
|
594
|
+
712
|
595
|
+
713
|
596
|
+
714
|
597
|
+
715
|
598
|
+
716
|
599
|
+
717
|
600
|
+
718
|
601
|
+
719
|
602
|
+
720</pre>
|
451
603
|
</td>
|
452
604
|
<td>
|
453
|
-
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line
|
605
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 688</span>
|
454
606
|
|
455
607
|
<span class='kw'>class</span> <span class='const'>Console</span>
|
456
|
-
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span>
|
457
|
-
<span class='id identifier
|
608
|
+
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span><span class='comma'>,</span> <span class='symbol'>:indentation_string</span>
|
609
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:i18n</span>
|
458
610
|
|
459
|
-
<span class='id identifier rubyid_include'>include</span> <span class='const'>Lazier</span><span class='op'>::</span><span class='const'>I18n</span>
|
460
611
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>StyleHandling</span>
|
461
612
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>Output</span>
|
462
613
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>Logging</span>
|
@@ -473,19 +624,17 @@
|
|
473
624
|
</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
474
625
|
<span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
|
475
626
|
<span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
476
|
-
<span class='
|
627
|
+
<span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Application</span><span class='op'>::</span><span class='const'>LOCALE_ROOT</span><span class='rparen'>)</span>
|
477
628
|
<span class='kw'>end</span>
|
478
629
|
|
479
630
|
<span class='comment'># Get the width of the terminal.
|
480
631
|
</span> <span class='comment'>#
|
481
632
|
</span> <span class='comment'># @return [Fixnum] The current width of the terminal. If not possible to retrieve the width, it returns `80.
|
482
633
|
</span> <span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
|
483
|
-
<span class='kw'>
|
484
|
-
|
485
|
-
|
486
|
-
<span class='
|
487
|
-
<span class='int'>80</span>
|
488
|
-
<span class='kw'>end</span>
|
634
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>io/console</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
|
635
|
+
<span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
636
|
+
<span class='kw'>rescue</span>
|
637
|
+
<span class='int'>80</span>
|
489
638
|
<span class='kw'>end</span>
|
490
639
|
<span class='kw'>end</span></pre>
|
491
640
|
</td>
|
@@ -537,51 +686,47 @@
|
|
537
686
|
<pre class="lines">
|
538
687
|
|
539
688
|
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
645
|
574
|
-
646
|
575
|
-
647</pre>
|
689
|
+
688
|
690
|
+
689
|
691
|
+
690
|
692
|
+
691
|
693
|
+
692
|
694
|
+
693
|
695
|
+
694
|
696
|
+
695
|
697
|
+
696
|
698
|
+
697
|
699
|
+
698
|
700
|
+
699
|
701
|
+
700
|
702
|
+
701
|
703
|
+
702
|
704
|
+
703
|
705
|
+
704
|
706
|
+
705
|
707
|
+
706
|
708
|
+
707
|
709
|
+
708
|
710
|
+
709
|
711
|
+
710
|
712
|
+
711
|
713
|
+
712
|
714
|
+
713
|
715
|
+
714
|
716
|
+
715
|
717
|
+
716
|
718
|
+
717
|
719
|
+
718
|
720
|
+
719
|
721
|
+
720</pre>
|
576
722
|
</td>
|
577
723
|
<td>
|
578
|
-
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line
|
724
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 688</span>
|
579
725
|
|
580
726
|
<span class='kw'>class</span> <span class='const'>Console</span>
|
581
|
-
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span>
|
582
|
-
<span class='id identifier
|
727
|
+
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span><span class='comma'>,</span> <span class='symbol'>:indentation_string</span>
|
728
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:i18n</span>
|
583
729
|
|
584
|
-
<span class='id identifier rubyid_include'>include</span> <span class='const'>Lazier</span><span class='op'>::</span><span class='const'>I18n</span>
|
585
730
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>StyleHandling</span>
|
586
731
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>Output</span>
|
587
732
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>ConsoleMethods</span><span class='op'>::</span><span class='const'>Logging</span>
|
@@ -598,19 +743,17 @@
|
|
598
743
|
</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
599
744
|
<span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
|
600
745
|
<span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
601
|
-
<span class='
|
746
|
+
<span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Application</span><span class='op'>::</span><span class='const'>LOCALE_ROOT</span><span class='rparen'>)</span>
|
602
747
|
<span class='kw'>end</span>
|
603
748
|
|
604
749
|
<span class='comment'># Get the width of the terminal.
|
605
750
|
</span> <span class='comment'>#
|
606
751
|
</span> <span class='comment'># @return [Fixnum] The current width of the terminal. If not possible to retrieve the width, it returns `80.
|
607
752
|
</span> <span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
|
608
|
-
<span class='kw'>
|
609
|
-
|
610
|
-
|
611
|
-
<span class='
|
612
|
-
<span class='int'>80</span>
|
613
|
-
<span class='kw'>end</span>
|
753
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>io/console</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
|
754
|
+
<span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
755
|
+
<span class='kw'>rescue</span>
|
756
|
+
<span class='int'>80</span>
|
614
757
|
<span class='kw'>end</span>
|
615
758
|
<span class='kw'>end</span></pre>
|
616
759
|
</td>
|
@@ -667,12 +810,12 @@
|
|
667
810
|
<pre class="lines">
|
668
811
|
|
669
812
|
|
670
|
-
|
671
|
-
|
672
|
-
|
813
|
+
700
|
814
|
+
701
|
815
|
+
702</pre>
|
673
816
|
</td>
|
674
817
|
<td>
|
675
|
-
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line
|
818
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 700</span>
|
676
819
|
|
677
820
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
|
678
821
|
<span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Console</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
@@ -730,25 +873,21 @@
|
|
730
873
|
<pre class="lines">
|
731
874
|
|
732
875
|
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
645
|
740
|
-
646</pre>
|
876
|
+
714
|
877
|
+
715
|
878
|
+
716
|
879
|
+
717
|
880
|
+
718
|
881
|
+
719</pre>
|
741
882
|
</td>
|
742
883
|
<td>
|
743
|
-
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line
|
884
|
+
<pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 714</span>
|
744
885
|
|
745
886
|
<span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
|
746
|
-
<span class='kw'>
|
747
|
-
|
748
|
-
|
749
|
-
<span class='
|
750
|
-
<span class='int'>80</span>
|
751
|
-
<span class='kw'>end</span>
|
887
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>io/console</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
|
888
|
+
<span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
889
|
+
<span class='kw'>rescue</span>
|
890
|
+
<span class='int'>80</span>
|
752
891
|
<span class='kw'>end</span></pre>
|
753
892
|
</td>
|
754
893
|
</tr>
|
@@ -760,9 +899,9 @@
|
|
760
899
|
</div>
|
761
900
|
|
762
901
|
<div id="footer">
|
763
|
-
Generated on
|
902
|
+
Generated on Tue Mar 29 20:43:17 2016 by
|
764
903
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
765
|
-
0.8.7.
|
904
|
+
0.8.7.6 (ruby-2.3.0).
|
766
905
|
</div>
|
767
906
|
|
768
907
|
</body>
|