meroku 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -5
  3. data/bin/meroku +1 -1
  4. data/circle.yml +23 -0
  5. data/frontend/Gemfile +5 -2
  6. data/frontend/Gemfile.lock +5 -2
  7. data/frontend/app/controllers/application_controller.rb +1 -0
  8. data/frontend/app/controllers/apps_controller.rb +46 -48
  9. data/frontend/app/controllers/publickeys_controller.rb +45 -46
  10. data/frontend/app/controllers/users/registrations_controller.rb +0 -15
  11. data/frontend/app/controllers/users/sessions_controller.rb +12 -3
  12. data/frontend/app/lib/cmd.rb +11 -0
  13. data/frontend/app/models/app.rb +18 -11
  14. data/frontend/app/models/publickey.rb +1 -1
  15. data/frontend/app/models/user.rb +5 -4
  16. data/frontend/app/policies/application_policy.rb +53 -0
  17. data/frontend/app/policies/publickey_policy.rb +7 -0
  18. data/frontend/app/serializable/serializable_user.rb +2 -1
  19. data/frontend/app/views/layouts/application.html.erb +1 -1
  20. data/frontend/config/database.yml +72 -10
  21. data/frontend/config/routes.rb +6 -14
  22. data/frontend/db/migrate/20171028150506_add_apisecret_to_users.rb +6 -0
  23. data/frontend/etc_nginx_sites-enabled_default +1 -1
  24. data/frontend/public/Meroku.html +140 -0
  25. data/frontend/public/Meroku/Api.html +129 -0
  26. data/frontend/public/Meroku/Api/Request.html +221 -0
  27. data/frontend/public/Meroku/Aws.html +212 -0
  28. data/frontend/public/Meroku/Aws/Ec2.html +477 -0
  29. data/frontend/public/Meroku/CLI.html +784 -0
  30. data/frontend/public/Meroku/CLI/AdminUser.html +192 -0
  31. data/frontend/public/Meroku/CLI/Help.html +224 -0
  32. data/frontend/public/Meroku/CLI/Secrets.html +191 -0
  33. data/frontend/public/Meroku/CLI/Session.html +460 -0
  34. data/frontend/public/Meroku/CLI/User.html +182 -0
  35. data/frontend/public/Meroku/Extensions.html +405 -0
  36. data/frontend/public/Meroku/Infrastructure.html +279 -0
  37. data/frontend/public/Meroku/Infrastructure/Node.html +785 -0
  38. data/frontend/public/Meroku/Infrastructure/Server.html +373 -0
  39. data/frontend/public/Meroku/Node.html +845 -0
  40. data/frontend/public/Meroku/Tunnel.html +701 -0
  41. data/frontend/public/Meroku/Tunnelable.html +243 -0
  42. data/frontend/public/_index.html +273 -0
  43. data/frontend/public/class_list.html +51 -0
  44. data/frontend/public/css/common.css +1 -0
  45. data/frontend/public/css/full_list.css +58 -0
  46. data/frontend/public/css/style.css +492 -0
  47. data/frontend/public/file.README.html +181 -0
  48. data/frontend/public/file_list.html +56 -0
  49. data/frontend/public/frames.html +17 -0
  50. data/frontend/public/index.html +181 -0
  51. data/frontend/public/js/app.js +248 -0
  52. data/frontend/public/js/full_list.js +216 -0
  53. data/frontend/public/js/jquery.js +4 -0
  54. data/frontend/public/method_list.html +395 -0
  55. data/frontend/public/robots.txt +2 -1
  56. data/frontend/public/top-level-namespace.html +110 -0
  57. data/frontend/test/policies/publickey_policy_test.rb +19 -0
  58. data/lib/meroku.rb +9 -7
  59. data/lib/meroku/api.rb +8 -0
  60. data/lib/meroku/api/request.rb +17 -0
  61. data/lib/meroku/aws.rb +14 -0
  62. data/lib/meroku/aws/ec2.rb +59 -0
  63. data/lib/meroku/cli.rb +80 -81
  64. data/lib/meroku/cli/help.rb +27 -0
  65. data/lib/meroku/cli/secrets.rb +13 -0
  66. data/lib/meroku/cli/session.rb +32 -51
  67. data/lib/meroku/extensions.rb +32 -0
  68. data/lib/meroku/infrastructure.rb +14 -17
  69. data/lib/meroku/infrastructure/server.rb +20 -0
  70. data/lib/meroku/node.rb +113 -0
  71. data/lib/meroku/tunnelable.rb +31 -0
  72. data/lib/meroku/version.rb +1 -1
  73. data/modified-cedar-14.sh +0 -4
  74. metadata +50 -9
  75. data/frontend/app/controllers/pages_controller.rb +0 -4
  76. data/frontend/app/views/pages/landing.html.erb +0 -2
  77. data/frontend/db/migrate/20171025193627_add_token_to_users.rb +0 -5
  78. data/lib/meroku/cli/admin_user.rb +0 -20
  79. data/lib/meroku/cli/user.rb +0 -14
  80. data/lib/meroku/infrastructure/node.rb +0 -102
  81. data/lib/meroku/tunnel.rb +0 -56
