caliph 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Caliph/CommandChain.html +532 -0
- data/doc/Caliph/CommandLine.html +2541 -0
- data/doc/Caliph/CommandLineDSL.html +230 -0
- data/doc/Caliph/CommandLineExampleGroup/MockingExecute.html +174 -0
- data/doc/Caliph/CommandLineExampleGroup.html +366 -0
- data/doc/Caliph/CommandRunResult.html +1124 -0
- data/doc/Caliph/DefineOp/ClassMethods.html +250 -0
- data/doc/Caliph/DefineOp.html +188 -0
- data/doc/Caliph/MockCommandResult.html +465 -0
- data/doc/Caliph/PipelineChain.html +242 -0
- data/doc/Caliph/PrereqChain.html +242 -0
- data/doc/Caliph/ShellEscaped.html +445 -0
- data/doc/Caliph/WrappingChain.html +242 -0
- data/doc/Caliph.html +119 -0
- data/doc/_index.html +241 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +235 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +235 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +503 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/caliph/command-chain.rb +4 -1
- data/lib/caliph/command-line.rb +24 -81
- data/lib/caliph/command-run-result.rb +48 -7
- data/lib/caliph/shell.rb +172 -0
- data/lib/caliph.rb +9 -0
- data/spec/command-line-dsl.rb +15 -15
- data/spec/command-line.rb +16 -18
- data/spec_help/spec_helper.rb +9 -3
- metadata +63 -6
@@ -0,0 +1,366 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Caliph::CommandLineExampleGroup
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!Caliph/CommandLineExampleGroup.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Caliph.html" title="Caliph (module)">Caliph</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">CommandLineExampleGroup</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Caliph::CommandLineExampleGroup
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<dt class="r1">Includes:</dt>
|
79
|
+
<dd class="r1"><span class='object_link'><a href="CommandLineDSL.html" title="Caliph::CommandLineDSL (module)">CommandLineDSL</a></span></dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<dt class="r2 last">Defined in:</dt>
|
86
|
+
<dd class="r2 last">lib/caliph/testing/mock-command-line.rb</dd>
|
87
|
+
|
88
|
+
</dl>
|
89
|
+
<div class="clear"></div>
|
90
|
+
|
91
|
+
<h2>Defined Under Namespace</h2>
|
92
|
+
<p class="children">
|
93
|
+
|
94
|
+
|
95
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="CommandLineExampleGroup/MockingExecute.html" title="Caliph::CommandLineExampleGroup::MockingExecute (module)">MockingExecute</a></span>
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
</p>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Class Method Summary
|
111
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#included-class_method" title="included (class method)">+ (Object) <strong>included</strong>(group) </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
134
|
+
|
135
|
+
</li>
|
136
|
+
|
137
|
+
|
138
|
+
</ul>
|
139
|
+
|
140
|
+
<h2>
|
141
|
+
Instance Method Summary
|
142
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
143
|
+
</h2>
|
144
|
+
|
145
|
+
<ul class="summary">
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#expect_command-instance_method" title="#expect_command (instance method)">- (Object) <strong>expect_command</strong>(cmd, *result) </a>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</span>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
<span class="summary_desc"><div class='inline'>
|
165
|
+
<p>Registers an expectation about a command being run - expectations are
|
166
|
+
ordered.</p>
|
167
|
+
</div></span>
|
168
|
+
|
169
|
+
</li>
|
170
|
+
|
171
|
+
|
172
|
+
<li class="public ">
|
173
|
+
<span class="summary_signature">
|
174
|
+
|
175
|
+
<a href="#expect_some_commands-instance_method" title="#expect_some_commands (instance method)">- (Object) <strong>expect_some_commands</strong> </a>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</span>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<span class="summary_desc"><div class='inline'>
|
190
|
+
<p>Registers indifference as to exactly what commands get called.</p>
|
191
|
+
</div></span>
|
192
|
+
|
193
|
+
</li>
|
194
|
+
|
195
|
+
|
196
|
+
</ul>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="CommandLineDSL.html" title="Caliph::CommandLineDSL (module)">CommandLineDSL</a></span></h3>
|
209
|
+
<p class="inherited"><span class='object_link'><a href="CommandLineDSL.html#cmd-instance_method" title="Caliph::CommandLineDSL#cmd (method)">#cmd</a></span>, <span class='object_link'><a href="CommandLineDSL.html#escaped_command-instance_method" title="Caliph::CommandLineDSL#escaped_command (method)">#escaped_command</a></span></p>
|
210
|
+
|
211
|
+
|
212
|
+
<div id="class_method_details" class="method_details_list">
|
213
|
+
<h2>Class Method Details</h2>
|
214
|
+
|
215
|
+
|
216
|
+
<div class="method_details first">
|
217
|
+
<h3 class="signature first" id="included-class_method">
|
218
|
+
|
219
|
+
+ (<tt>Object</tt>) <strong>included</strong>(group)
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</h3><table class="source_code">
|
226
|
+
<tr>
|
227
|
+
<td>
|
228
|
+
<pre class="lines">
|
229
|
+
|
230
|
+
|
231
|
+
42
|
232
|
+
43
|
233
|
+
44
|
234
|
+
45
|
235
|
+
46
|
236
|
+
47
|
237
|
+
48
|
238
|
+
49
|
239
|
+
50
|
240
|
+
51
|
241
|
+
52
|
242
|
+
53
|
243
|
+
54</pre>
|
244
|
+
</td>
|
245
|
+
<td>
|
246
|
+
<pre class="code"><span class="info file"># File 'lib/caliph/testing/mock-command-line.rb', line 42</span>
|
247
|
+
|
248
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_group'>group</span><span class='rparen'>)</span>
|
249
|
+
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_before'>before</span> <span class='symbol'>:each</span> <span class='kw'>do</span>
|
250
|
+
<span class='ivar'>@original_execute</span> <span class='op'>=</span> <span class='const'>Caliph</span><span class='op'>::</span><span class='const'>CommandLine</span><span class='period'>.</span><span class='id identifier rubyid_instance_method'>instance_method</span><span class='lparen'>(</span><span class='symbol'>:execute</span><span class='rparen'>)</span>
|
251
|
+
<span class='kw'>unless</span> <span class='const'>MockingExecute</span> <span class='op'>></span> <span class='const'>Caliph</span><span class='op'>::</span><span class='const'>CommandLine</span>
|
252
|
+
<span class='const'>Caliph</span><span class='op'>::</span><span class='const'>CommandLine</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:include</span><span class='comma'>,</span> <span class='const'>MockingExecute</span><span class='rparen'>)</span>
|
253
|
+
<span class='kw'>end</span>
|
254
|
+
<span class='const'>Caliph</span><span class='op'>::</span><span class='const'>CommandLine</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:remove_method</span><span class='comma'>,</span> <span class='symbol'>:execute</span><span class='rparen'>)</span>
|
255
|
+
<span class='kw'>end</span>
|
256
|
+
|
257
|
+
<span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_after'>after</span> <span class='symbol'>:each</span> <span class='kw'>do</span>
|
258
|
+
<span class='const'>Caliph</span><span class='op'>::</span><span class='const'>CommandLine</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:define_method</span><span class='comma'>,</span> <span class='symbol'>:execute</span><span class='comma'>,</span> <span class='ivar'>@original_execute</span><span class='rparen'>)</span>
|
259
|
+
<span class='kw'>end</span>
|
260
|
+
<span class='kw'>end</span></pre>
|
261
|
+
</td>
|
262
|
+
</tr>
|
263
|
+
</table>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div id="instance_method_details" class="method_details_list">
|
269
|
+
<h2>Instance Method Details</h2>
|
270
|
+
|
271
|
+
|
272
|
+
<div class="method_details first">
|
273
|
+
<h3 class="signature first" id="expect_command-instance_method">
|
274
|
+
|
275
|
+
- (<tt>Object</tt>) <strong>expect_command</strong>(cmd, *result)
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
</h3><div class="docstring">
|
282
|
+
<div class="discussion">
|
283
|
+
|
284
|
+
<p>Registers an expectation about a command being run - expectations are
|
285
|
+
ordered</p>
|
286
|
+
|
287
|
+
|
288
|
+
</div>
|
289
|
+
</div>
|
290
|
+
<div class="tags">
|
291
|
+
|
292
|
+
|
293
|
+
</div><table class="source_code">
|
294
|
+
<tr>
|
295
|
+
<td>
|
296
|
+
<pre class="lines">
|
297
|
+
|
298
|
+
|
299
|
+
63
|
300
|
+
64
|
301
|
+
65</pre>
|
302
|
+
</td>
|
303
|
+
<td>
|
304
|
+
<pre class="code"><span class="info file"># File 'lib/caliph/testing/mock-command-line.rb', line 63</span>
|
305
|
+
|
306
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_expect_command'>expect_command</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
|
307
|
+
<span class='const'>Caliph</span><span class='op'>::</span><span class='const'>CommandLine</span><span class='period'>.</span><span class='id identifier rubyid_should_receive'>should_receive</span><span class='lparen'>(</span><span class='symbol'>:execute</span><span class='comma'>,</span> <span class='symbol'>:expected_from</span> <span class='op'>=></span> <span class='id identifier rubyid_caller'>caller</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_with'>with</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ordered'>ordered</span><span class='period'>.</span><span class='id identifier rubyid_and_return'>and_return</span><span class='lparen'>(</span><span class='const'>MockCommandResult</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
308
|
+
<span class='kw'>end</span></pre>
|
309
|
+
</td>
|
310
|
+
</tr>
|
311
|
+
</table>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
<div class="method_details ">
|
315
|
+
<h3 class="signature " id="expect_some_commands-instance_method">
|
316
|
+
|
317
|
+
- (<tt>Object</tt>) <strong>expect_some_commands</strong>
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
</h3><div class="docstring">
|
324
|
+
<div class="discussion">
|
325
|
+
|
326
|
+
<p>Registers indifference as to exactly what commands get called</p>
|
327
|
+
|
328
|
+
|
329
|
+
</div>
|
330
|
+
</div>
|
331
|
+
<div class="tags">
|
332
|
+
|
333
|
+
|
334
|
+
</div><table class="source_code">
|
335
|
+
<tr>
|
336
|
+
<td>
|
337
|
+
<pre class="lines">
|
338
|
+
|
339
|
+
|
340
|
+
57
|
341
|
+
58
|
342
|
+
59</pre>
|
343
|
+
</td>
|
344
|
+
<td>
|
345
|
+
<pre class="code"><span class="info file"># File 'lib/caliph/testing/mock-command-line.rb', line 57</span>
|
346
|
+
|
347
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_expect_some_commands'>expect_some_commands</span>
|
348
|
+
<span class='const'>Caliph</span><span class='op'>::</span><span class='const'>CommandLine</span><span class='period'>.</span><span class='id identifier rubyid_should_receive'>should_receive</span><span class='lparen'>(</span><span class='symbol'>:execute</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_any_number_of_times'>any_number_of_times</span><span class='period'>.</span><span class='id identifier rubyid_and_return'>and_return</span><span class='lparen'>(</span><span class='const'>MockCommandResult</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
349
|
+
<span class='kw'>end</span></pre>
|
350
|
+
</td>
|
351
|
+
</tr>
|
352
|
+
</table>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
</div>
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
<div id="footer">
|
360
|
+
Generated on Fri Jun 13 17:31:07 2014 by
|
361
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
362
|
+
0.8.7.4 (ruby-2.0.0).
|
363
|
+
</div>
|
364
|
+
|
365
|
+
</body>
|
366
|
+
</html>
|