bovem 3.0.5 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -3
  3. data/.rubocop.yml +82 -0
  4. data/.travis-gemfile +4 -5
  5. data/.travis.yml +8 -6
  6. data/CHANGELOG.md +12 -0
  7. data/Gemfile +9 -8
  8. data/README.md +1 -1
  9. data/Rakefile +22 -6
  10. data/bovem.gemspec +5 -5
  11. data/doc/Bovem.html +10 -10
  12. data/doc/Bovem/Application.html +670 -318
  13. data/doc/Bovem/Command.html +1447 -1125
  14. data/doc/Bovem/CommandMethods.html +4 -4
  15. data/doc/Bovem/CommandMethods/Children.html +173 -179
  16. data/doc/Bovem/CommandMethods/Help.html +9 -9
  17. data/doc/Bovem/Configuration.html +239 -24
  18. data/doc/Bovem/Console.html +267 -128
  19. data/doc/Bovem/ConsoleMethods.html +4 -4
  20. data/doc/Bovem/ConsoleMethods/Interactions.html +57 -70
  21. data/doc/Bovem/ConsoleMethods/Interactions/ClassMethods.html +9 -9
  22. data/doc/Bovem/ConsoleMethods/Logging.html +258 -298
  23. data/doc/Bovem/ConsoleMethods/Logging/ClassMethods.html +8 -8
  24. data/doc/Bovem/ConsoleMethods/Output.html +96 -118
  25. data/doc/Bovem/ConsoleMethods/StyleHandling.html +8 -8
  26. data/doc/Bovem/ConsoleMethods/StyleHandling/ClassMethods.html +26 -39
  27. data/doc/Bovem/Errors.html +4 -4
  28. data/doc/Bovem/Errors/Error.html +4 -4
  29. data/doc/Bovem/Errors/InvalidConfiguration.html +4 -4
  30. data/doc/Bovem/Errors/InvalidLogger.html +4 -4
  31. data/doc/Bovem/I18n.html +175 -0
  32. data/doc/Bovem/Logger.html +95 -83
  33. data/doc/Bovem/Option.html +669 -862
  34. data/doc/Bovem/Parser.html +10 -10
  35. data/doc/Bovem/ParserMethods.html +4 -4
  36. data/doc/Bovem/ParserMethods/General.html +4 -4
  37. data/doc/Bovem/ParserMethods/General/ClassMethods.html +26 -38
  38. data/doc/Bovem/Shell.html +169 -48
  39. data/doc/Bovem/ShellMethods.html +4 -4
  40. data/doc/Bovem/ShellMethods/Directories.html +46 -62
  41. data/doc/Bovem/ShellMethods/Execute.html +51 -99
  42. data/doc/Bovem/ShellMethods/General.html +4 -445
  43. data/doc/Bovem/ShellMethods/Read.html +56 -61
  44. data/doc/Bovem/ShellMethods/Write.html +22 -242
  45. data/doc/Bovem/Version.html +6 -6
  46. data/doc/_index.html +18 -18
  47. data/doc/class_list.html +6 -2
  48. data/doc/css/style.css +1 -0
  49. data/doc/file.README.html +5 -5
  50. data/doc/file_list.html +5 -1
  51. data/doc/frames.html +1 -1
  52. data/doc/index.html +5 -5
  53. data/doc/js/full_list.js +4 -1
  54. data/doc/method_list.html +161 -157
  55. data/doc/top-level-namespace.html +4 -4
  56. data/lib/bovem.rb +3 -4
  57. data/lib/bovem/application.rb +47 -39
  58. data/lib/bovem/command.rb +175 -193
  59. data/lib/bovem/configuration.rb +28 -29
  60. data/lib/bovem/console.rb +244 -171
  61. data/lib/bovem/errors.rb +1 -1
  62. data/lib/bovem/i18n.rb +18 -0
  63. data/lib/bovem/logger.rb +26 -26
  64. data/lib/bovem/option.rb +49 -58
  65. data/lib/bovem/parser.rb +174 -222
  66. data/lib/bovem/shell.rb +272 -320
  67. data/lib/bovem/version.rb +2 -2
  68. data/locales/en.yml +39 -38
  69. data/locales/it.yml +39 -38
  70. data/spec/bovem/application_spec.rb +6 -5
  71. data/spec/bovem/command_spec.rb +23 -23
  72. data/spec/bovem/console_spec.rb +101 -102
  73. data/spec/bovem/i18n_spec.rb +21 -0
  74. data/spec/bovem/logger_spec.rb +4 -4
  75. data/spec/bovem/option_spec.rb +43 -43
  76. data/spec/bovem/parser_spec.rb +13 -13
  77. data/spec/bovem/shell_spec.rb +106 -115
  78. data/spec/spec_helper.rb +19 -6
  79. metadata +14 -13
  80. data/doc/Bovem/Localizer.html +0 -376
  81. data/lib/bovem/localizer.rb +0 -27
  82. data/spec/coverage_helper.rb +0 -20
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Bovem::CommandMethods
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.3
9
+ &mdash; 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#!" + escape(window.location.href);
20
+ framesUrl = "../frames.html#!Bovem/CommandMethods.html";
21
21
  </script>
