caliph 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1124 @@
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
+ Class: Caliph::CommandRunResult
8
+
9
+ &mdash; 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/CommandRunResult.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> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Caliph.html" title="Caliph (module)">Caliph</a></span></span>
36
+ &raquo;
37
+ <span class="title">CommandRunResult</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>Class: Caliph::CommandRunResult
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Caliph::CommandRunResult</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/caliph/command-run-result.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <div id="subclasses">
103
+ <h2>Direct Known Subclasses</h2>
104
+ <p class="children"><span class='object_link'><a href="MockCommandResult.html" title="Caliph::MockCommandResult (class)">MockCommandResult</a></span></p>
105
+ </div>
106
+
107
+
108
+
109
+
110
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
111
+ <ul class="summary">
112
+
113
+ <li class="public ">
114
+ <span class="summary_signature">
115
+
116
+ <a href="#consume_timeout-instance_method" title="#consume_timeout (instance method)">- (Object) <strong>consume_timeout</strong> </a>
117
+
118
+
119
+
120
+ </span>
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ <span class="summary_desc"><div class='inline'>
134
+ <p>Returns the value of attribute consume_timeout.</p>
135
+ </div></span>
136
+
137
+ </li>
138
+
139
+
140
+ <li class="public ">
141
+ <span class="summary_signature">
142
+
143
+ <a href="#pid-instance_method" title="#pid (instance method)">- (Object) <strong>pid</strong> </a>
144
+
145
+
146
+
147
+ </span>
148
+
149
+
150
+
151
+
152
+ <span class="note title readonly">readonly</span>
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <span class="summary_desc"><div class='inline'>
163
+ <p>Returns the value of attribute pid.</p>
164
+ </div></span>
165
+
166
+ </li>
167
+
168
+
169
+ <li class="public ">
170
+ <span class="summary_signature">
171
+
172
+ <a href="#process_status-instance_method" title="#process_status (instance method)">- (Object) <strong>process_status</strong> </a>
173
+
174
+
175
+
176
+ </span>
177
+
178
+
179
+
180
+
181
+ <span class="note title readonly">readonly</span>
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+ <span class="summary_desc"><div class='inline'>
192
+ <p>Returns the value of attribute process_status.</p>
193
+ </div></span>
194
+
195
+ </li>
196
+
197
+
198
+ <li class="public ">
199
+ <span class="summary_signature">
200
+
201
+ <a href="#streams-instance_method" title="#streams (instance method)">- (Object) <strong>streams</strong> </a>
202
+
203
+
204
+
205
+ </span>
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+ <span class="summary_desc"><div class='inline'>
219
+ <p>Returns the value of attribute streams.</p>
220
+ </div></span>
221
+
222
+ </li>
223
+
224
+
225
+ </ul>
226
+
227
+
228
+
229
+
230
+
231
+ <h2>
232
+ Instance Method Summary
233
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
234
+ </h2>
235
+
236
+ <ul class="summary">
237
+
238
+ <li class="public ">
239
+ <span class="summary_signature">
240
+
241
+ <a href="#consume_buffers-instance_method" title="#consume_buffers (instance method)">- (Object) <strong>consume_buffers</strong>(readable) </a>
242
+
243
+
244
+
245
+ </span>
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+ <span class="summary_desc"><div class='inline'></div></span>
256
+
257
+ </li>
258
+
259
+
260
+ <li class="public ">
261
+ <span class="summary_signature">
262
+
263
+ <a href="#exit_code-instance_method" title="#exit_code (instance method)">- (Object) <strong>exit_code</strong> </a>
264
+
265
+
266
+
267
+ (also: #exit_status)
268
+
269
+ </span>
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+ <span class="summary_desc"><div class='inline'></div></span>
280
+
281
+ </li>
282
+
283
+
284
+ <li class="public ">
285
+ <span class="summary_signature">
286
+
287
+ <a href="#format_streams-instance_method" title="#format_streams (instance method)">- (Object) <strong>format_streams</strong> </a>
288
+
289
+
290
+
291
+ </span>
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+ <span class="summary_desc"><div class='inline'></div></span>
302
+
303
+ </li>
304
+
305
+
306
+ <li class="public ">
307
+ <span class="summary_signature">
308
+
309
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (CommandRunResult) <strong>initialize</strong>(pid, command) </a>
310
+
311
+
312
+
313
+ </span>
314
+
315
+
316
+ <span class="note title constructor">constructor</span>
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+ <span class="summary_desc"><div class='inline'>
326
+ <p>A new instance of CommandRunResult.</p>
327
+ </div></span>
328
+
329
+ </li>
330
+
331
+
332
+ <li class="public ">
333
+ <span class="summary_signature">
334
+
335
+ <a href="#must_succeed%21-instance_method" title="#must_succeed! (instance method)">- (Object) <strong>must_succeed!</strong> </a>
336
+
337
+
338
+
339
+ </span>
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+ <span class="summary_desc"><div class='inline'></div></span>
350
+
351
+ </li>
352
+
353
+
354
+ <li class="public ">
355
+ <span class="summary_signature">
356
+
357
+ <a href="#stderr-instance_method" title="#stderr (instance method)">- (Object) <strong>stderr</strong> </a>
358
+
359
+
360
+
361
+ </span>
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <span class="summary_desc"><div class='inline'></div></span>
372
+
373
+ </li>
374
+
375
+
376
+ <li class="public ">
377
+ <span class="summary_signature">
378
+
379
+ <a href="#stdout-instance_method" title="#stdout (instance method)">- (Object) <strong>stdout</strong> </a>
380
+
381
+
382
+
383
+ </span>
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+ <span class="summary_desc"><div class='inline'></div></span>
394
+
395
+ </li>
396
+
397
+
398
+ <li class="public ">
399
+ <span class="summary_signature">
400
+
401
+ <a href="#succeeded%3F-instance_method" title="#succeeded? (instance method)">- (Boolean) <strong>succeeded?</strong> </a>
402
+
403
+
404
+
405
+ </span>
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+ <span class="summary_desc"><div class='inline'></div></span>
416
+
417
+ </li>
418
+
419
+
420
+ <li class="public ">
421
+ <span class="summary_signature">
422
+
423
+ <a href="#wait-instance_method" title="#wait (instance method)">- (Object) <strong>wait</strong> </a>
424
+
425
+
426
+
427
+ </span>
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+ <span class="summary_desc"><div class='inline'></div></span>
438
+
439
+ </li>
440
+
441
+
442
+ </ul>
443
+
444
+
445
+ <div id="constructor_details" class="method_details_list">
446
+ <h2>Constructor Details</h2>
447
+
448
+ <div class="method_details first">
449
+ <h3 class="signature first" id="initialize-instance_method">
450
+
451
+ - (<tt><span class='object_link'><a href="" title="Caliph::CommandRunResult (class)">CommandRunResult</a></span></tt>) <strong>initialize</strong>(pid, command)
452
+
453
+
454
+
455
+
456
+
457
+ </h3><div class="docstring">
458
+ <div class="discussion">
459
+
460
+ <p>Returns a new instance of CommandRunResult</p>
461
+
462
+
463
+ </div>
464
+ </div>
465
+ <div class="tags">
466
+
467
+
468
+ </div><table class="source_code">
469
+ <tr>
470
+ <td>
471
+ <pre class="lines">
472
+
473
+
474
+ 3
475
+ 4
476
+ 5
477
+ 6
478
+ 7
479
+ 8
480
+ 9
481
+ 10
482
+ 11</pre>
483
+ </td>
484
+ <td>
485
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 3</span>
486
+
487
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_pid'>pid</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span>
488
+ <span class='ivar'>@command</span> <span class='op'>=</span> <span class='id identifier rubyid_command'>command</span>
489
+ <span class='ivar'>@pid</span> <span class='op'>=</span> <span class='id identifier rubyid_pid'>pid</span>
490
+
491
+ <span class='comment'>#####
492
+ </span> <span class='ivar'>@process_status</span> <span class='op'>=</span> <span class='kw'>nil</span>
493
+ <span class='ivar'>@streams</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
494
+ <span class='ivar'>@consume_timeout</span> <span class='op'>=</span> <span class='kw'>nil</span>
495
+ <span class='kw'>end</span></pre>
496
+ </td>
497
+ </tr>
498
+ </table>
499
+ </div>
500
+
501
+ </div>
502
+
503
+ <div id="instance_attr_details" class="attr_details">
504
+ <h2>Instance Attribute Details</h2>
505
+
506
+
507
+ <span id="consume_timeout=-instance_method"></span>
508
+ <div class="method_details first">
509
+ <h3 class="signature first" id="consume_timeout-instance_method">
510
+
511
+ - (<tt>Object</tt>) <strong>consume_timeout</strong>
512
+
513
+
514
+
515
+
516
+
517
+ </h3><div class="docstring">
518
+ <div class="discussion">
519
+
520
+ <p>Returns the value of attribute consume_timeout</p>
521
+
522
+
523
+ </div>
524
+ </div>
525
+ <div class="tags">
526
+
527
+
528
+ </div><table class="source_code">
529
+ <tr>
530
+ <td>
531
+ <pre class="lines">
532
+
533
+
534
+ 13
535
+ 14
536
+ 15</pre>
537
+ </td>
538
+ <td>
539
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 13</span>
540
+
541
+ <span class='kw'>def</span> <span class='id identifier rubyid_consume_timeout'>consume_timeout</span>
542
+ <span class='ivar'>@consume_timeout</span>
543
+ <span class='kw'>end</span></pre>
544
+ </td>
545
+ </tr>
546
+ </table>
547
+ </div>
548
+
549
+
550
+ <span id=""></span>
551
+ <div class="method_details ">
552
+ <h3 class="signature " id="pid-instance_method">
553
+
554
+ - (<tt>Object</tt>) <strong>pid</strong> <span class="extras">(readonly)</span>
555
+
556
+
557
+
558
+
559
+
560
+ </h3><div class="docstring">
561
+ <div class="discussion">
562
+
563
+ <p>Returns the value of attribute pid</p>
564
+
565
+
566
+ </div>
567
+ </div>
568
+ <div class="tags">
569
+
570
+
571
+ </div><table class="source_code">
572
+ <tr>
573
+ <td>
574
+ <pre class="lines">
575
+
576
+
577
+ 12
578
+ 13
579
+ 14</pre>
580
+ </td>
581
+ <td>
582
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 12</span>
583
+
584
+ <span class='kw'>def</span> <span class='id identifier rubyid_pid'>pid</span>
585
+ <span class='ivar'>@pid</span>
586
+ <span class='kw'>end</span></pre>
587
+ </td>
588
+ </tr>
589
+ </table>
590
+ </div>
591
+
592
+
593
+ <span id=""></span>
594
+ <div class="method_details ">
595
+ <h3 class="signature " id="process_status-instance_method">
596
+
597
+ - (<tt>Object</tt>) <strong>process_status</strong> <span class="extras">(readonly)</span>
598
+
599
+
600
+
601
+
602
+
603
+ </h3><div class="docstring">
604
+ <div class="discussion">
605
+
606
+ <p>Returns the value of attribute process_status</p>
607
+
608
+
609
+ </div>
610
+ </div>
611
+ <div class="tags">
612
+
613
+
614
+ </div><table class="source_code">
615
+ <tr>
616
+ <td>
617
+ <pre class="lines">
618
+
619
+
620
+ 12
621
+ 13
622
+ 14</pre>
623
+ </td>
624
+ <td>
625
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 12</span>
626
+
627
+ <span class='kw'>def</span> <span class='id identifier rubyid_process_status'>process_status</span>
628
+ <span class='ivar'>@process_status</span>
629
+ <span class='kw'>end</span></pre>
630
+ </td>
631
+ </tr>
632
+ </table>
633
+ </div>
634
+
635
+
636
+ <span id="streams=-instance_method"></span>
637
+ <div class="method_details ">
638
+ <h3 class="signature " id="streams-instance_method">
639
+
640
+ - (<tt>Object</tt>) <strong>streams</strong>
641
+
642
+
643
+
644
+
645
+
646
+ </h3><div class="docstring">
647
+ <div class="discussion">
648
+
649
+ <p>Returns the value of attribute streams</p>
650
+
651
+
652
+ </div>
653
+ </div>
654
+ <div class="tags">
655
+
656
+
657
+ </div><table class="source_code">
658
+ <tr>
659
+ <td>
660
+ <pre class="lines">
661
+
662
+
663
+ 13
664
+ 14
665
+ 15</pre>
666
+ </td>
667
+ <td>
668
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 13</span>
669
+
670
+ <span class='kw'>def</span> <span class='id identifier rubyid_streams'>streams</span>
671
+ <span class='ivar'>@streams</span>
672
+ <span class='kw'>end</span></pre>
673
+ </td>
674
+ </tr>
675
+ </table>
676
+ </div>
677
+
678
+ </div>
679
+
680
+
681
+ <div id="instance_method_details" class="method_details_list">
682
+ <h2>Instance Method Details</h2>
683
+
684
+
685
+ <div class="method_details first">
686
+ <h3 class="signature first" id="consume_buffers-instance_method">
687
+
688
+ - (<tt>Object</tt>) <strong>consume_buffers</strong>(readable)
689
+
690
+
691
+
692
+
693
+
694
+ </h3><table class="source_code">
695
+ <tr>
696
+ <td>
697
+ <pre class="lines">
698
+
699
+
700
+ 109
701
+ 110
702
+ 111
703
+ 112
704
+ 113
705
+ 114
706
+ 115
707
+ 116
708
+ 117
709
+ 118
710
+ 119
711
+ 120
712
+ 121
713
+ 122
714
+ 123
715
+ 124
716
+ 125
717
+ 126
718
+ 127</pre>
719
+ </td>
720
+ <td>
721
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 109</span>
722
+
723
+ <span class='kw'>def</span> <span class='id identifier rubyid_consume_buffers'>consume_buffers</span><span class='lparen'>(</span><span class='id identifier rubyid_readable'>readable</span><span class='rparen'>)</span>
724
+ <span class='kw'>if</span> <span class='kw'>not</span><span class='lparen'>(</span><span class='id identifier rubyid_readable'>readable</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='id identifier rubyid_readable'>readable</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span><span class='rparen'>)</span>
725
+ <span class='id identifier rubyid_readable'>readable</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_io'>io</span><span class='op'>|</span>
726
+ <span class='kw'>begin</span>
727
+ <span class='kw'>while</span> <span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_read_nonblock'>read_nonblock</span><span class='lparen'>(</span><span class='int'>4096</span><span class='rparen'>)</span>
728
+ <span class='kw'>if</span> <span class='ivar'>@buffered_echo</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
729
+ <span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_report'>report</span> <span class='id identifier rubyid_chunk'>chunk</span><span class='comma'>,</span> <span class='kw'>false</span>
730
+ <span class='kw'>else</span>
731
+ <span class='ivar'>@buffered_echo</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_chunk'>chunk</span>
732
+ <span class='kw'>end</span>
733
+ <span class='ivar'>@accumulators</span><span class='lbracket'>[</span><span class='id identifier rubyid_io'>io</span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_chunk'>chunk</span>
734
+ <span class='kw'>end</span>
735
+ <span class='kw'>rescue</span> <span class='const'>IO</span><span class='op'>::</span><span class='const'>WaitReadable</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_ex'>ex</span>
736
+ <span class='kw'>rescue</span> <span class='const'>EOFError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_ex'>ex</span>
737
+ <span class='ivar'>@live_ioes</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='rparen'>)</span>
738
+ <span class='kw'>end</span>
739
+ <span class='kw'>end</span>
740
+ <span class='kw'>end</span>
741
+ <span class='kw'>end</span></pre>
742
+ </td>
743
+ </tr>
744
+ </table>
745
+ </div>
746
+
747
+ <div class="method_details ">
748
+ <h3 class="signature " id="exit_code-instance_method">
749
+
750
+ - (<tt>Object</tt>) <strong>exit_code</strong>
751
+
752
+
753
+
754
+ <span class="aliases">Also known as:
755
+ <span class="names"><span id='exit_status-instance_method'>exit_status</span></span>
756
+ </span>
757
+
758
+
759
+
760
+ </h3><table class="source_code">
761
+ <tr>
762
+ <td>
763
+ <pre class="lines">
764
+
765
+
766
+ 23
767
+ 24
768
+ 25</pre>
769
+ </td>
770
+ <td>
771
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 23</span>
772
+
773
+ <span class='kw'>def</span> <span class='id identifier rubyid_exit_code'>exit_code</span>
774
+ <span class='ivar'>@process_status</span><span class='period'>.</span><span class='id identifier rubyid_exitstatus'>exitstatus</span>
775
+ <span class='kw'>end</span></pre>
776
+ </td>
777
+ </tr>
778
+ </table>
779
+ </div>
780
+
781
+ <div class="method_details ">
782
+ <h3 class="signature " id="format_streams-instance_method">
783
+
784
+ - (<tt>Object</tt>) <strong>format_streams</strong>
785
+
786
+
787
+
788
+
789
+
790
+ </h3><table class="source_code">
791
+ <tr>
792
+ <td>
793
+ <pre class="lines">
794
+
795
+
796
+ 35
797
+ 36
798
+ 37
799
+ 38</pre>
800
+ </td>
801
+ <td>
802
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 35</span>
803
+
804
+ <span class='kw'>def</span> <span class='id identifier rubyid_format_streams'>format_streams</span>
805
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>stdout:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_stdout'>stdout</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_stdout'>stdout</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[empty]\n</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_stdout'>stdout</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span>
806
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>stderr:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_stderr'>stderr</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_stderr'>stderr</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[empty]\n</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_stderr'>stderr</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='embexpr_end'>}</span><span class='tstring_content'>---</span><span class='tstring_end'>&quot;</span></span>
807
+ <span class='kw'>end</span></pre>
808
+ </td>
809
+ </tr>
810
+ </table>
811
+ </div>
812
+
813
+ <div class="method_details ">
814
+ <h3 class="signature " id="must_succeed!-instance_method">
815
+
816
+ - (<tt>Object</tt>) <strong>must_succeed!</strong>
817
+
818
+
819
+
820
+
821
+
822
+ </h3><table class="source_code">
823
+ <tr>
824
+ <td>
825
+ <pre class="lines">
826
+
827
+
828
+ 40
829
+ 41
830
+ 42
831
+ 43
832
+ 44
833
+ 45
834
+ 46
835
+ 47</pre>
836
+ </td>
837
+ <td>
838
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 40</span>
839
+
840
+ <span class='kw'>def</span> <span class='id identifier rubyid_must_succeed!'>must_succeed!</span>
841
+ <span class='kw'>case</span> <span class='id identifier rubyid_exit_code'>exit_code</span>
842
+ <span class='kw'>when</span> <span class='int'>0</span>
843
+ <span class='kw'>return</span> <span class='id identifier rubyid_exit_code'>exit_code</span>
844
+ <span class='kw'>else</span>
845
+ <span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Command </span><span class='embexpr_beg'>#{</span><span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> failed with exit status </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exit_code'>exit_code</span><span class='embexpr_end'>}</span><span class='tstring_content'>: \n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_format_streams'>format_streams</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
846
+ <span class='kw'>end</span>
847
+ <span class='kw'>end</span></pre>
848
+ </td>
849
+ </tr>
850
+ </table>
851
+ </div>
852
+
853
+ <div class="method_details ">
854
+ <h3 class="signature " id="stderr-instance_method">
855
+
856
+ - (<tt>Object</tt>) <strong>stderr</strong>
857
+
858
+
859
+
860
+
861
+
862
+ </h3><table class="source_code">
863
+ <tr>
864
+ <td>
865
+ <pre class="lines">
866
+
867
+
868
+ 19
869
+ 20
870
+ 21</pre>
871
+ </td>
872
+ <td>
873
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 19</span>
874
+
875
+ <span class='kw'>def</span> <span class='id identifier rubyid_stderr'>stderr</span>
876
+ <span class='ivar'>@streams</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span>
877
+ <span class='kw'>end</span></pre>
878
+ </td>
879
+ </tr>
880
+ </table>
881
+ </div>
882
+
883
+ <div class="method_details ">
884
+ <h3 class="signature " id="stdout-instance_method">
885
+
886
+ - (<tt>Object</tt>) <strong>stdout</strong>
887
+
888
+
889
+
890
+
891
+
892
+ </h3><table class="source_code">
893
+ <tr>
894
+ <td>
895
+ <pre class="lines">
896
+
897
+
898
+ 15
899
+ 16
900
+ 17</pre>
901
+ </td>
902
+ <td>
903
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 15</span>
904
+
905
+ <span class='kw'>def</span> <span class='id identifier rubyid_stdout'>stdout</span>
906
+ <span class='ivar'>@streams</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
907
+ <span class='kw'>end</span></pre>
908
+ </td>
909
+ </tr>
910
+ </table>
911
+ </div>
912
+
913
+ <div class="method_details ">
914
+ <h3 class="signature " id="succeeded?-instance_method">
915
+
916
+ - (<tt>Boolean</tt>) <strong>succeeded?</strong>
917
+
918
+
919
+
920
+
921
+
922
+ </h3><div class="docstring">
923
+ <div class="discussion">
924
+
925
+
926
+ </div>
927
+ </div>
928
+ <div class="tags">
929
+
930
+ <p class="tag_title">Returns:</p>
931
+ <ul class="return">
932
+
933
+ <li>
934
+
935
+
936
+ <span class='type'>(<tt>Boolean</tt>)</span>
937
+
938
+
939
+
940
+ </li>
941
+
942
+ </ul>
943
+
944
+ </div><table class="source_code">
945
+ <tr>
946
+ <td>
947
+ <pre class="lines">
948
+
949
+
950
+ 28
951
+ 29
952
+ 30
953
+ 31
954
+ 32
955
+ 33</pre>
956
+ </td>
957
+ <td>
958
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 28</span>
959
+
960
+ <span class='kw'>def</span> <span class='id identifier rubyid_succeeded?'>succeeded?</span>
961
+ <span class='id identifier rubyid_must_succeed!'>must_succeed!</span>
962
+ <span class='kw'>return</span> <span class='kw'>true</span>
963
+ <span class='kw'>rescue</span>
964
+ <span class='kw'>return</span> <span class='kw'>false</span>
965
+ <span class='kw'>end</span></pre>
966
+ </td>
967
+ </tr>
968
+ </table>
969
+ </div>
970
+
971
+ <div class="method_details ">
972
+ <h3 class="signature " id="wait-instance_method">
973
+
974
+ - (<tt>Object</tt>) <strong>wait</strong>
975
+
976
+
977
+
978
+
979
+
980
+ </h3><table class="source_code">
981
+ <tr>
982
+ <td>
983
+ <pre class="lines">
984
+
985
+
986
+ 49
987
+ 50
988
+ 51
989
+ 52
990
+ 53
991
+ 54
992
+ 55
993
+ 56
994
+ 57
995
+ 58
996
+ 59
997
+ 60
998
+ 61
999
+ 62
1000
+ 63
1001
+ 64
1002
+ 65
1003
+ 66
1004
+ 67
1005
+ 68
1006
+ 69
1007
+ 70
1008
+ 71
1009
+ 72
1010
+ 73
1011
+ 74
1012
+ 75
1013
+ 76
1014
+ 77
1015
+ 78
1016
+ 79
1017
+ 80
1018
+ 81
1019
+ 82
1020
+ 83
1021
+ 84
1022
+ 85
1023
+ 86
1024
+ 87
1025
+ 88
1026
+ 89
1027
+ 90
1028
+ 91
1029
+ 92
1030
+ 93
1031
+ 94
1032
+ 95
1033
+ 96
1034
+ 97
1035
+ 98
1036
+ 99
1037
+ 100
1038
+ 101
1039
+ 102
1040
+ 103
1041
+ 104
1042
+ 105
1043
+ 106
1044
+ 107</pre>
1045
+ </td>
1046
+ <td>
1047
+ <pre class="code"><span class="info file"># File 'lib/caliph/command-run-result.rb', line 49</span>
1048
+
1049
+ <span class='kw'>def</span> <span class='id identifier rubyid_wait'>wait</span>
1050
+ <span class='ivar'>@accumulators</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1051
+ <span class='id identifier rubyid_waits'>waits</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1052
+ <span class='ivar'>@buffered_echo</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1053
+
1054
+ <span class='id identifier rubyid_ioes'>ioes</span> <span class='op'>=</span> <span class='id identifier rubyid_streams'>streams</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span>
1055
+ <span class='id identifier rubyid_ioes'>ioes</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_io'>io</span><span class='op'>|</span>
1056
+ <span class='ivar'>@accumulators</span><span class='lbracket'>[</span><span class='id identifier rubyid_io'>io</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1057
+ <span class='id identifier rubyid_waits'>waits</span><span class='lbracket'>[</span><span class='id identifier rubyid_io'>io</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='int'>3</span>
1058
+ <span class='kw'>end</span>
1059
+ <span class='id identifier rubyid_begin_echoing'>begin_echoing</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='ivar'>@consume_timeout</span> <span class='op'>||</span> <span class='int'>3</span><span class='rparen'>)</span>
1060
+
1061
+ <span class='ivar'>@live_ioes</span> <span class='op'>=</span> <span class='id identifier rubyid_ioes'>ioes</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
1062
+
1063
+ <span class='kw'>until</span> <span class='ivar'>@live_ioes</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='kw'>do</span>
1064
+ <span class='id identifier rubyid_newpid'>newpid</span><span class='comma'>,</span> <span class='ivar'>@process_status</span> <span class='op'>=</span> <span class='const'>Process</span><span class='period'>.</span><span class='id identifier rubyid_waitpid2'>waitpid2</span><span class='lparen'>(</span><span class='id identifier rubyid_pid'>pid</span><span class='comma'>,</span> <span class='const'>Process</span><span class='op'>::</span><span class='const'>WNOHANG</span><span class='rparen'>)</span>
1065
+
1066
+ <span class='kw'>unless</span> <span class='ivar'>@process_status</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1067
+ <span class='id identifier rubyid_consume_buffers'>consume_buffers</span><span class='lparen'>(</span><span class='ivar'>@live_ioes</span><span class='rparen'>)</span>
1068
+ <span class='kw'>break</span>
1069
+ <span class='kw'>end</span>
1070
+
1071
+ <span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>=</span> <span class='int'>0</span>
1072
+
1073
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@buffered_echo</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1074
+ <span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_begin_echoing'>begin_echoing</span> <span class='op'>-</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
1075
+ <span class='kw'>if</span> <span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>&lt;</span> <span class='int'>0</span>
1076
+ <span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_report'>report</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1077
+ <span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_report'>report</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Long running command output:</span><span class='tstring_end'>&quot;</span></span>
1078
+ <span class='ivar'>@command</span><span class='period'>.</span><span class='id identifier rubyid_report'>report</span> <span class='ivar'>@buffered_echo</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
1079
+ <span class='ivar'>@buffered_echo</span> <span class='op'>=</span> <span class='kw'>nil</span>
1080
+ <span class='kw'>end</span>
1081
+ <span class='kw'>end</span>
1082
+
1083
+ <span class='kw'>if</span> <span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>&gt;</span> <span class='int'>0</span>
1084
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='const'>IO</span><span class='op'>::</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='ivar'>@live_ioes</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@live_ioes</span><span class='comma'>,</span> <span class='id identifier rubyid_timeout'>timeout</span><span class='rparen'>)</span>
1085
+ <span class='kw'>else</span>
1086
+ <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='const'>IO</span><span class='op'>::</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='ivar'>@live_ioes</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@live_ioes</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
1087
+ <span class='kw'>end</span>
1088
+
1089
+ <span class='kw'>unless</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='comment'>#timeout
1090
+ </span> <span class='id identifier rubyid_readable'>readable</span><span class='comma'>,</span> <span class='id identifier rubyid__writeable'>_writeable</span><span class='comma'>,</span> <span class='id identifier rubyid_errored'>errored</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_result'>result</span>
1091
+ <span class='kw'>unless</span> <span class='id identifier rubyid_errored'>errored</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
1092
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Error on IO: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_errored'>errored</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
1093
+ <span class='kw'>end</span>
1094
+
1095
+ <span class='id identifier rubyid_consume_buffers'>consume_buffers</span><span class='lparen'>(</span><span class='id identifier rubyid_readable'>readable</span><span class='rparen'>)</span>
1096
+ <span class='kw'>end</span>
1097
+ <span class='kw'>end</span>
1098
+
1099
+ <span class='kw'>if</span> <span class='ivar'>@process_status</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1100
+ <span class='id identifier rubyid_newpid'>newpid</span><span class='comma'>,</span> <span class='ivar'>@process_status</span> <span class='op'>=</span> <span class='const'>Process</span><span class='period'>.</span><span class='id identifier rubyid_waitpid2'>waitpid2</span><span class='lparen'>(</span><span class='id identifier rubyid_pid'>pid</span><span class='rparen'>)</span>
1101
+ <span class='kw'>end</span>
1102
+
1103
+ <span class='id identifier rubyid_ioes'>ioes</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_io'>io</span><span class='op'>|</span>
1104
+ <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
1105
+ <span class='kw'>end</span>
1106
+ <span class='ivar'>@streams</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_ioes'>ioes</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_io'>io</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span><span class='comma'>,</span> <span class='ivar'>@accumulators</span><span class='lbracket'>[</span><span class='id identifier rubyid_io'>io</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rbracket'>]</span>
1107
+ <span class='kw'>end</span></pre>
1108
+ </td>
1109
+ </tr>
1110
+ </table>
1111
+ </div>
1112
+
1113
+ </div>
1114
+
1115
+ </div>
1116
+
1117
+ <div id="footer">
1118
+ Generated on Fri Jun 13 17:31:08 2014 by
1119
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1120
+ 0.8.7.4 (ruby-2.0.0).
1121
+ </div>
1122
+
1123
+ </body>
1124
+ </html>