como 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/Rakefile +30 -0
- data/doc/Como/ArgsParseState.html +50 -50
- data/doc/Como/ComoCommon.html +137 -10
- data/doc/Como/MainOpt.html +57 -129
- data/doc/Como/Opt/ErrorWithData.html +10 -10
- data/doc/Como/Opt/InvalidOption.html +1 -1
- data/doc/Como/Opt/MissingArgument.html +1 -1
- data/doc/Como/Opt.html +864 -819
- data/doc/Como/RuleCheck.html +86 -86
- data/doc/Como/RuleDisplay.html +89 -80
- data/doc/Como/Spec.html +297 -170
- data/doc/Como.html +283 -38
- data/doc/_index.html +1 -1
- data/doc/file.CHANGELOG.html +8 -2
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +183 -147
- data/doc/top-level-namespace.html +1 -1
- data/examples/como_simple +14 -0
- data/examples/como_subcmd +38 -0
- data/lib/como.rb +169 -76
- data/lib/version.rb +11 -0
- data/test/como_rule_1 +1 -1
- data/test/como_subcmd_rule +2 -2
- metadata +5 -2
data/doc/Como.html
CHANGED
@@ -79,7 +79,9 @@
|
|
79
79
|
|
80
80
|
|
81
81
|
<dt class="r1 last">Defined in:</dt>
|
82
|
-
<dd class="r1 last">lib/como.rb
|
82
|
+
<dd class="r1 last">lib/como.rb<span class="defines">,<br />
|
83
|
+
lib/version.rb</span>
|
84
|
+
</dd>
|
83
85
|
|
84
86
|
</dl>
|
85
87
|
<div class="clear"></div>
|
@@ -87,9 +89,9 @@
|
|
87
89
|
<h2>Overview</h2><div class="docstring">
|
88
90
|
<div class="discussion">
|
89
91
|
|
90
|
-
<
|
92
|
+
<p>Como</p>
|
91
93
|
|
92
|
-
<
|
94
|
+
<h1>Introduction</h1>
|
93
95
|
|
94
96
|
<p>Como provides low manifest command line option parsing and deployment. The
|
95
97
|
command line options are described in compact table format and option
|
@@ -98,18 +100,18 @@ usage information based on the option table (+ generic program info) and
|
|
98
100
|
displays it automatically if necessary. Como supports also subcommands and
|
99
101
|
checking for option combinations using a simple DSL.</p>
|
100
102
|
|
101
|
-
<
|
103
|
+
<h1>Usage Examples</h1>
|
102
104
|
|
103
105
|
<p>Two simple examples are presented in this section. First one includes a
|
104
106
|
straight forward command definition and the second is a bit more
|
105
107
|
complicated with subcommand feature in use.</p>
|
106
108
|
|
107
|
-
<
|
109
|
+
<h2>Simple example</h2>
|
108
110
|
|
109
111
|
<p>Below is a small example program ("como_simple") that demonstrates typical
|
110
112
|
usage.</p>
|
111
113
|
|
112
|
-
<
|
114
|
+
<h3>Program listing</h3>
|
113
115
|
|
114
116
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>como</span><span class='tstring_end'>"</span></span>
|
115
117
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Como</span>
|
@@ -178,7 +180,7 @@ replaced with "nil", the long option format is only available.</p>
|
|
178
180
|
("-h") option is given. Help option is added to the command automatically
|
179
181
|
as default behavior.</p>
|
180
182
|
|
181
|
-
<
|
183
|
+
<h3>Simple example executions</h3>
|
182
184
|
|
183
185
|
<p>Normal behavior would be achieved by executing:</p>
|
184
186
|
|
@@ -206,8 +208,7 @@ checked for existence and error is displayed if arguments are not given.</p>
|
|
206
208
|
|
207
209
|
<pre class="code ruby"><code class="ruby">como_simple error: Option "-f" missing for "como_simple"...
|
208
210
|
|
209
|
-
|
210
|
-
como_simple -f <file> [-d]
|
211
|
+
como_simple -f <file> [-d]
|
211
212
|
|
212
213
|
-f File argument.
|
213
214
|
-d Enable debugging.
|
@@ -224,19 +225,19 @@ string is taken from the option specification to "usage" display.</p>
|
|
224
225
|
|
225
226
|
<p>would display the same "usage" screen except without the error line.</p>
|
226
227
|
|
227
|
-
<
|
228
|
+
<h2>Subcommand example</h2>
|
228
229
|
|
229
230
|
<p>Subcmd example includes a program which has subcommands. Subcommands can
|
230
231
|
have their own command line switches and options.</p>
|
231
232
|
|
232
|
-
<
|
233
|
+
<h3>Program listing</h3>
|
233
234
|
|
234
235
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>como</span><span class='tstring_end'>"</span></span>
|
235
236
|
<span class='id identifier rubyid_include'>include</span> <span class='const'>Como</span>
|
236
237
|
|
237
238
|
<span class='const'>Spec</span><span class='period'>.</span><span class='id identifier rubyid_program'>program</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Programmer</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2013</span><span class='tstring_end'>"</span></span> <span class='rparen'>)</span> <span class='kw'>do</span>
|
238
239
|
|
239
|
-
<span class='id identifier
|
240
|
+
<span class='id identifier rubyid_command'>command</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>como_subcmd</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbracket'>[</span>
|
240
241
|
<span class='lbracket'>[</span> <span class='symbol'>:subcmd</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>add</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Add file.</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
241
242
|
<span class='lbracket'>[</span> <span class='symbol'>:subcmd</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>rm</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Remove file.</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
242
243
|
<span class='rbracket'>]</span><span class='comma'>,</span> <span class='rparen'>)</span>
|
@@ -248,7 +249,7 @@ have their own command line switches and options.</p>
|
|
248
249
|
<span class='lbracket'>[</span> <span class='symbol'>:single</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>file</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-f</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>File.</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
249
250
|
<span class='rbracket'>]</span> <span class='rparen'>)</span>
|
250
251
|
|
251
|
-
<span class='id identifier
|
252
|
+
<span class='id identifier rubyid_check'>check</span> <span class='kw'>do</span>
|
252
253
|
<span class='id identifier rubyid_one'>one</span><span class='lparen'>(</span>
|
253
254
|
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-fo</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
254
255
|
<span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>password</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>username</span><span class='tstring_end'>'</span></span> <span class='rparen'>)</span>
|
@@ -272,17 +273,18 @@ have their own command line switches and options.</p>
|
|
272
273
|
author and date are provided as parameters, and the program and subcommand
|
273
274
|
options are defined in block.</p>
|
274
275
|
|
275
|
-
<p>The first "subcmd" method call defines the main command
|
276
|
-
represents the program. It has two "subcmd" options
|
276
|
+
<p>The first "command" (or "subcmd") method call defines the main command
|
277
|
+
("Opt.main") which represents the program. It has two "subcmd" options
|
278
|
+
("add" and "rm").</p>
|
277
279
|
|
278
280
|
<p>The rest of the "subcmd" methods define subcommands for the parent command.
|
279
281
|
This example includes one subcommand level, but multiple levels are
|
280
282
|
allowed.</p>
|
281
283
|
|
282
|
-
<p>The "checkRule" method defines option combination
|
283
|
-
previous subcommand definition. In this case the
|
284
|
-
have either the "-fo" option defined or
|
285
|
-
combination.</p>
|
284
|
+
<p>The "check" (or "checkRule") method defines option combination
|
285
|
+
(<span class='object_link'><a href="Como/RuleCheck.html" title="Como::RuleCheck (class)">RuleCheck</a></span>) for the previous subcommand definition. In this case the
|
286
|
+
definition allows "add" to have either the "-fo" option defined or
|
287
|
+
"password" and "username" in combination.</p>
|
286
288
|
|
287
289
|
<p>Main (root) commands can be referenced through</p>
|
288
290
|
|
@@ -304,7 +306,7 @@ combination.</p>
|
|
304
306
|
<p>The given subcommand can be accessed with "givenSubcmd" method from each
|
305
307
|
parent command.</p>
|
306
308
|
|
307
|
-
<
|
309
|
+
<h3>Subcommand example executions</h3>
|
308
310
|
|
309
311
|
<p>Normal behavior would be achieved by executing:</p>
|
310
312
|
|
@@ -338,8 +340,8 @@ Thus executing:</p>
|
|
338
340
|
| | |--<password>
|
339
341
|
| | |--<username></code></pre>
|
340
342
|
|
341
|
-
<p>
|
342
|
-
"username"
|
343
|
+
<p>since the combination rule requires either "-fo", or both "password" and
|
344
|
+
"username".</p>
|
343
345
|
|
344
346
|
<p>Help is automatically provided on each command level, thus these are both
|
345
347
|
valid.</p>
|
@@ -350,9 +352,9 @@ valid.</p>
|
|
350
352
|
|
351
353
|
<pre class="code ruby"><code class="ruby">shell> como_subcmd rm -h</code></pre>
|
352
354
|
|
353
|
-
<
|
355
|
+
<h1>Option specification</h1>
|
354
356
|
|
355
|
-
<
|
357
|
+
<h2>Overview</h2>
|
356
358
|
|
357
359
|
<p>Option specification includes the minimum set of information required for
|
358
360
|
command line parsing. It is used to:</p>
|
@@ -370,7 +372,7 @@ command line parsing. It is used to:</p>
|
|
370
372
|
<p>Generate Usage Help printout.</p>
|
371
373
|
</li></ul>
|
372
374
|
|
373
|
-
<
|
375
|
+
<h2>Option types</h2>
|
374
376
|
|
375
377
|
<p>The following types can be defined for the command line options:</p>
|
376
378
|
<dl class="rdoc-list"><dt>:subcmd</dt>
|
@@ -428,7 +430,7 @@ can be used to terminate the argument list. For example:</p>
|
|
428
430
|
|
429
431
|
<pre class="code ruby"><code class="ruby">[ :silent, "terminator", "-", "The terminator." ],</code></pre>
|
430
432
|
|
431
|
-
<
|
433
|
+
<h2>Option specification method configuration</h2>
|
432
434
|
|
433
435
|
<p>Option behavior can be controlled with several configuration options.</p>
|
434
436
|
|
@@ -468,11 +470,14 @@ provided and it can be made also visible to user.</p>
|
|
468
470
|
</dd><dt>:help_exit</dt>
|
469
471
|
<dd>
|
470
472
|
<p>Exit program if help displayed (default: true).</p>
|
473
|
+
</dd><dt>:copyright</dt>
|
474
|
+
<dd>
|
475
|
+
<p>Display copyright/author in usage printout (default: true).</p>
|
471
476
|
</dd></dl>
|
472
477
|
|
473
|
-
<
|
478
|
+
<h1>Option referencing</h1>
|
474
479
|
|
475
|
-
<
|
480
|
+
<h2>Existence and values</h2>
|
476
481
|
|
477
482
|
<p>Opt class includes the parsed option values. All options can be tested
|
478
483
|
whether they are specified on the command line using:</p>
|
@@ -516,7 +521,7 @@ Thus</p>
|
|
516
521
|
|
517
522
|
<p>And finally decide what to do.</p>
|
518
523
|
|
519
|
-
<
|
524
|
+
<h2>Options including parameters</h2>
|
520
525
|
|
521
526
|
<p>Sometimes it is convenient for the program to use an option to include
|
522
527
|
multiple parameter settings. These settings can be parsed and mapped to a
|
@@ -533,7 +538,7 @@ example with option:</p>
|
|
533
538
|
|
534
539
|
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rounds</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='int'>10</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>length</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='int'>5</span> <span class='rbrace'>}</span></code></pre>
|
535
540
|
|
536
|
-
<
|
541
|
+
<h2>Subcommand options</h2>
|
537
542
|
|
538
543
|
<p>The given subcommand for the parent command is return by "givenSubcmd".
|
539
544
|
Commonly the program creator should just check directly which subcommand
|
@@ -542,12 +547,12 @@ has been selected and check for any subcommand options set. For example:</p>
|
|
542
547
|
<pre class="code ruby"><code class="ruby">if Opt['como_subcmd']['add'].given
|
543
548
|
...</code></pre>
|
544
549
|
|
545
|
-
<
|
550
|
+
<h2>Program external options</h2>
|
546
551
|
|
547
552
|
<p>If the user gives the "--" option (double-dash), the arguments after that
|
548
|
-
option
|
553
|
+
option are returned as an Array with "Opt.external".</p>
|
549
554
|
|
550
|
-
<
|
555
|
+
<h1>Option combination checks</h1>
|
551
556
|
|
552
557
|
<p>Como provides a facility to create relations between options using
|
553
558
|
RuleCheck DSL. This is needed since sometimes options have to be used in
|
@@ -583,11 +588,52 @@ exclusive.</p>
|
|
583
588
|
|
584
589
|
<p>Examples can be found above.</p>
|
585
590
|
|
586
|
-
<
|
591
|
+
<h1>Customization</h1>
|
592
|
+
|
593
|
+
<p>A user specific customization file can be referenced through the "COMO"
|
594
|
+
environment variable. If environment variable "COMO" is defined, the
|
595
|
+
referenced file is read in as Ruby file as a last phase when Como is loaded
|
596
|
+
from the program (require). Proposed naming convention for the
|
597
|
+
customization is:</p>
|
598
|
+
|
599
|
+
<pre class="code ruby"><code class="ruby">$HOME/.como</code></pre>
|
600
|
+
|
601
|
+
<p>User can define a pre and a post action hook in the file.</p>
|
602
|
+
|
603
|
+
<p>The pre-hook can be used for example to change the Como config defaults. It
|
604
|
+
is run before the body of "Spec.command" or "Spec.program" is executed. It
|
605
|
+
is passed all the parameters that has been passed to "Spec.command" or
|
606
|
+
"Spec.program", only collected into a Hash. The Hash keys are method
|
607
|
+
parameter names as symbols.</p>
|
608
|
+
|
609
|
+
<p>Example:</p>
|
610
|
+
|
611
|
+
<pre class="code ruby"><code class="ruby"><span class='comment'># Define pre parser hook for Como.
|
612
|
+
</span><span class='const'>Como</span><span class='period'>.</span><span class='id identifier rubyid_preHook'>preHook</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_args'>args</span><span class='op'>|</span>
|
613
|
+
|
614
|
+
<span class='comment'># Get default config for options.
|
615
|
+
</span> <span class='id identifier rubyid_config'>config</span> <span class='op'>=</span> <span class='const'>Como</span><span class='op'>::</span><span class='const'>Opt</span><span class='period'>.</span><span class='id identifier rubyid_configGet'>configGet</span>
|
616
|
+
|
617
|
+
<span class='comment'># Disable 'copyright' lines from usage.
|
618
|
+
</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span> <span class='symbol'>:copyright</span> <span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span>
|
619
|
+
|
620
|
+
<span class='comment'># Test if "Spec.command" is the entry method (it has arg named "prog").
|
621
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span> <span class='symbol'>:prog</span> <span class='rbracket'>]</span>
|
622
|
+
<span class='comment'># Place a custom header for all programs.
|
623
|
+
</span> <span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span> <span class='symbol'>:header</span> <span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\nProgram \"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span> <span class='symbol'>:prog</span> <span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>\" is ...\n\n</span><span class='tstring_end'>"</span></span>
|
624
|
+
<span class='kw'>end</span>
|
625
|
+
<span class='kw'>end</span></code></pre>
|
626
|
+
|
627
|
+
<p>There is no predefined use cases for post-hook. Post-hook is passed the
|
628
|
+
Opt.main as parameter.</p>
|
629
|
+
|
630
|
+
<p>If the provided customization facilities are not satisfactory, changes can
|
631
|
+
be implemented simply by overloading the existing functions. Some knowledge
|
632
|
+
of the internal workings of Como is required though.</p>
|
587
633
|
|
588
|
-
<p>
|
589
|
-
|
590
|
-
|
634
|
+
<p>Como version is returned with:</p>
|
635
|
+
|
636
|
+
<pre class="code ruby"><code class="ruby"><span class='const'>Como</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span></code></pre>
|
591
637
|
|
592
638
|
|
593
639
|
</div>
|
@@ -612,12 +658,211 @@ internal workings of Como is required though.</p>
|
|
612
658
|
|
613
659
|
|
614
660
|
|
661
|
+
|
662
|
+
<h2>
|
663
|
+
Class Method Summary
|
664
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
665
|
+
</h2>
|
666
|
+
|
667
|
+
<ul class="summary">
|
668
|
+
|
669
|
+
<li class="public ">
|
670
|
+
<span class="summary_signature">
|
671
|
+
|
672
|
+
<a href="#postHook-class_method" title="postHook (class method)">+ (Object) <strong>postHook</strong>(&code) </a>
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
</span>
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
|
615
684
|
|
685
|
+
|
686
|
+
<span class="summary_desc"><div class='inline'>
|
687
|
+
<p>Set "postHook" routine.</p>
|
688
|
+
</div></span>
|
689
|
+
|
690
|
+
</li>
|
691
|
+
|
692
|
+
|
693
|
+
<li class="public ">
|
694
|
+
<span class="summary_signature">
|
695
|
+
|
696
|
+
<a href="#preHook-class_method" title="preHook (class method)">+ (Object) <strong>preHook</strong>(&code) </a>
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
</span>
|
701
|
+
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
<span class="summary_desc"><div class='inline'>
|
711
|
+
<p>Set "preHook" routine.</p>
|
712
|
+
</div></span>
|
713
|
+
|
714
|
+
</li>
|
715
|
+
|
716
|
+
|
717
|
+
<li class="public ">
|
718
|
+
<span class="summary_signature">
|
719
|
+
|
720
|
+
<a href="#version-class_method" title="version (class method)">+ (Object) <strong>version</strong> </a>
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
</span>
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
735
|
+
|
736
|
+
</li>
|
737
|
+
|
738
|
+
|
739
|
+
</ul>
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
|
744
|
+
<div id="class_method_details" class="method_details_list">
|
745
|
+
<h2>Class Method Details</h2>
|
746
|
+
|
747
|
+
|
748
|
+
<div class="method_details first">
|
749
|
+
<h3 class="signature first" id="postHook-class_method">
|
750
|
+
|
751
|
+
+ (<tt>Object</tt>) <strong>postHook</strong>(&code)
|
752
|
+
|
753
|
+
|
754
|
+
|
755
|
+
|
756
|
+
|
757
|
+
</h3><div class="docstring">
|
758
|
+
<div class="discussion">
|
759
|
+
|
760
|
+
<p>Set "postHook" routine.</p>
|
761
|
+
|
762
|
+
|
763
|
+
</div>
|
764
|
+
</div>
|
765
|
+
<div class="tags">
|
766
|
+
|
767
|
+
|
768
|
+
</div><table class="source_code">
|
769
|
+
<tr>
|
770
|
+
<td>
|
771
|
+
<pre class="lines">
|
772
|
+
|
773
|
+
|
774
|
+
502
|
775
|
+
503
|
776
|
+
504</pre>
|
777
|
+
</td>
|
778
|
+
<td>
|
779
|
+
<pre class="code"><span class="info file"># File 'lib/como.rb', line 502</span>
|
780
|
+
|
781
|
+
<span class='kw'>def</span> <span class='const'>Como</span><span class='period'>.</span><span class='id identifier rubyid_postHook'>postHook</span><span class='lparen'>(</span> <span class='op'>&</span><span class='id identifier rubyid_code'>code</span> <span class='rparen'>)</span>
|
782
|
+
<span class='const'>ComoCommon</span><span class='period'>.</span><span class='id identifier rubyid_setHook'>setHook</span><span class='lparen'>(</span> <span class='symbol'>:postHook</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_code'>code</span> <span class='rparen'>)</span>
|
783
|
+
<span class='kw'>end</span></pre>
|
784
|
+
</td>
|
785
|
+
</tr>
|
786
|
+
</table>
|
787
|
+
</div>
|
788
|
+
|
789
|
+
<div class="method_details ">
|
790
|
+
<h3 class="signature " id="preHook-class_method">
|
791
|
+
|
792
|
+
+ (<tt>Object</tt>) <strong>preHook</strong>(&code)
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
|
797
|
+
|
798
|
+
</h3><div class="docstring">
|
799
|
+
<div class="discussion">
|
800
|
+
|
801
|
+
<p>Set "preHook" routine.</p>
|
802
|
+
|
803
|
+
|
804
|
+
</div>
|
805
|
+
</div>
|
806
|
+
<div class="tags">
|
807
|
+
|
808
|
+
|
809
|
+
</div><table class="source_code">
|
810
|
+
<tr>
|
811
|
+
<td>
|
812
|
+
<pre class="lines">
|
813
|
+
|
814
|
+
|
815
|
+
496
|
816
|
+
497
|
817
|
+
498</pre>
|
818
|
+
</td>
|
819
|
+
<td>
|
820
|
+
<pre class="code"><span class="info file"># File 'lib/como.rb', line 496</span>
|
821
|
+
|
822
|
+
<span class='kw'>def</span> <span class='const'>Como</span><span class='period'>.</span><span class='id identifier rubyid_preHook'>preHook</span><span class='lparen'>(</span> <span class='op'>&</span><span class='id identifier rubyid_code'>code</span> <span class='rparen'>)</span>
|
823
|
+
<span class='const'>ComoCommon</span><span class='period'>.</span><span class='id identifier rubyid_setHook'>setHook</span><span class='lparen'>(</span> <span class='symbol'>:preHook</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_code'>code</span> <span class='rparen'>)</span>
|
824
|
+
<span class='kw'>end</span></pre>
|
825
|
+
</td>
|
826
|
+
</tr>
|
827
|
+
</table>
|
828
|
+
</div>
|
829
|
+
|
830
|
+
<div class="method_details ">
|
831
|
+
<h3 class="signature " id="version-class_method">
|
832
|
+
|
833
|
+
+ (<tt>Object</tt>) <strong>version</strong>
|
834
|
+
|
835
|
+
|
836
|
+
|
837
|
+
|
838
|
+
|
839
|
+
</h3><table class="source_code">
|
840
|
+
<tr>
|
841
|
+
<td>
|
842
|
+
<pre class="lines">
|
843
|
+
|
844
|
+
|
845
|
+
3
|
846
|
+
4
|
847
|
+
5</pre>
|
848
|
+
</td>
|
849
|
+
<td>
|
850
|
+
<pre class="code"><span class="info file"># File 'lib/version.rb', line 3</span>
|
851
|
+
|
852
|
+
<span class='kw'>def</span> <span class='const'>Como</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span>
|
853
|
+
<span class='const'>ComoCommon</span><span class='op'>::</span><span class='const'>VERSION</span>
|
854
|
+
<span class='kw'>end</span></pre>
|
855
|
+
</td>
|
856
|
+
</tr>
|
857
|
+
</table>
|
858
|
+
</div>
|
859
|
+
|
860
|
+
</div>
|
616
861
|
|
617
862
|
</div>
|
618
863
|
|
619
864
|
<div id="footer">
|
620
|
-
Generated on Wed
|
865
|
+
Generated on Wed Jul 9 14:02:42 2014 by
|
621
866
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
622
867
|
0.8.6.1 (ruby-1.9.3).
|
623
868
|
</div>
|
data/doc/_index.html
CHANGED
@@ -233,7 +233,7 @@
|
|
233
233
|
</div>
|
234
234
|
|
235
235
|
<div id="footer">
|
236
|
-
Generated on Wed
|
236
|
+
Generated on Wed Jul 9 14:02:42 2014 by
|
237
237
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
238
238
|
0.8.6.1 (ruby-1.9.3).
|
239
239
|
</div>
|
data/doc/file.CHANGELOG.html
CHANGED
@@ -63,7 +63,13 @@
|
|
63
63
|
|
64
64
|
<div id="content"><div id='filecontents'>
|
65
65
|
<h1>Version history</h1>
|
66
|
-
<dl class="rdoc-list"><dt>0.1.
|
66
|
+
<dl class="rdoc-list"><dt>0.1.3</dt>
|
67
|
+
<dd>
|
68
|
+
<p>Customization through COMO env variable and hooks. Version information
|
69
|
+
returned programmatically with Como.version. "command" is aliased to
|
70
|
+
"subcmd" to enable highlighting of the main command. Aliases for
|
71
|
+
"Spec.checkRule" and "Spec#checkRule".</p>
|
72
|
+
</dd><dt>0.1.2</dt>
|
67
73
|
<dd>
|
68
74
|
<p>":check_invalid" applied correctly. Header and footer configs has to
|
69
75
|
include all newlines explicitly. ":error_exit" config removed (always exit
|
@@ -92,7 +98,7 @@ settings, i.e. the Opt#params method added.</p>
|
|
92
98
|
</div></div>
|
93
99
|
|
94
100
|
<div id="footer">
|
95
|
-
Generated on Wed
|
101
|
+
Generated on Wed Jul 9 14:02:42 2014 by
|
96
102
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
97
103
|
0.8.6.1 (ruby-1.9.3).
|
98
104
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -85,7 +85,7 @@ used.</p>
|
|
85
85
|
</div></div>
|
86
86
|
|
87
87
|
<div id="footer">
|
88
|
-
Generated on Wed
|
88
|
+
Generated on Wed Jul 9 14:02:42 2014 by
|
89
89
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
90
90
|
0.8.6.1 (ruby-1.9.3).
|
91
91
|
</div>
|
data/doc/index.html
CHANGED
@@ -85,7 +85,7 @@ used.</p>
|
|
85
85
|
</div></div>
|
86
86
|
|
87
87
|
<div id="footer">
|
88
|
-
Generated on Wed
|
88
|
+
Generated on Wed Jul 9 14:02:42 2014 by
|
89
89
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
90
90
|
0.8.6.1 (ruby-1.9.3).
|
91
91
|
</div>
|