22
22
 
23
23
 
@@ -116,9 +116,9 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Sat Mar 8 10:27:42 2014 by
119
+ Generated on Tue Mar 29 20:43:16 2016 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
- 0.8.7.3 (ruby-2.1.0).
121
+ 0.8.7.6 (ruby-2.3.0).
122
122
  </div>
123
123
 
124
124
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Bovem::CommandMethods::Children
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.3
9
+ &mdash; 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#!" + escape(window.location.href);
20
+ framesUrl = "../../frames.html#!Bovem/CommandMethods/Children.html";
21
21
  </script>
22
22
 
23
23
 
@@ -292,7 +292,7 @@
292
292
  <li class="public ">
293
293
  <span class="summary_signature">
294
294
 
295
- <a href="#get_options-instance_method" title="#get_options (instance method)">- (HashWithIndifferentAccess) <strong>get_options</strong>(unprovided = false, application = &quot;application_&quot;, prefix = &quot;&quot;, *whitelist) </a>
295
+ <a href="#commands%3F-instance_method" title="#commands? (instance method)">- (Boolean) <strong>commands?</strong> </a>
296
296
 
297
297
 
298
298
 
@@ -306,7 +306,7 @@
306
306
 
307
307
 
308
308
 
309
- <span class="summary_desc"><div class='inline'><p>Get the list of the options of this command as an hash, where the keys are the options and the values are either the user inputs or the defaults values.</p>
309
+ <span class="summary_desc"><div class='inline'><p>Check if this command has subcommands.</p>
310
310
  </div></span>
311
311
 
312
312
  </li>
@@ -315,7 +315,7 @@
315
315
  <li class="public ">
316
316
  <span class="summary_signature">
317
317
 
318
- <a href="#has_commands%3F-instance_method" title="#has_commands? (instance method)">- (Boolean) <strong>has_commands?</strong> </a>
318
+ <a href="#get_options-instance_method" title="#get_options (instance method)">- (HashWithIndifferentAccess) <strong>get_options</strong>(unprovided: false, application: &quot;application_&quot;, prefix: &quot;&quot;, whitelist: []) </a>
319
319
 
320
320
 
321
321
 
@@ -329,7 +329,7 @@
329
329
 
330
330
 
331
331
 
332
- <span class="summary_desc"><div class='inline'><p>Check if this command has subcommands.</p>
332
+ <span class="summary_desc"><div class='inline'><p>Get the list of the options of this command as an hash, where the keys are the options and the values are either the user inputs or the defaults values.</p>
333
333
  </div></span>