@@ -0,0 +1,701 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Meroku::Tunnel
8
+
9
+ &mdash; Documentation by YARD 0.9.9
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
+ pathId = "Meroku::Tunnel";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (T)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span>
41
+ &raquo;
42
+ <span class="title">Tunnel</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Meroku::Tunnel
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Meroku::Tunnel</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/meroku/tunnel.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#ip-instance_method" title="#ip (instance method)">#<strong>ip</strong> &#x21d2; Object </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <span class="summary_desc"><div class='inline'>
130
+ <p>Returns the value of attribute ip.</p>
131
+ </div></span>
132
+
133
+ </li>
134
+
135
+
136
+ <li class="public ">
137
+ <span class="summary_signature">
138
+
139
+ <a href="#keys-instance_method" title="#keys (instance method)">#<strong>keys</strong> &#x21d2; Object </a>
140
+
141
+
142
+
143
+ </span>
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'>
157
+ <p>Returns the value of attribute keys.</p>
158
+ </div></span>
159
+
160
+ </li>
161
+
162
+
163
+ <li class="public ">
164
+ <span class="summary_signature">
165
+
166
+ <a href="#username-instance_method" title="#username (instance method)">#<strong>username</strong> &#x21d2; Object </a>
167
+
168
+
169
+
170
+ </span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'>
184
+ <p>Returns the value of attribute username.</p>
185
+ </div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#verbose-instance_method" title="#verbose (instance method)">#<strong>verbose</strong> &#x21d2; Object </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <span class="summary_desc"><div class='inline'>
211
+ <p>Returns the value of attribute verbose.</p>
212
+ </div></span>
213
+
214
+ </li>
215
+
216
+
217
+ <li class="public ">
218
+ <span class="summary_signature">
219
+
220
+ <a href="#verify_host_key-instance_method" title="#verify_host_key (instance method)">#<strong>verify_host_key</strong> &#x21d2; Object </a>
221
+
222
+
223
+
224
+ </span>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+ <span class="summary_desc"><div class='inline'>
238
+ <p>Returns the value of attribute verify_host_key.</p>
239
+ </div></span>
240
+
241
+ </li>
242
+
243
+
244
+ </ul>
245
+
246
+
247
+
248
+
249
+
250
+ <h2>
251
+ Instance Method Summary
252
+ <small><a href="#" class="summary_toggle">collapse</a></small>
253
+ </h2>
254
+
255
+ <ul class="summary">
256
+
257
+ <li class="public ">
258
+ <span class="summary_signature">
259
+
260
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(ip:, username:, keys:, verify_host_key:, verbose:) &#x21d2; Tunnel </a>
261
+
262
+
263
+
264
+ </span>
265
+
266
+
267
+ <span class="note title constructor">constructor</span>
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <span class="summary_desc"><div class='inline'>
277
+ <p>A new instance of Tunnel.</p>
278
+ </div></span>
279
+
280
+ </li>
281
+
282
+
283
+ <li class="public ">
284
+ <span class="summary_signature">
285
+
286
+ <a href="#run-instance_method" title="#run (instance method)">#<strong>run</strong>(cmd) &#x21d2; Object </a>
287
+
288
+
289
+
290
+ </span>
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+ <span class="summary_desc"><div class='inline'></div></span>
301
+
302
+ </li>
303
+
304
+
305
+ </ul>
306
+
307
+
308
+ <div id="constructor_details" class="method_details_list">
309
+ <h2>Constructor Details</h2>
310
+
311
+ <div class="method_details first">
312
+ <h3 class="signature first" id="initialize-instance_method">
313
+
314
+ #<strong>initialize</strong>(ip:, username:, keys:, verify_host_key:, verbose:) &#x21d2; <tt><span class='object_link'><a href="" title="Meroku::Tunnel (class)">Tunnel</a></span></tt>
315
+
316
+
317
+
318
+
319
+
320
+ </h3><div class="docstring">
321
+ <div class="discussion">
322
+
323
+ <p>Returns a new instance of Tunnel</p>
324
+
325
+
326
+ </div>
327
+ </div>
328
+ <div class="tags">
329
+
330
+
331
+ </div><table class="source_code">
332
+ <tr>
333
+ <td>
334
+ <pre class="lines">
335
+
336
+
337
+ 6
338
+ 7
339
+ 8
340
+ 9
341
+ 10
342
+ 11
343
+ 12</pre>
344
+ </td>
345
+ <td>
346
+ <pre class="code"><span class="info file"># File 'lib/meroku/tunnel.rb', line 6</span>
347
+
348
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>ip:</span><span class='comma'>,</span><span class='label'>username:</span><span class='comma'>,</span><span class='label'>keys:</span><span class='comma'>,</span><span class='label'>verify_host_key:</span><span class='comma'>,</span><span class='label'>verbose:</span><span class='rparen'>)</span>
349
+ <span class='ivar'>@ip</span> <span class='op'>=</span> <span class='id identifier rubyid_ip'>ip</span>
350
+ <span class='ivar'>@username</span> <span class='op'>=</span> <span class='id identifier rubyid_username'>username</span>
351
+ <span class='ivar'>@keys</span> <span class='op'>=</span> <span class='id identifier rubyid_keys'>keys</span>
352
+ <span class='ivar'>@verify_host_key</span> <span class='op'>=</span> <span class='id identifier rubyid_verify_host_key'>verify_host_key</span>
353
+ <span class='ivar'>@verbose</span> <span class='op'>=</span> <span class='id identifier rubyid_verbose'>verbose</span>
354
+ <span class='kw'>end</span></pre>
355
+ </td>
356
+ </tr>
357
+ </table>
358
+ </div>
359
+
360
+ </div>
361
+
362
+ <div id="instance_attr_details" class="attr_details">
363
+ <h2>Instance Attribute Details</h2>
364
+
365
+
366
+ <span id="ip=-instance_method"></span>
367
+ <div class="method_details first">
368
+ <h3 class="signature first" id="ip-instance_method">
369
+
370
+ #<strong>ip</strong> &#x21d2; <tt>Object</tt>
371
+
372
+
373
+
374
+
375
+
376
+ </h3><div class="docstring">
377
+ <div class="discussion">
378
+
379
+ <p>Returns the value of attribute ip</p>
380
+
381
+
382
+ </div>
383
+ </div>
384
+ <div class="tags">
385
+
386
+
387
+ </div><table class="source_code">
388
+ <tr>
389
+ <td>
390
+ <pre class="lines">
391
+
392
+
393
+ 4
394
+ 5
395
+ 6</pre>
396
+ </td>
397
+ <td>
398
+ <pre class="code"><span class="info file"># File 'lib/meroku/tunnel.rb', line 4</span>
399
+
400
+ <span class='kw'>def</span> <span class='id identifier rubyid_ip'>ip</span>
401
+ <span class='ivar'>@ip</span>
402
+ <span class='kw'>end</span></pre>
403
+ </td>
404
+ </tr>
405
+ </table>
406
+ </div>
407
+
408
+
409
+ <span id="keys=-instance_method"></span>
410
+ <div class="method_details ">
411
+ <h3 class="signature " id="keys-instance_method">
412
+
413
+ #<strong>keys</strong> &#x21d2; <tt>Object</tt>
414
+
415
+
416
+
417
+
418
+
419
+ </h3><div class="docstring">
420
+ <div class="discussion">
421
+
422
+ <p>Returns the value of attribute keys</p>
423
+
424
+
425
+ </div>
426
+ </div>
427
+ <div class="tags">
428
+
429
+
430
+ </div><table class="source_code">
431
+ <tr>
432
+ <td>
433
+ <pre class="lines">
434
+
435
+
436
+ 4
437
+ 5
438
+ 6</pre>
439
+ </td>
440
+ <td>
441
+ <pre class="code"><span class="info file"># File 'lib/meroku/tunnel.rb', line 4</span>
442
+
443
+ <span class='kw'>def</span> <span class='id identifier rubyid_keys'>keys</span>
444
+ <span class='ivar'>@keys</span>
445
+ <span class='kw'>end</span></pre>
446
+ </td>
447
+ </tr>
448
+ </table>
449
+ </div>
450
+
451
+
452
+ <span id="username=-instance_method"></span>
453
+ <div class="method_details ">
454
+ <h3 class="signature " id="username-instance_method">
455
+
456
+ #<strong>username</strong> &#x21d2; <tt>Object</tt>
457
+
458
+
459
+
460
+
461
+
462
+ </h3><div class="docstring">
463
+ <div class="discussion">
464
+
465
+ <p>Returns the value of attribute username</p>
466
+
467
+
468
+ </div>
469
+ </div>
470
+ <div class="tags">
471
+
472
+
473
+ </div><table class="source_code">
474
+ <tr>
475
+ <td>
476
+ <pre class="lines">
477
+
478
+
479
+ 4
480
+ 5
481
+ 6</pre>
482
+ </td>
483
+ <td>
484
+ <pre class="code"><span class="info file"># File 'lib/meroku/tunnel.rb', line 4</span>
485
+
486
+ <span class='kw'>def</span> <span class='id identifier rubyid_username'>username</span>
487
+ <span class='ivar'>@username</span>
488
+ <span class='kw'>end</span></pre>
489
+ </td>
490
+ </tr>
491
+ </table>
492
+ </div>
493
+
494
+
495
+ <span id="verbose=-instance_method"></span>
496
+ <div class="method_details ">
497
+ <h3 class="signature " id="verbose-instance_method">
498
+
499
+ #<strong>verbose</strong> &#x21d2; <tt>Object</tt>
500
+
501
+
502
+
503
+
504
+
505
+ </h3><div class="docstring">
506
+ <div class="discussion">
507
+
508
+ <p>Returns the value of attribute verbose</p>
509
+
510
+
511
+ </div>
512
+ </div>
513
+ <div class="tags">
514
+
515
+
516
+ </div><table class="source_code">
517
+ <tr>
518
+ <td>
519
+ <pre class="lines">
520
+
521
+
522
+ 4
523
+ 5
524
+ 6</pre>
525
+ </td>
526
+ <td>
527
+ <pre class="code"><span class="info file"># File 'lib/meroku/tunnel.rb', line 4</span>
528
+
529
+ <span class='kw'>def</span> <span class='id identifier rubyid_verbose'>verbose</span>
530
+ <span class='ivar'>@verbose</span>
531
+ <span class='kw'>end</span></pre>
532
+ </td>
533
+ </tr>
534
+ </table>
535
+ </div>
536
+
537
+
538
+ <span id="verify_host_key=-instance_method"></span>
539
+ <div class="method_details ">
540
+ <h3 class="signature " id="verify_host_key-instance_method">
541
+
542
+ #<strong>verify_host_key</strong> &#x21d2; <tt>Object</tt>
543
+
544
+
545
+
546
+
547
+
548
+ </h3><div class="docstring">
549
+ <div class="discussion">
550
+
551
+ <p>Returns the value of attribute verify_host_key</p>
552
+
553
+
554
+ </div>
555
+ </div>
556
+ <div class="tags">
557
+
558
+
559
+ </div><table class="source_code">
560
+ <tr>
561
+ <td>
562
+ <pre class="lines">
563
+
564
+
565
+ 4
566
+ 5
567
+ 6</pre>
568
+ </td>
569
+ <td>
570
+ <pre class="code"><span class="info file"># File 'lib/meroku/tunnel.rb', line 4</span>
571
+
572
+ <span class='kw'>def</span> <span class='id identifier rubyid_verify_host_key'>verify_host_key</span>
573
+ <span class='ivar'>@verify_host_key</span>
574
+ <span class='kw'>end</span></pre>
575
+ </td>
576
+ </tr>
577
+ </table>
578
+ </div>
579
+
580
+ </div>
581
+
582
+
583
+ <div id="instance_method_details" class="method_details_list">
584
+ <h2>Instance Method Details</h2>
585
+
586
+
587
+ <div class="method_details first">
588
+ <h3 class="signature first" id="run-instance_method">
589
+
590
+ #<strong>run</strong>(cmd) &#x21d2; <tt>Object</tt>
591
+
592
+
593
+
594
+
595
+
596
+ </h3><table class="source_code">
597
+ <tr>
598
+ <td>
599
+ <pre class="lines">
600
+
601
+
602
+ 14
603
+ 15
604
+ 16
605
+ 17
606
+ 18
607
+ 19
608
+ 20
609
+ 21
610
+ 22
611
+ 23
612
+ 24
613
+ 25
614
+ 26
615
+ 27
616
+ 28
617
+ 29
618
+ 30
619
+ 31
620
+ 32
621
+ 33
622
+ 34
623
+ 35
624
+ 36
625
+ 37
626
+ 38
627
+ 39
628
+ 40
629
+ 41
630
+ 42
631
+ 43
632
+ 44
633
+ 45
634
+ 46
635
+ 47
636
+ 48
637
+ 49
638
+ 50
639
+ 51
640
+ 52</pre>
641
+ </td>
642
+ <td>
643
+ <pre class="code"><span class="info file"># File 'lib/meroku/tunnel.rb', line 14</span>
644
+
645
+ <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span>
646
+ <span class='ivar'>@verbose</span><span class='op'>=</span><span class='kw'>true</span>
647
+ <span class='id identifier rubyid_cols'>cols</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>tput cols</span><span class='tstring_end'>`</span></span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>-</span> <span class='int'>2</span>
648
+ <span class='id identifier rubyid_retries'>retries</span> <span class='op'>||=</span> <span class='int'>0</span>
649
+ <span class='id identifier rubyid_exit_code'>exit_code</span><span class='op'>=</span><span class='kw'>nil</span>
650
+ <span class='const'>Net</span><span class='op'>::</span><span class='const'>SSH</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span><span class='ivar'>@ip</span><span class='comma'>,</span>
651
+ <span class='ivar'>@username</span><span class='comma'>,</span>
652
+ <span class='label'>password:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>password</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
653
+ <span class='label'>keys:</span> <span class='ivar'>@keys</span><span class='comma'>,</span>
654
+ <span class='label'>verify_host_key:</span> <span class='ivar'>@verify_host_key</span><span class='comma'>,</span>
655
+ <span class='label'>timeout:</span> <span class='int'>10</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ssh'>ssh</span><span class='op'>|</span>
656
+ <span class='id identifier rubyid_channel'>channel</span> <span class='op'>=</span> <span class='id identifier rubyid_ssh'>ssh</span><span class='period'>.</span><span class='id identifier rubyid_open_channel'>open_channel</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ch'>ch</span><span class='op'>|</span>
657
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_cmd'>cmd</span>
658
+ <span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_exec'>exec</span> <span class='id identifier rubyid_cmd'>cmd</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ch'>ch</span><span class='comma'>,</span> <span class='id identifier rubyid_success'>success</span><span class='op'>|</span>
659
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>could not execute command</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_success'>success</span>
660
+ <span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_on_data'>on_data</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
661
+ <span class='id identifier rubyid_print'>print</span> <span class='id identifier rubyid_data'>data</span>
662
+ <span class='kw'>end</span>
663
+ <span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_on_extended_data'>on_extended_data</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
664
+ <span class='id identifier rubyid_print'>print</span> <span class='id identifier rubyid_data'>data</span>
665
+ <span class='kw'>end</span>
666
+ <span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_on_request'>on_request</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>exit-status</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ch'>ch</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
667
+ <span class='id identifier rubyid_exit_code'>exit_code</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_read_long'>read_long</span>
668
+ <span class='kw'>end</span>
669
+ <span class='id identifier rubyid_ch'>ch</span><span class='period'>.</span><span class='id identifier rubyid_on_close'>on_close</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span>
670
+ <span class='kw'>end</span>
671
+ <span class='kw'>end</span>
672
+ <span class='id identifier rubyid_channel'>channel</span><span class='period'>.</span><span class='id identifier rubyid_wait'>wait</span>
673
+ <span class='kw'>end</span>
674
+ <span class='id identifier rubyid_abort'>abort</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>aborted during Tunnel.run()</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_exit_code'>exit_code</span> <span class='op'>!=</span> <span class='int'>0</span>
675
+ <span class='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>ECONNREFUSED</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
676
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>retrying run (Errno::ECONNREFUSED)</span><span class='tstring_end'>&quot;</span></span>
677
+ <span class='id identifier rubyid_sleep'>sleep</span> <span class='int'>1</span>
678
+ <span class='kw'>retry</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_retries'>retries</span> <span class='op'>+=</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>&lt;</span> <span class='int'>10</span>
679
+ <span class='kw'>rescue</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>SSH</span><span class='op'>::</span><span class='const'>ConnectionTimeout</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
680
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>retrying run (Net::SSH::ConnectionTimeout)</span><span class='tstring_end'>&quot;</span></span>
681
+ <span class='id identifier rubyid_sleep'>sleep</span> <span class='int'>1</span>
682
+ <span class='kw'>retry</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_retries'>retries</span> <span class='op'>+=</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>&lt;</span> <span class='int'>10</span>
683
+ <span class='kw'>end</span></pre>
684
+ </td>
685
+ </tr>
686
+ </table>
687
+ </div>
688
+
689
+ </div>
690
+
691
+ </div>
692
+
693
+ <div id="footer">
694
+ Generated on Mon Oct 30 12:43:18 2017 by
695
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
696
+ 0.9.9 (ruby-2.4.2).
697
+ </div>
698
+
699
+ </div>
700
+ </body>
701
+ </html>