humidifier-reservoir 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,688 @@
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: Humidifier::Reservoir::Stack
8
+
9
+ &mdash; Humidifier::Reservoir
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 = "Humidifier::Reservoir::Stack";
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 (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Humidifier.html" title="Humidifier (module)">Humidifier</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Reservoir.html" title="Humidifier::Reservoir (module)">Reservoir</a></span></span>
41
+ &raquo;
42
+ <span class="title">Stack</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: Humidifier::Reservoir::Stack
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">Humidifier::Reservoir::Stack</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/humidifier/reservoir/stack.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Represents a CloudFormation stack. This contains all of the logic for
106
+ interfacing with humidifier to deploy stacks, validate them, and display
107
+ them.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
120
+ <ul class="summary">
121
+
122
+ <li class="public ">
123
+ <span class="summary_signature">
124
+
125
+ <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
126
+
127
+
128
+
129
+ </span>
130
+
131
+
132
+
133
+
134
+ <span class="note title readonly">readonly</span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <span class="summary_desc"><div class='inline'>
145
+ <p>Returns the value of attribute name.</p>
146
+ </div></span>
147
+
148
+ </li>
149
+
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#pattern-instance_method" title="#pattern (instance method)">#<strong>pattern</strong> &#x21d2; Object </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+ <span class="note title readonly">readonly</span>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ <span class="summary_desc"><div class='inline'>
174
+ <p>Returns the value of attribute pattern.</p>
175
+ </div></span>
176
+
177
+ </li>
178
+
179
+
180
+ </ul>
181
+
182
+
183
+
184
+
185
+
186
+ <h2>
187
+ Instance Method Summary
188
+ <small><a href="#" class="summary_toggle">collapse</a></small>
189
+ </h2>
190
+
191
+ <ul class="summary">
192
+
193
+ <li class="public ">
194
+ <span class="summary_signature">
195
+
196
+ <a href="#deploy-instance_method" title="#deploy (instance method)">#<strong>deploy</strong>(wait = false) &#x21d2; Object </a>
197
+
198
+
199
+
200
+ </span>
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <span class="summary_desc"><div class='inline'></div></span>
211
+
212
+ </li>
213
+
214
+
215
+ <li class="public ">
216
+ <span class="summary_signature">
217
+
218
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, pattern = nil) &#x21d2; Stack </a>
219
+
220
+
221
+
222
+ </span>
223
+
224
+
225
+ <span class="note title constructor">constructor</span>
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="summary_desc"><div class='inline'>
235
+ <p>A new instance of Stack.</p>
236
+ </div></span>
237
+
238
+ </li>
239
+
240
+
241
+ <li class="public ">
242
+ <span class="summary_signature">
243
+
244
+ <a href="#resources-instance_method" title="#resources (instance method)">#<strong>resources</strong> &#x21d2; Object </a>
245
+
246
+
247
+
248
+ </span>
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+ <span class="summary_desc"><div class='inline'></div></span>
259
+
260
+ </li>
261
+
262
+
263
+ <li class="public ">
264
+ <span class="summary_signature">
265
+
266
+ <a href="#stack_name-instance_method" title="#stack_name (instance method)">#<strong>stack_name</strong> &#x21d2; Object </a>
267
+
268
+
269
+
270
+ </span>
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+ <span class="summary_desc"><div class='inline'></div></span>
281
+
282
+ </li>
283
+
284
+
285
+ <li class="public ">
286
+ <span class="summary_signature">
287
+
288
+ <a href="#to_cf-instance_method" title="#to_cf (instance method)">#<strong>to_cf</strong> &#x21d2; Object </a>
289
+
290
+
291
+
292
+ </span>
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+ <span class="summary_desc"><div class='inline'></div></span>
303
+
304
+ </li>
305
+
306
+
307
+ <li class="public ">
308
+ <span class="summary_signature">
309
+
310
+ <a href="#valid%3F-instance_method" title="#valid? (instance method)">#<strong>valid?</strong> &#x21d2; Boolean </a>
311
+
312
+
313
+
314
+ </span>
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+ <span class="summary_desc"><div class='inline'></div></span>
325
+
326
+ </li>
327
+
328
+
329
+ </ul>
330
+
331
+
332
+ <div id="constructor_details" class="method_details_list">
333
+ <h2>Constructor Details</h2>
334
+
335
+ <div class="method_details first">
336
+ <h3 class="signature first" id="initialize-instance_method">
337
+
338
+ #<strong>initialize</strong>(name, pattern = nil) &#x21d2; <tt><span class='object_link'><a href="" title="Humidifier::Reservoir::Stack (class)">Stack</a></span></tt>
339
+
340
+
341
+
342
+
343
+
344
+ </h3><div class="docstring">
345
+ <div class="discussion">
346
+
347
+ <p>Returns a new instance of Stack</p>
348
+
349
+
350
+ </div>
351
+ </div>
352
+ <div class="tags">
353
+
354
+
355
+ </div><table class="source_code">
356
+ <tr>
357
+ <td>
358
+ <pre class="lines">
359
+
360
+
361
+ 9
362
+ 10
363
+ 11
364
+ 12</pre>
365
+ </td>
366
+ <td>
367
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 9</span>
368
+
369
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_pattern'>pattern</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
370
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
371
+ <span class='ivar'>@pattern</span> <span class='op'>=</span> <span class='id identifier rubyid_pattern'>pattern</span>
372
+ <span class='kw'>end</span></pre>
373
+ </td>
374
+ </tr>
375
+ </table>
376
+ </div>
377
+
378
+ </div>
379
+
380
+ <div id="instance_attr_details" class="attr_details">
381
+ <h2>Instance Attribute Details</h2>
382
+
383
+
384
+ <span id=""></span>
385
+ <div class="method_details first">
386
+ <h3 class="signature first" id="name-instance_method">
387
+
388
+ #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
389
+
390
+
391
+
392
+
393
+
394
+ </h3><div class="docstring">
395
+ <div class="discussion">
396
+
397
+ <p>Returns the value of attribute name</p>
398
+
399
+
400
+ </div>
401
+ </div>
402
+ <div class="tags">
403
+
404
+
405
+ </div><table class="source_code">
406
+ <tr>
407
+ <td>
408
+ <pre class="lines">
409
+
410
+
411
+ 7
412
+ 8
413
+ 9</pre>
414
+ </td>
415
+ <td>
416
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 7</span>
417
+
418
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
419
+ <span class='ivar'>@name</span>
420
+ <span class='kw'>end</span></pre>
421
+ </td>
422
+ </tr>
423
+ </table>
424
+ </div>
425
+
426
+
427
+ <span id=""></span>
428
+ <div class="method_details ">
429
+ <h3 class="signature " id="pattern-instance_method">
430
+
431
+ #<strong>pattern</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
432
+
433
+
434
+
435
+
436
+
437
+ </h3><div class="docstring">
438
+ <div class="discussion">
439
+
440
+ <p>Returns the value of attribute pattern</p>
441
+
442
+
443
+ </div>
444
+ </div>
445
+ <div class="tags">
446
+
447
+
448
+ </div><table class="source_code">
449
+ <tr>
450
+ <td>
451
+ <pre class="lines">
452
+
453
+
454
+ 7
455
+ 8
456
+ 9</pre>
457
+ </td>
458
+ <td>
459
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 7</span>
460
+
461
+ <span class='kw'>def</span> <span class='id identifier rubyid_pattern'>pattern</span>
462
+ <span class='ivar'>@pattern</span>
463
+ <span class='kw'>end</span></pre>
464
+ </td>
465
+ </tr>
466
+ </table>
467
+ </div>
468
+
469
+ </div>
470
+
471
+
472
+ <div id="instance_method_details" class="method_details_list">
473
+ <h2>Instance Method Details</h2>
474
+
475
+
476
+ <div class="method_details first">
477
+ <h3 class="signature first" id="deploy-instance_method">
478
+
479
+ #<strong>deploy</strong>(wait = false) &#x21d2; <tt>Object</tt>
480
+
481
+
482
+
483
+
484
+
485
+ </h3><table class="source_code">
486
+ <tr>
487
+ <td>
488
+ <pre class="lines">
489
+
490
+
491
+ 14
492
+ 15
493
+ 16
494
+ 17
495
+ 18
496
+ 19
497
+ 20
498
+ 21
499
+ 22
500
+ 23</pre>
501
+ </td>
502
+ <td>
503
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 14</span>
504
+
505
+ <span class='kw'>def</span> <span class='id identifier rubyid_deploy'>deploy</span><span class='lparen'>(</span><span class='id identifier rubyid_wait'>wait</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
506
+ <span class='kw'>if</span> <span class='id identifier rubyid_humidifier_stack'>humidifier_stack</span><span class='period'>.</span><span class='id identifier rubyid_resources'>resources</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
507
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Refusing to deploy stack </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_humidifier_stack'>humidifier_stack</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> with no resources</span><span class='tstring_end'>&quot;</span></span>
508
+ <span class='kw'>return</span>
509
+ <span class='kw'>end</span>
510
+ <span class='id identifier rubyid_valid?'>valid?</span>
511
+
512
+ <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>capabilities:</span> <span class='qwords_beg'>%w[</span><span class='tstring_content'>CAPABILITY_IAM</span><span class='words_sep'> </span><span class='tstring_content'>CAPABILITY_NAMED_IAM</span><span class='words_sep'>]</span> <span class='rbrace'>}</span>
513
+ <span class='id identifier rubyid_wait'>wait</span> <span class='op'>?</span> <span class='id identifier rubyid_humidifier_stack'>humidifier_stack</span><span class='period'>.</span><span class='id identifier rubyid_deploy_and_wait'>deploy_and_wait</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_humidifier_stack'>humidifier_stack</span><span class='period'>.</span><span class='id identifier rubyid_deploy'>deploy</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
514
+ <span class='kw'>end</span></pre>
515
+ </td>
516
+ </tr>
517
+ </table>
518
+ </div>
519
+
520
+ <div class="method_details ">
521
+ <h3 class="signature " id="resources-instance_method">
522
+
523
+ #<strong>resources</strong> &#x21d2; <tt>Object</tt>
524
+
525
+
526
+
527
+
528
+
529
+ </h3><table class="source_code">
530
+ <tr>
531
+ <td>
532
+ <pre class="lines">
533
+
534
+
535
+ 25
536
+ 26
537
+ 27
538
+ 28
539
+ 29</pre>
540
+ </td>
541
+ <td>
542
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 25</span>
543
+
544
+ <span class='kw'>def</span> <span class='id identifier rubyid_resources'>resources</span>
545
+ <span class='const'><span class='object_link'><a href="../Reservoir.html" title="Humidifier::Reservoir (module)">Reservoir</a></span></span><span class='period'>.</span><span class='id identifier rubyid_files_for'><span class='object_link'><a href="../Reservoir.html#files_for-class_method" title="Humidifier::Reservoir.files_for (method)">files_for</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_resources'>resources</span><span class='op'>|</span>
546
+ <span class='id identifier rubyid_resources'>resources</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.yml</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span>
547
+ <span class='kw'>end</span>
548
+ <span class='kw'>end</span></pre>
549
+ </td>
550
+ </tr>
551
+ </table>
552
+ </div>
553
+
554
+ <div class="method_details ">
555
+ <h3 class="signature " id="stack_name-instance_method">
556
+
557
+ #<strong>stack_name</strong> &#x21d2; <tt>Object</tt>
558
+
559
+
560
+
561
+
562
+
563
+ </h3><table class="source_code">
564
+ <tr>
565
+ <td>
566
+ <pre class="lines">
567
+
568
+
569
+ 31
570
+ 32
571
+ 33</pre>
572
+ </td>
573
+ <td>
574
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 31</span>
575
+
576
+ <span class='kw'>def</span> <span class='id identifier rubyid_stack_name'>stack_name</span>
577
+ <span class='ivar'>@stack_name</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Reservoir.html" title="Humidifier::Reservoir (module)">Reservoir</a></span></span><span class='period'>.</span><span class='id identifier rubyid_stack_prefix'><span class='object_link'><a href="../Reservoir.html#stack_prefix-class_method" title="Humidifier::Reservoir.stack_prefix (method)">stack_prefix</a></span></span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
578
+ <span class='kw'>end</span></pre>
579
+ </td>
580
+ </tr>
581
+ </table>
582
+ </div>
583
+
584
+ <div class="method_details ">
585
+ <h3 class="signature " id="to_cf-instance_method">
586
+
587
+ #<strong>to_cf</strong> &#x21d2; <tt>Object</tt>
588
+
589
+
590
+
591
+
592
+
593
+ </h3><table class="source_code">
594
+ <tr>
595
+ <td>
596
+ <pre class="lines">
597
+
598
+
599
+ 35
600
+ 36
601
+ 37</pre>
602
+ </td>
603
+ <td>
604
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 35</span>
605
+
606
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_cf'>to_cf</span>
607
+ <span class='id identifier rubyid_humidifier_stack'>humidifier_stack</span><span class='period'>.</span><span class='id identifier rubyid_to_cf'>to_cf</span>
608
+ <span class='kw'>end</span></pre>
609
+ </td>
610
+ </tr>
611
+ </table>
612
+ </div>
613
+
614
+ <div class="method_details ">
615
+ <h3 class="signature " id="valid?-instance_method">
616
+
617
+ #<strong>valid?</strong> &#x21d2; <tt>Boolean</tt>
618
+
619
+
620
+
621
+
622
+
623
+ </h3><div class="docstring">
624
+ <div class="discussion">
625
+
626
+
627
+ </div>
628
+ </div>
629
+ <div class="tags">
630
+
631
+ <p class="tag_title">Returns:</p>
632
+ <ul class="return">
633
+
634
+ <li>
635
+
636
+
637
+ <span class='type'>(<tt>Boolean</tt>)</span>
638
+
639
+
640
+
641
+ </li>
642
+
643
+ </ul>
644
+
645
+ </div><table class="source_code">
646
+ <tr>
647
+ <td>
648
+ <pre class="lines">
649
+
650
+
651
+ 39
652
+ 40
653
+ 41
654
+ 42
655
+ 43
656
+ 44
657
+ 45
658
+ 46</pre>
659
+ </td>
660
+ <td>
661
+ <pre class="code"><span class="info file"># File 'lib/humidifier/reservoir/stack.rb', line 39</span>
662
+
663
+ <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
664
+ <span class='id identifier rubyid_humidifier_stack'>humidifier_stack</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
665
+ <span class='kw'>rescue</span> <span class='const'>Aws</span><span class='op'>::</span><span class='const'>CloudFormation</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>AccessDenied</span>
666
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Error.html" title="Humidifier::Reservoir::Error (class)">Error</a></span></span><span class='comma'>,</span> <span class='heredoc_beg'>&lt;&lt;-MSG</span>
667
+ <span class='tstring_content'>The authenticated AWS profile does not have the requisite permissions to run
668
+ this command. Ensure the profile has cloudformation:ValidateTemplate.
669
+ </span><span class='heredoc_end'>MSG
670
+ </span><span class='kw'>end</span></pre>
671
+ </td>
672
+ </tr>
673
+ </table>
674
+ </div>
675
+
676
+ </div>
677
+
678
+ </div>
679
+
680
+ <div id="footer">
681
+ Generated on Sun Oct 1 09:25:22 2017 by
682
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
683
+ 0.9.9 (ruby-2.4.1).
684
+ </div>
685
+
686
+ </div>
687
+ </body>
688
+ </html>