334
334
 
335
335
  </li>
@@ -338,7 +338,7 @@
338
338
  <li class="public ">
339
339
  <span class="summary_signature">
340
340
 
341
- <a href="#has_options%3F-instance_method" title="#has_options? (instance method)">- (Boolean) <strong>has_options?</strong> </a>
341
+ <a href="#option-instance_method" title="#option (instance method)">- (Option) <strong>option</strong>(name, forms = [], options = {}, &amp;action) </a>
342
342
 
343
343
 
344
344
 
@@ -352,7 +352,7 @@
352
352
 
353
353
 
354
354
 
355
- <span class="summary_desc"><div class='inline'><p>Check if this command has options.</p>
355
+ <span class="summary_desc"><div class='inline'><p>Adds a new option to this command.</p>
356
356
  </div></span>
357
357
 
358
358
  </li>
@@ -361,7 +361,7 @@
361
361
  <li class="public ">
362
362
  <span class="summary_signature">
363
363
 
364
- <a href="#option-instance_method" title="#option (instance method)">- (Option) <strong>option</strong>(name, forms = [], options = {}, &amp;action) </a>
364
+ <a href="#options%3F-instance_method" title="#options? (instance method)">- (Boolean) <strong>options?</strong> </a>
365
365
 
366
366
 
367
367
 
@@ -375,7 +375,7 @@
375
375
 
376
376
 
377
377
 
378
- <span class="summary_desc"><div class='inline'><p>Adds a new option to this command.</p>
378
+ <span class="summary_desc"><div class='inline'><p>Check if this command has options.</p>
379
379
  </div></span>
380
380
 
381
381
  </li>
@@ -432,12 +432,12 @@
432
432
  <pre class="lines">
433
433
 
434
434
 
435
- 181
436
- 182
437
- 183</pre>
435
+ 176
436
+ 177
437
+ 178</pre>
438
438
  </td>
439
439
  <td>
440
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 181</span>
440
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 176</span>
441
441
 
442
442
  <span class='kw'>def</span> <span class='id identifier rubyid_commands'>commands</span>
443
443
  <span class='ivar'>@commands</span>
@@ -491,12 +491,12 @@
491
491
  <pre class="lines">
492
492
 
493
493
 
494
- 202
495
- 203
496
- 204</pre>
494
+ 197
495
+ 198
496
+ 199</pre>
497
497
  </td>
498
498
  <td>
499
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 202</span>
499
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 197</span>
500
500
 
501
501
  <span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
502
502
  <span class='ivar'>@options</span>
@@ -557,13 +557,13 @@
557
557
  <pre class="lines">
558
558
 
559
559
 
560
- 222
561
- 223
562
- 224
563
- 225</pre>
560
+ 217
561
+ 218
562
+ 219
563
+ 220</pre>
564
564
  </td>
565
565
  <td>
566
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 222</span>
566
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 217</span>
567
567
 
568
568
  <span class='kw'>def</span> <span class='id identifier rubyid_argument'>argument</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
569
569
  <span class='ivar'>@args</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -616,12 +616,12 @@
616
616
  <pre class="lines">
617
617
 
618
618
 
619
- 230
620
- 231
621
- 232</pre>
619
+ 225
620
+ 226
621
+ 227</pre>
622
622
  </td>
623
623
  <td>
624
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 230</span>
624
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 225</span>
625
625
 
626
626
  <span class='kw'>def</span> <span class='id identifier rubyid_arguments'>arguments</span>
627
627
  <span class='ivar'>@args</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -673,12 +673,12 @@
673
673
  <pre class="lines">
674
674
 
675
675
 
676
- 188
677
- 189
678
- 190</pre>
676
+ 183
677
+ 184
678
+ 185</pre>
679
679
  </td>
680
680
  <td>
681
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 188</span>
681
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 183</span>
682
682
 
