action_command 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.byebug_history +5 -0
- data/.codeclimate.yml +1 -0
- data/.rubocop.yml +4 -0
- data/Gemfile.lock +33 -6
- data/README.md +62 -0
- data/action_command.gemspec +3 -0
- data/doc/ActionCommand/Executable.html +106 -19
- data/doc/ActionCommand/InputOutput.html +203 -70
- data/doc/ActionCommand/Result.html +938 -131
- data/doc/ActionCommand.html +405 -82
- data/doc/_index.html +45 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +61 -2
- data/doc/index.html +61 -2
- data/doc/method_list.html +224 -14
- data/doc/top-level-namespace.html +1 -1
- data/lib/action_command/executable.rb +6 -0
- data/lib/action_command/executable_transaction.rb +27 -0
- data/lib/action_command/input_output.rb +5 -0
- data/lib/action_command/log_parser.rb +105 -0
- data/lib/action_command/pretty_print_log_action.rb +114 -0
- data/lib/action_command/result.rb +106 -16
- data/lib/action_command/utils.rb +0 -5
- data/lib/action_command/version.rb +1 -1
- data/lib/action_command.rb +53 -6
- metadata +48 -2
@@ -254,6 +254,30 @@ can just access the hash you passed into the command as @params</p>
|
|
254
254
|
<p>Defines input for a command.</p>
|
255
255
|
</div></span>
|
256
256
|
|
257
|
+
</li>
|
258
|
+
|
259
|
+
|
260
|
+
<li class="public ">
|
261
|
+
<span class="summary_signature">
|
262
|
+
|
263
|
+
<a href="#input_count-instance_method" title="#input_count (instance method)">- (Object) <strong>input_count</strong> </a>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
</span>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
<span class="summary_desc"><div class='inline'>
|
278
|
+
<p>the number of input parameters for this command.</p>
|
279
|
+
</div></span>
|
280
|
+
|
257
281
|
</li>
|
258
282
|
|
259
283
|
|
@@ -298,7 +322,9 @@ can just access the hash you passed into the command as @params</p>
|
|
298
322
|
|
299
323
|
|
300
324
|
|
301
|
-
<span class="summary_desc"><div class='inline'
|
325
|
+
<span class="summary_desc"><div class='inline'>
|
326
|
+
<p>Defines output for a command.</p>
|
327
|
+
</div></span>
|
302
328
|
|
303
329
|
</li>
|
304
330
|
|
@@ -568,12 +594,12 @@ it, returning its result.</p>
|
|
568
594
|
<pre class="lines">
|
569
595
|
|
570
596
|
|
571
|
-
|
572
|
-
|
573
|
-
|
597
|
+
103
|
598
|
+
104
|
599
|
+
105</pre>
|
574
600
|
</td>
|
575
601
|
<td>
|
576
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
602
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 103</span>
|
577
603
|
|
578
604
|
<span class='kw'>def</span> <span class='id identifier rubyid_desc'>desc</span>
|
579
605
|
<span class='ivar'>@desc</span>
|
@@ -627,14 +653,14 @@ it, returning its result.</p>
|
|
627
653
|
<pre class="lines">
|
628
654
|
|
629
655
|
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
656
|
+
106
|
657
|
+
107
|
658
|
+
108
|
659
|
+
109
|
660
|
+
110</pre>
|
635
661
|
</td>
|
636
662
|
<td>
|
637
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
663
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 106</span>
|
638
664
|
|
639
665
|
<span class='kw'>def</span> <span class='id identifier rubyid_help?'>help?</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
640
666
|
<span class='id identifier rubyid_first_arg_sym'>first_arg_sym</span> <span class='op'>=</span> <span class='ivar'>@input</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='lbracket'>[</span><span class='symbol'>:symbol</span><span class='rbracket'>]</span>
|
@@ -727,12 +753,12 @@ href="help">your_task_name</a></p>
|
|
727
753
|
<pre class="lines">
|
728
754
|
|
729
755
|
|
730
|
-
|
731
|
-
|
732
|
-
|
756
|
+
125
|
757
|
+
126
|
758
|
+
127</pre>
|
733
759
|
</td>
|
734
760
|
<td>
|
735
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
761
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 125</span>
|
736
762
|
|
737
763
|
<span class='kw'>def</span> <span class='id identifier rubyid_input'>input</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='comma'>,</span> <span class='id identifier rubyid_desc'>desc</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span>
|
738
764
|
<span class='id identifier rubyid_insert_io'>insert_io</span><span class='lparen'>(</span><span class='ivar'>@input</span><span class='comma'>,</span> <span class='id identifier rubyid_sym'>sym</span><span class='comma'>,</span> <span class='id identifier rubyid_desc'>desc</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
@@ -740,6 +766,47 @@ href="help">your_task_name</a></p>
|
|
740
766
|
</td>
|
741
767
|
</tr>
|
742
768
|
</table>
|
769
|
+
</div>
|
770
|
+
|
771
|
+
<div class="method_details ">
|
772
|
+
<h3 class="signature " id="input_count-instance_method">
|
773
|
+
|
774
|
+
- (<tt>Object</tt>) <strong>input_count</strong>
|
775
|
+
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
|
780
|
+
</h3><div class="docstring">
|
781
|
+
<div class="discussion">
|
782
|
+
|
783
|
+
<p>the number of input parameters for this command.</p>
|
784
|
+
|
785
|
+
|
786
|
+
</div>
|
787
|
+
</div>
|
788
|
+
<div class="tags">
|
789
|
+
|
790
|
+
|
791
|
+
</div><table class="source_code">
|
792
|
+
<tr>
|
793
|
+
<td>
|
794
|
+
<pre class="lines">
|
795
|
+
|
796
|
+
|
797
|
+
25
|
798
|
+
26
|
799
|
+
27</pre>
|
800
|
+
</td>
|
801
|
+
<td>
|
802
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 25</span>
|
803
|
+
|
804
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_input_count'>input_count</span>
|
805
|
+
<span class='kw'>return</span> <span class='ivar'>@input</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
806
|
+
<span class='kw'>end</span></pre>
|
807
|
+
</td>
|
808
|
+
</tr>
|
809
|
+
</table>
|
743
810
|
</div>
|
744
811
|
|
745
812
|
<div class="method_details ">
|
@@ -786,12 +853,12 @@ href="help">your_task_name</a></p>
|
|
786
853
|
<pre class="lines">
|
787
854
|
|
788
855
|
|
789
|
-
|
790
|
-
|
791
|
-
|
856
|
+
139
|
857
|
+
140
|
858
|
+
141</pre>
|
792
859
|
</td>
|
793
860
|
<td>
|
794
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
861
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 139</span>
|
795
862
|
|
796
863
|
<span class='kw'>def</span> <span class='id identifier rubyid_keys'>keys</span>
|
797
864
|
<span class='ivar'>@input</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span><span class='lbracket'>[</span><span class='symbol'>:symbol</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
@@ -810,18 +877,84 @@ href="help">your_task_name</a></p>
|
|
810
877
|
|
811
878
|
|
812
879
|
|
813
|
-
</h3><
|
880
|
+
</h3><div class="docstring">
|
881
|
+
<div class="discussion">
|
882
|
+
|
883
|
+
<p>Defines output for a command</p>
|
884
|
+
|
885
|
+
|
886
|
+
</div>
|
887
|
+
</div>
|
888
|
+
<div class="tags">
|
889
|
+
<p class="tag_title">Parameters:</p>
|
890
|
+
<ul class="param">
|
891
|
+
|
892
|
+
<li>
|
893
|
+
|
894
|
+
<span class='name'>sym</span>
|
895
|
+
|
896
|
+
|
897
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
—
|
902
|
+
<div class='inline'>
|
903
|
+
<p>symbol identifying the parameter</p>
|
904
|
+
</div>
|
905
|
+
|
906
|
+
</li>
|
907
|
+
|
908
|
+
<li>
|
909
|
+
|
910
|
+
<span class='name'>desc</span>
|
911
|
+
|
912
|
+
|
913
|
+
<span class='type'>(<tt>String</tt>)</span>
|
914
|
+
|
915
|
+
|
916
|
+
|
917
|
+
—
|
918
|
+
<div class='inline'>
|
919
|
+
<p>description for use by internal developers, or on a rake task with rake <a
|
920
|
+
href="help">your_task_name</a></p>
|
921
|
+
</div>
|
922
|
+
|
923
|
+
</li>
|
924
|
+
|
925
|
+
<li>
|
926
|
+
|
927
|
+
<span class='name'>opts</span>
|
928
|
+
|
929
|
+
|
930
|
+
<span class='type'></span>
|
931
|
+
|
932
|
+
|
933
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
934
|
+
|
935
|
+
|
936
|
+
—
|
937
|
+
<div class='inline'>
|
938
|
+
<p>Optional arguments.</p>
|
939
|
+
</div>
|
940
|
+
|
941
|
+
</li>
|
942
|
+
|
943
|
+
</ul>
|
944
|
+
|
945
|
+
|
946
|
+
</div><table class="source_code">
|
814
947
|
<tr>
|
815
948
|
<td>
|
816
949
|
<pre class="lines">
|
817
950
|
|
818
951
|
|
819
|
-
|
820
|
-
|
821
|
-
|
952
|
+
134
|
953
|
+
135
|
954
|
+
136</pre>
|
822
955
|
</td>
|
823
956
|
<td>
|
824
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
957
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 134</span>
|
825
958
|
|
826
959
|
<span class='kw'>def</span> <span class='id identifier rubyid_output'>output</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='comma'>,</span> <span class='id identifier rubyid_desc'>desc</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
827
960
|
<span class='id identifier rubyid_insert_io'>insert_io</span><span class='lparen'>(</span><span class='ivar'>@output</span><span class='comma'>,</span> <span class='id identifier rubyid_sym'>sym</span><span class='comma'>,</span> <span class='id identifier rubyid_desc'>desc</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
@@ -857,16 +990,16 @@ href="help">your_task_name</a></p>
|
|
857
990
|
<pre class="lines">
|
858
991
|
|
859
992
|
|
860
|
-
89
|
861
|
-
90
|
862
|
-
91
|
863
|
-
92
|
864
|
-
93
|
865
993
|
94
|
866
|
-
95
|
994
|
+
95
|
995
|
+
96
|
996
|
+
97
|
997
|
+
98
|
998
|
+
99
|
999
|
+
100</pre>
|
867
1000
|
</td>
|
868
1001
|
<td>
|
869
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
1002
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 94</span>
|
870
1003
|
|
871
1004
|
<span class='kw'>def</span> <span class='id identifier rubyid_print_output'>print_output</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
|
872
1005
|
<span class='ivar'>@output</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_param'>param</span><span class='op'>|</span>
|
@@ -908,11 +1041,6 @@ missing</p>
|
|
908
1041
|
<pre class="lines">
|
909
1042
|
|
910
1043
|
|
911
|
-
50
|
912
|
-
51
|
913
|
-
52
|
914
|
-
53
|
915
|
-
54
|
916
1044
|
55
|
917
1045
|
56
|
918
1046
|
57
|
@@ -922,10 +1050,15 @@ missing</p>
|
|
922
1050
|
61
|
923
1051
|
62
|
924
1052
|
63
|
925
|
-
64
|
1053
|
+
64
|
1054
|
+
65
|
1055
|
+
66
|
1056
|
+
67
|
1057
|
+
68
|
1058
|
+
69</pre>
|
926
1059
|
</td>
|
927
1060
|
<td>
|
928
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
1061
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 55</span>
|
929
1062
|
|
930
1063
|
<span class='kw'>def</span> <span class='id identifier rubyid_process_input'>process_input</span><span class='lparen'>(</span><span class='id identifier rubyid_dest'>dest</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
931
1064
|
<span class='comment'># pass down predefined attributes.
|
@@ -973,20 +1106,20 @@ missing</p>
|
|
973
1106
|
<pre class="lines">
|
974
1107
|
|
975
1108
|
|
976
|
-
67
|
977
|
-
68
|
978
|
-
69
|
979
|
-
70
|
980
|
-
71
|
981
1109
|
72
|
982
1110
|
73
|
983
1111
|
74
|
984
1112
|
75
|
985
1113
|
76
|
986
|
-
77
|
1114
|
+
77
|
1115
|
+
78
|
1116
|
+
79
|
1117
|
+
80
|
1118
|
+
81
|
1119
|
+
82</pre>
|
987
1120
|
</td>
|
988
1121
|
<td>
|
989
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
1122
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 72</span>
|
990
1123
|
|
991
1124
|
<span class='kw'>def</span> <span class='id identifier rubyid_process_output'>process_output</span><span class='lparen'>(</span><span class='id identifier rubyid_dest'>dest</span><span class='comma'>,</span> <span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
|
992
1125
|
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_ok?'>ok?</span> <span class='op'>&&</span> <span class='id identifier rubyid_should_validate'>should_validate</span><span class='lparen'>(</span><span class='id identifier rubyid_dest'>dest</span><span class='rparen'>)</span>
|
@@ -1030,16 +1163,16 @@ missing</p>
|
|
1030
1163
|
<pre class="lines">
|
1031
1164
|
|
1032
1165
|
|
1033
|
-
80
|
1034
|
-
81
|
1035
|
-
82
|
1036
|
-
83
|
1037
|
-
84
|
1038
1166
|
85
|
1039
|
-
86
|
1167
|
+
86
|
1168
|
+
87
|
1169
|
+
88
|
1170
|
+
89
|
1171
|
+
90
|
1172
|
+
91</pre>
|
1040
1173
|
</td>
|
1041
1174
|
<td>
|
1042
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
1175
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 85</span>
|
1043
1176
|
|
1044
1177
|
<span class='kw'>def</span> <span class='id identifier rubyid_rake_input'>rake_input</span><span class='lparen'>(</span><span class='id identifier rubyid_rake_arg'>rake_arg</span><span class='rparen'>)</span>
|
1045
1178
|
<span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -1117,12 +1250,12 @@ missing</p>
|
|
1117
1250
|
<pre class="lines">
|
1118
1251
|
|
1119
1252
|
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1253
|
+
31
|
1254
|
+
32
|
1255
|
+
33</pre>
|
1123
1256
|
</td>
|
1124
1257
|
<td>
|
1125
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
1258
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 31</span>
|
1126
1259
|
|
1127
1260
|
<span class='kw'>def</span> <span class='id identifier rubyid_should_validate'>should_validate</span><span class='lparen'>(</span><span class='id identifier rubyid_dest'>dest</span><span class='rparen'>)</span>
|
1128
1261
|
<span class='kw'>return</span> <span class='id identifier rubyid_dest'>dest</span><span class='period'>.</span><span class='id identifier rubyid_test_context?'>test_context?</span>
|
@@ -1158,14 +1291,14 @@ missing</p>
|
|
1158
1291
|
<pre class="lines">
|
1159
1292
|
|
1160
1293
|
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1294
|
+
113
|
1295
|
+
114
|
1296
|
+
115
|
1297
|
+
116
|
1298
|
+
117</pre>
|
1166
1299
|
</td>
|
1167
1300
|
<td>
|
1168
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
1301
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 113</span>
|
1169
1302
|
|
1170
1303
|
<span class='kw'>def</span> <span class='id identifier rubyid_show_help'>show_help</span>
|
1171
1304
|
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='ivar'>@action</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_desc'>desc</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
@@ -1224,11 +1357,6 @@ description.</p>
|
|
1224
1357
|
<pre class="lines">
|
1225
1358
|
|
1226
1359
|
|
1227
|
-
32
|
1228
|
-
33
|
1229
|
-
34
|
1230
|
-
35
|
1231
|
-
36
|
1232
1360
|
37
|
1233
1361
|
38
|
1234
1362
|
39
|
@@ -1238,10 +1366,15 @@ description.</p>
|
|
1238
1366
|
43
|
1239
1367
|
44
|
1240
1368
|
45
|
1241
|
-
46
|
1369
|
+
46
|
1370
|
+
47
|
1371
|
+
48
|
1372
|
+
49
|
1373
|
+
50
|
1374
|
+
51</pre>
|
1242
1375
|
</td>
|
1243
1376
|
<td>
|
1244
|
-
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line
|
1377
|
+
<pre class="code"><span class="info file"># File 'lib/action_command/input_output.rb', line 37</span>
|
1245
1378
|
|
1246
1379
|
<span class='kw'>def</span> <span class='id identifier rubyid_validate_input'>validate_input</span><span class='lparen'>(</span><span class='id identifier rubyid_dest'>dest</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1247
1380
|
<span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>unless</span> <span class='id identifier rubyid_should_validate'>should_validate</span><span class='lparen'>(</span><span class='id identifier rubyid_dest'>dest</span><span class='rparen'>)</span>
|
@@ -1268,7 +1401,7 @@ description.</p>
|
|
1268
1401
|
</div>
|
1269
1402
|
|
1270
1403
|
<div id="footer">
|
1271
|
-
Generated on
|
1404
|
+
Generated on Mon Mar 7 14:27:17 2016 by
|
1272
1405
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1273
1406
|
0.8.7.6 (ruby-2.2.3).
|
1274
1407
|
</div>
|