683
683
  <span class='kw'>def</span> <span class='id identifier rubyid_clear_commands'>clear_commands</span>
684
684
  <span class='ivar'>@commands</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
@@ -730,12 +730,12 @@
730
730
  <pre class="lines">
731
731
 
732
732
 
733
- 208
734
- 209
735
- 210</pre>
733
+ 203
734
+ 204
735
+ 205</pre>
736
736
  </td>
737
737
  <td>
738
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 208</span>
738
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 203</span>
739
739
 
740
740
  <span class='kw'>def</span> <span class='id identifier rubyid_clear_options'>clear_options</span>
741
741
  <span class='ivar'>@options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
@@ -836,17 +836,17 @@
836
836
  <pre class="lines">
837
837
 
838
838
 
839
+ 141
839
840
  142
840
841
  143
841
842
  144
842
843
  145
843
844
  146
844
845
  147
845
- 148
846
- 149</pre>
846
+ 148</pre>
847
847
  </td>
848
848
  <td>
849
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 142</span>
849
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 141</span>
850
850
 
851
851
  <span class='kw'>def</span> <span class='id identifier rubyid_command'>command</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
852
852
  <span class='ivar'>@commands</span> <span class='op'>||=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
@@ -859,12 +859,69 @@
859
859
  </td>
860
860
  </tr>
861
861
  </table>
862
+ </div>
863
+
864
+ <div class="method_details ">
865
+ <h3 class="signature " id="commands?-instance_method">
866
+
867
+ - (<tt>Boolean</tt>) <strong>commands?</strong>
868
+
869
+
870
+
871
+
872
+
873
+ </h3><div class="docstring">
874
+ <div class="discussion">
875
+ <p>Check if this command has subcommands.</p>
876
+
877
+
878
+ </div>
879
+ </div>
880
+ <div class="tags">
881
+
882
+ <p class="tag_title">Returns:</p>
883
+ <ul class="return">
884
+
885
+ <li>
886
+
887
+
888
+ <span class='type'>(<tt>Boolean</tt>)</span>
889
+
890
+
891
+
892
+ &mdash;
893
+ <div class='inline'><p><code>true</code> if this command has subcommands, <code>false</code> otherwise.</p>
894
+ </div>
895
+
896
+ </li>
897
+
898
+ </ul>
899
+
900
+ </div><table class="source_code">
901
+ <tr>
902
+ <td>
903
+ <pre class="lines">
904
+
905
+
906
+ 190
907
+ 191
908
+ 192</pre>
909
+ </td>
910
+ <td>
911
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 190</span>
912
+
913
+ <span class='kw'>def</span> <span class='id identifier rubyid_commands?'>commands?</span>
914
+ <span class='op'>!</span><span class='id identifier rubyid_commands'>commands</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
915
+ <span class='kw'>end</span></pre>
916
+ </td>
917
+ </tr>
918
+ </table>
862
919
  </div>
863
920
 
864
921
  <div class="method_details ">
865
922
  <h3 class="signature " id="get_options-instance_method">
866
923
 
867
- - (<tt>HashWithIndifferentAccess</tt>) <strong>get_options</strong>(unprovided = false, application = &quot;application_&quot;, prefix = &quot;&quot;, *whitelist)
924
+ - (<tt>HashWithIndifferentAccess</tt>) <strong>get_options</strong>(unprovided: false, application: &quot;application_&quot;, prefix: &quot;&quot;, whitelist: [])
868
925
 
869
926
 
870
927
 
@@ -892,8 +949,6 @@ the user inputs or the defaults values.</p>
892
949
  <span class='type'>(<tt>Boolean</tt>)</span>
893
950
 
894
951
 
895
- <em class="default">(defaults to: <tt>false</tt>)</em>
896
-
897
952
 
898
953
  &mdash;
899
954
  <div class='inline'><p>If to include also options that were not provided by the user and that don’t have any default value.</p>
@@ -909,8 +964,6 @@ the user inputs or the defaults values.</p>
909
964
  <span class='type'>(<tt>String</tt>)</span>
910
965
 
911
966
 
912
- <em class="default">(defaults to: <tt>&quot;application_&quot;</tt>)</em>
913
-
914
967
 
915
968
  &mdash;
916
969
  <div class='inline'><p>The prefix to use for including application’s options. If falsy, only current command options will be included.</p>
@@ -926,8 +979,6 @@ the user inputs or the defaults values.</p>
926
979
  <span class='type'>(<tt>String</tt>)</span>
927
980
 
928
981
 
929
- <em class="default">(defaults to: <tt>&quot;&quot;</tt>)</em>
930
-
931
982
 
932
983
  &mdash;
933
984
  <div class='inline'><p>The prefix to add to the option of this command.</p>
@@ -976,135 +1027,29 @@ the user inputs or the defaults values.</p>
976
1027
  <pre class="lines">
977
1028
 
978
1029
 
1030
+ 239
1031
+ 240
1032
+ 241
1033
+ 242
1034
+ 243
979
1035
  244
980
1036
  245
981
1037
  246
982
1038
  247
983
- 248
984
- 249</pre>
1039
+ 248</pre>
985
1040
  </td>
986
1041
  <td>
987
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 244</span>
1042
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 239</span>
988
1043
 
989
- <span class='kw'>def</span> <span class='id identifier rubyid_get_options'>get_options</span><span class='lparen'>(</span><span class='id identifier rubyid_unprovided'>unprovided</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_application'>application</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application_</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_prefix'>prefix</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_whitelist'>whitelist</span><span class='rparen'>)</span>
1044
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_options'>get_options</span><span class='lparen'>(</span><span class='label'>unprovided:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>application:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application_</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>prefix:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>whitelist:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
990
1045
  <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
991
- <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_get_options'>get_options</span><span class='lparen'>(</span><span class='id identifier rubyid_unprovided'>unprovided</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_application'>application</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_whitelist'>whitelist</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_application'>application</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_is_application?'>is_application?</span>
992
- <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_get_current_options'>get_current_options</span><span class='lparen'>(</span><span class='id identifier rubyid_unprovided'>unprovided</span><span class='comma'>,</span> <span class='id identifier rubyid_prefix'>prefix</span><span class='comma'>,</span> <span class='id identifier rubyid_whitelist'>whitelist</span><span class='rparen'>)</span><span class='rparen'>)</span>
993
- <span class='id identifier rubyid_rv'>rv</span>
994
- <span class='kw'>end</span></pre>
995
- </td>
996
- </tr>
997
- </table>
998
- </div>
999
-
1000
- <div class="method_details ">
1001
- <h3 class="signature " id="has_commands?-instance_method">
1002
-
1003
- - (<tt>Boolean</tt>) <strong>has_commands?</strong>
1004
-
1005
-
1006
-
1007
-
1008
-
1009
- </h3><div class="docstring">
1010
- <div class="discussion">
1011
- <p>Check if this command has subcommands.</p>
1012
-
1013
-
1014
- </div>
1015
- </div>
1016
- <div class="tags">
1017
-
1018
- <p class="tag_title">Returns:</p>
1019
- <ul class="return">
1020
-
1021
- <li>
1022
-
1023
-
1024
- <span class='type'>(<tt>Boolean</tt>)</span>
1025
-
1026
-
1027
-
1028
- &mdash;
1029
- <div class='inline'><p><code>true</code> if this command has subcommands, <code>false</code> otherwise.</p>
1030
- </div>
1031
-
1032
- </li>
1033
-
1034
- </ul>
1035
-
1036
- </div><table class="source_code">
1037
- <tr>
1038
- <td>
1039
- <pre class="lines">
1040
-
1041
-
1042
- 195
1043
- 196
1044
- 197</pre>
1045
- </td>
1046
- <td>
1047
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 195</span>
1048
-
1049
- <span class='kw'>def</span> <span class='id identifier rubyid_has_commands?'>has_commands?</span>
1050
- <span class='id identifier rubyid_commands'>commands</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>0</span>
1051
- <span class='kw'>end</span></pre>
1052
- </td>
1053
- </tr>
1054
- </table>
1055
- </div>
1056
-
1057
- <div class="method_details ">
1058
- <h3 class="signature " id="has_options?-instance_method">
1059
-
1060
- - (<tt>Boolean</tt>) <strong>has_options?</strong>
1061
-
1062
-
1063
-
1064
-
1065
-
1066
- </h3><div class="docstring">
1067
- <div class="discussion">
1068
- <p>Check if this command has options.</p>
1069
-
1070
-
1071
- </div>
1072
- </div>
1073
- <div class="tags">
1074
-
1075
- <p class="tag_title">Returns:</p>
1076
- <ul class="return">
1077
-
1078
- <li>
1079
-
1080
-
1081
- <span class='type'>(<tt>Boolean</tt>)</span>
1082
-
1083
-
1084
-
1085
- &mdash;
1086
- <div class='inline'><p><code>true</code> if this command has options, <code>false</code> otherwise.</p>
1087
- </div>
1088
-
1089
- </li>
1090
-
1091
- </ul>
1092
1046
 
1093
- </div><table class="source_code">
1094
- <tr>
1095
- <td>
1096
- <pre class="lines">
1097
-
1098
-
1099
- 215
1100
- 216
1101
- 217</pre>
1102
- </td>
1103
- <td>
1104
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 215</span>
1047
+ <span class='kw'>if</span> <span class='id identifier rubyid_application'>application</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_application?'>application?</span>
1048
+ <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_get_options'>get_options</span><span class='lparen'>(</span><span class='label'>unprovided:</span> <span class='id identifier rubyid_unprovided'>unprovided</span><span class='comma'>,</span> <span class='label'>application:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>prefix:</span> <span class='id identifier rubyid_application'>application</span><span class='comma'>,</span> <span class='label'>whitelist:</span> <span class='id identifier rubyid_whitelist'>whitelist</span><span class='rparen'>)</span><span class='rparen'>)</span>
1049
+ <span class='kw'>end</span>
1105
1050
 
1106
- <span class='kw'>def</span> <span class='id identifier rubyid_has_options?'>has_options?</span>
1107
- <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>0</span>
1051
+ <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_get_current_options'>get_current_options</span><span class='lparen'>(</span><span class='id identifier rubyid_unprovided'>unprovided</span><span class='comma'>,</span> <span class='id identifier rubyid_prefix'>prefix</span><span class='comma'>,</span> <span class='id identifier rubyid_whitelist'>whitelist</span><span class='rparen'>)</span><span class='rparen'>)</span>
1052
+ <span class='id identifier rubyid_rv'>rv</span>
1108
1053
  <span class='kw'>end</span></pre>
1109
1054
  </td>
1110
1055
  </tr>
@@ -1228,6 +1173,7 @@ the user inputs or the defaults values.</p>
1228
1173
  <pre class="lines">
1229
1174
 
1230
1175
 
1176
+ 159
1231
1177
  160
1232
1178
  161
1233
1179
  162
@@ -1239,26 +1185,17 @@ the user inputs or the defaults values.</p>
1239
1185
  168
1240
1186
  169
1241
1187
  170
1242
- 171
1243
- 172
1244
- 173
1245
- 174
1246
- 175
1247
- 176</pre>
1188
+ 171</pre>
1248
1189
  </td>
1249
1190
  <td>
1250
- <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 160</span>
1191
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 159</span>
1251
1192
 
1252
1193
  <span class='kw'>def</span> <span class='id identifier rubyid_option'>option</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_forms'>forms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_action'>action</span><span class='rparen'>)</span>
1253
1194
  <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
1254
1195
  <span class='ivar'>@options</span> <span class='op'>||=</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1255
1196
 
1256
- <span class='kw'>if</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='kw'>then</span>
1257
- <span class='kw'>if</span> <span class='id identifier rubyid_is_application?'>is_application?</span> <span class='kw'>then</span>
1258
- <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'>Error</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='symbol'>:duplicate_option</span><span class='comma'>,</span> <span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_existing_option_global'>existing_option_global</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='rparen'>)</span>
1259
- <span class='kw'>else</span>
1260
- <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'>Error</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='symbol'>:duplicate_option</span><span class='comma'>,</span> <span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_existing_option'>existing_option</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_full_name'>full_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
1261
- <span class='kw'>end</span>
1197
+ <span class='kw'>if</span> <span class='ivar'>@options</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
1198
+ <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'>Error</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='symbol'>:duplicate_option</span><span class='comma'>,</span> <span class='id identifier rubyid_application?'>application?</span> <span class='op'>?</span> <span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_existing_option_global'>existing_option_global</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_existing_option'>existing_option</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_full_name'>full_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
1262
1199
  <span class='kw'>end</span>
1263
1200
 
1264
1201
  <span class='id identifier rubyid_option'>option</span> <span class='op'>=</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Option</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_forms'>forms</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_action'>action</span><span class='rparen'>)</span>
@@ -1269,6 +1206,63 @@ the user inputs or the defaults values.</p>
1269
1206
  </td>
1270
1207
  </tr>
1271
1208
  </table>
1209
+ </div>
1210
+
1211
+ <div class="method_details ">
1212
+ <h3 class="signature " id="options?-instance_method">
1213
+
1214
+ - (<tt>Boolean</tt>) <strong>options?</strong>
1215
+
1216
+
1217
+
1218
+
1219
+
1220
+ </h3><div class="docstring">
1221
+ <div class="discussion">
1222
+ <p>Check if this command has options.</p>
1223
+
1224
+
1225
+ </div>
1226
+ </div>
1227
+ <div class="tags">
1228
+
1229
+ <p class="tag_title">Returns:</p>
1230
+ <ul class="return">
1231
+
1232
+ <li>
1233
+
1234
+
1235
+ <span class='type'>(<tt>Boolean</tt>)</span>
1236
+
1237
+
1238
+
1239
+ &mdash;
1240
+ <div class='inline'><p><code>true</code> if this command has options, <code>false</code> otherwise.</p>
1241
+ </div>
1242
+
1243
+ </li>
1244
+
1245
+ </ul>
1246
+
1247
+ </div><table class="source_code">
1248
+ <tr>
1249
+ <td>
1250
+ <pre class="lines">
1251
+
1252
+
1253
+ 210
1254
+ 211
1255
+ 212</pre>
1256
+ </td>
1257
+ <td>
1258
+ <pre class="code"><span class="info file"># File 'lib/bovem/command.rb', line 210</span>
1259
+
1260
+ <span class='kw'>def</span> <span class='id identifier rubyid_options?'>options?</span>
1261
+ <span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
1262
+ <span class='kw'>end</span></pre>
1263
+ </td>
1264
+ </tr>
1265
+ </table>
1272
1266
  </div>
1273
1267
 
1274
1268
  </div>
@@ -1276,9 +1270,9 @@ the user inputs or the defaults values.</p>
1276
1270
  </div>
1277
1271
 
1278
1272
  <div id="footer">
1279
- Generated on Sat Mar 8 10:27:42 2014 by
1273
+ Generated on Tue Mar 29 20:43:16 2016 by
1280
1274
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1281
- 0.8.7.3 (ruby-2.1.0).
1275
+ 0.8.7.6 (ruby-2.3.0).
1282
1276
  </div>
1283
1277
 
1284
1278
  </body>