automate_soup 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/AutomateSoup.html +508 -88
- data/docs/AutomateSoup/API.html +1 -1
- data/docs/AutomateSoup/Change.html +57 -21
- data/docs/AutomateSoup/Credentials.html +1 -1
- data/docs/AutomateSoup/Rest.html +1 -1
- data/docs/AutomateSoup/Stage.html +13 -13
- data/docs/_index.html +1 -1
- data/docs/coverage/.resultset.json +1 -1
- data/docs/coverage/index.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/top-level-namespace.html +1 -1
- data/lib/automate_soup.rb +37 -7
- data/lib/automate_soup/change.rb +8 -4
- data/lib/automate_soup/version.rb +1 -1
- metadata +2 -2
data/docs/AutomateSoup/API.html
CHANGED
@@ -1164,7 +1164,7 @@
|
|
1164
1164
|
</div>
|
1165
1165
|
|
1166
1166
|
<div id="footer">
|
1167
|
-
Generated on
|
1167
|
+
Generated on Tue Dec 19 09:58:14 2017 by
|
1168
1168
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1169
1169
|
0.9.9 (ruby-2.4.1).
|
1170
1170
|
</div>
|
@@ -152,7 +152,7 @@
|
|
152
152
|
<li class="public ">
|
153
153
|
<span class="summary_signature">
|
154
154
|
|
155
|
-
<a href="#approve-instance_method" title="#approve (instance method)">#<strong>approve</strong> ⇒
|
155
|
+
<a href="#approve-instance_method" title="#approve (instance method)">#<strong>approve</strong> ⇒ Boolean </a>
|
156
156
|
|
157
157
|
|
158
158
|
|
@@ -200,7 +200,7 @@
|
|
200
200
|
<li class="public ">
|
201
201
|
<span class="summary_signature">
|
202
202
|
|
203
|
-
<a href="#deliver-instance_method" title="#deliver (instance method)">#<strong>deliver</strong> ⇒
|
203
|
+
<a href="#deliver-instance_method" title="#deliver (instance method)">#<strong>deliver</strong> ⇒ Boolean </a>
|
204
204
|
|
205
205
|
|
206
206
|
|
@@ -520,7 +520,7 @@
|
|
520
520
|
<div class="method_details ">
|
521
521
|
<h3 class="signature " id="approve-instance_method">
|
522
522
|
|
523
|
-
#<strong>approve</strong> ⇒ <tt>
|
523
|
+
#<strong>approve</strong> ⇒ <tt>Boolean</tt>
|
524
524
|
|
525
525
|
|
526
526
|
|
@@ -529,13 +529,31 @@
|
|
529
529
|
</h3><div class="docstring">
|
530
530
|
<div class="discussion">
|
531
531
|
|
532
|
-
<p>Approve this change.</p>
|
532
|
+
<p>Approve this change. Raise exceptions where applicable.</p>
|
533
533
|
|
534
534
|
|
535
535
|
</div>
|
536
536
|
</div>
|
537
537
|
<div class="tags">
|
538
538
|
|
539
|
+
<p class="tag_title">Returns:</p>
|
540
|
+
<ul class="return">
|
541
|
+
|
542
|
+
<li>
|
543
|
+
|
544
|
+
|
545
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
—
|
550
|
+
<div class='inline'>
|
551
|
+
<p>true if the change was approved, false otherwise.</p>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
</li>
|
555
|
+
|
556
|
+
</ul>
|
539
557
|
|
540
558
|
</div><table class="source_code">
|
541
559
|
<tr>
|
@@ -543,8 +561,6 @@
|
|
543
561
|
<pre class="lines">
|
544
562
|
|
545
563
|
|
546
|
-
74
|
547
|
-
75
|
548
564
|
76
|
549
565
|
77
|
550
566
|
78
|
@@ -555,15 +571,17 @@
|
|
555
571
|
83
|
556
572
|
84
|
557
573
|
85
|
558
|
-
86
|
574
|
+
86
|
575
|
+
87
|
576
|
+
88</pre>
|
559
577
|
</td>
|
560
578
|
<td>
|
561
|
-
<pre class="code"><span class="info file"># File 'lib/automate_soup/change.rb', line
|
579
|
+
<pre class="code"><span class="info file"># File 'lib/automate_soup/change.rb', line 76</span>
|
562
580
|
|
563
581
|
<span class='kw'>def</span> <span class='id identifier rubyid_approve'>approve</span>
|
564
|
-
<span class='kw'>return</span> <span class='kw'>
|
582
|
+
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_current_stage'>current_stage</span><span class='period'>.</span><span class='id identifier rubyid_stage'>stage</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>verify</span><span class='tstring_end'>'</span></span>
|
565
583
|
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Must run AutomateSoup.setup first</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_url'><span class='object_link'><a href="../AutomateSoup.html#url-class_method" title="AutomateSoup.url (method)">url</a></span></span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_credentials'><span class='object_link'><a href="../AutomateSoup.html#credentials-class_method" title="AutomateSoup.credentials (method)">credentials</a></span></span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
566
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'
|
584
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Approve link not available, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_links'>links</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_links'>links</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_links'>links</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>approve</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_links'>links</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>approve</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>href</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
567
585
|
<span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_url'><span class='object_link'><a href="../AutomateSoup.html#url-class_method" title="AutomateSoup.url (method)">url</a></span></span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_links'>links</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>approve</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>href</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
568
586
|
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Rest.html" title="AutomateSoup::Rest (module)">Rest</a></span></span><span class='period'>.</span><span class='id identifier rubyid_post'><span class='object_link'><a href="Rest.html#post-class_method" title="AutomateSoup::Rest.post (method)">post</a></span></span><span class='lparen'>(</span>
|
569
587
|
<span class='label'>url:</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span>
|
@@ -640,7 +658,7 @@
|
|
640
658
|
<div class="method_details ">
|
641
659
|
<h3 class="signature " id="deliver-instance_method">
|
642
660
|
|
643
|
-
#<strong>deliver</strong> ⇒ <tt>
|
661
|
+
#<strong>deliver</strong> ⇒ <tt>Boolean</tt>
|
644
662
|
|
645
663
|
|
646
664
|
|
@@ -649,13 +667,31 @@
|
|
649
667
|
</h3><div class="docstring">
|
650
668
|
<div class="discussion">
|
651
669
|
|
652
|
-
<p>Deliver this change.</p>
|
670
|
+
<p>Deliver this change. Raise exceptions where applicable.</p>
|
653
671
|
|
654
672
|
|
655
673
|
</div>
|
656
674
|
</div>
|
657
675
|
<div class="tags">
|
658
676
|
|
677
|
+
<p class="tag_title">Returns:</p>
|
678
|
+
<ul class="return">
|
679
|
+
|
680
|
+
<li>
|
681
|
+
|
682
|
+
|
683
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
—
|
688
|
+
<div class='inline'>
|
689
|
+
<p>true if the change was delivered, false otherwise.</p>
|
690
|
+
</div>
|
691
|
+
|
692
|
+
</li>
|
693
|
+
|
694
|
+
</ul>
|
659
695
|
|
660
696
|
</div><table class="source_code">
|
661
697
|
<tr>
|
@@ -663,10 +699,6 @@
|
|
663
699
|
<pre class="lines">
|
664
700
|
|
665
701
|
|
666
|
-
90
|
667
|
-
91
|
668
|
-
92
|
669
|
-
93
|
670
702
|
94
|
671
703
|
95
|
672
704
|
96
|
@@ -676,16 +708,20 @@
|
|
676
708
|
100
|
677
709
|
101
|
678
710
|
102
|
679
|
-
103
|
711
|
+
103
|
712
|
+
104
|
713
|
+
105
|
714
|
+
106
|
715
|
+
107</pre>
|
680
716
|
</td>
|
681
717
|
<td>
|
682
|
-
<pre class="code"><span class="info file"># File 'lib/automate_soup/change.rb', line
|
718
|
+
<pre class="code"><span class="info file"># File 'lib/automate_soup/change.rb', line 94</span>
|
683
719
|
|
684
720
|
<span class='kw'>def</span> <span class='id identifier rubyid_deliver'>deliver</span>
|
685
721
|
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Must approve change first</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_current_stage'>current_stage</span><span class='period'>.</span><span class='id identifier rubyid_stage'>stage</span><span class='period'>.</span><span class='id identifier rubyid_eql?'>eql?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>verify</span><span class='tstring_end'>'</span></span>
|
686
|
-
<span class='kw'>return</span> <span class='kw'>
|
722
|
+
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_current_stage'>current_stage</span><span class='period'>.</span><span class='id identifier rubyid_stage'>stage</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>acceptance</span><span class='tstring_end'>'</span></span>
|
687
723
|
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Must run AutomateSoup.setup first</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_url'><span class='object_link'><a href="../AutomateSoup.html#url-class_method" title="AutomateSoup.url (method)">url</a></span></span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_credentials'><span class='object_link'><a href="../AutomateSoup.html#credentials-class_method" title="AutomateSoup.credentials (method)">credentials</a></span></span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
688
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'
|
724
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Deliver link not available, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_links'>links</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_links'>links</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_links'>links</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>deliver</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_links'>links</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>deliver</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>href</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
689
725
|
<span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_url'><span class='object_link'><a href="../AutomateSoup.html#url-class_method" title="AutomateSoup.url (method)">url</a></span></span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_links'>links</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>deliver</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>href</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
690
726
|
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../AutomateSoup.html" title="AutomateSoup (module)">AutomateSoup</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Rest.html" title="AutomateSoup::Rest (module)">Rest</a></span></span><span class='period'>.</span><span class='id identifier rubyid_post'><span class='object_link'><a href="Rest.html#post-class_method" title="AutomateSoup::Rest.post (method)">post</a></span></span><span class='lparen'>(</span>
|
691
727
|
<span class='label'>url:</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span>
|
@@ -882,7 +918,7 @@
|
|
882
918
|
</div>
|
883
919
|
|
884
920
|
<div id="footer">
|
885
|
-
Generated on
|
921
|
+
Generated on Tue Dec 19 09:58:14 2017 by
|
886
922
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
887
923
|
0.9.9 (ruby-2.4.1).
|
888
924
|
</div>
|
@@ -442,7 +442,7 @@
|
|
442
442
|
</div>
|
443
443
|
|
444
444
|
<div id="footer">
|
445
|
-
Generated on
|
445
|
+
Generated on Tue Dec 19 09:58:14 2017 by
|
446
446
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
447
447
|
0.9.9 (ruby-2.4.1).
|
448
448
|
</div>
|
data/docs/AutomateSoup/Rest.html
CHANGED
@@ -311,7 +311,7 @@
|
|
311
311
|
</div>
|
312
312
|
|
313
313
|
<div id="footer">
|
314
|
-
Generated on
|
314
|
+
Generated on Tue Dec 19 09:58:14 2017 by
|
315
315
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
316
316
|
0.9.9 (ruby-2.4.1).
|
317
317
|
</div>
|
@@ -249,12 +249,12 @@
|
|
249
249
|
<pre class="lines">
|
250
250
|
|
251
251
|
|
252
|
+
8
|
252
253
|
9
|
253
|
-
10
|
254
|
-
11</pre>
|
254
|
+
10</pre>
|
255
255
|
</td>
|
256
256
|
<td>
|
257
|
-
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line
|
257
|
+
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line 8</span>
|
258
258
|
|
259
259
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
260
260
|
<span class='ivar'>@source</span> <span class='op'>=</span> <span class='const'>OpenStruct</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_hash'>hash</span>
|
@@ -287,12 +287,12 @@
|
|
287
287
|
<pre class="lines">
|
288
288
|
|
289
289
|
|
290
|
+
12
|
290
291
|
13
|
291
|
-
14
|
292
|
-
15</pre>
|
292
|
+
14</pre>
|
293
293
|
</td>
|
294
294
|
<td>
|
295
|
-
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line
|
295
|
+
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line 12</span>
|
296
296
|
|
297
297
|
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
298
298
|
<span class='ivar'>@source</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
@@ -346,12 +346,12 @@
|
|
346
346
|
<pre class="lines">
|
347
347
|
|
348
348
|
|
349
|
+
20
|
349
350
|
21
|
350
|
-
22
|
351
|
-
23</pre>
|
351
|
+
22</pre>
|
352
352
|
</td>
|
353
353
|
<td>
|
354
|
-
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line
|
354
|
+
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line 20</span>
|
355
355
|
|
356
356
|
<span class='kw'>def</span> <span class='id identifier rubyid_failed?'>failed?</span>
|
357
357
|
<span class='ivar'>@source</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_eql?'>eql?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>failed</span><span class='tstring_end'>'</span></span>
|
@@ -398,12 +398,12 @@
|
|
398
398
|
<pre class="lines">
|
399
399
|
|
400
400
|
|
401
|
+
16
|
401
402
|
17
|
402
|
-
18
|
403
|
-
19</pre>
|
403
|
+
18</pre>
|
404
404
|
</td>
|
405
405
|
<td>
|
406
|
-
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line
|
406
|
+
<pre class="code"><span class="info file"># File 'lib/automate_soup/stage.rb', line 16</span>
|
407
407
|
|
408
408
|
<span class='kw'>def</span> <span class='id identifier rubyid_passed?'>passed?</span>
|
409
409
|
<span class='ivar'>@source</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_eql?'>eql?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>passed</span><span class='tstring_end'>'</span></span>
|
@@ -418,7 +418,7 @@
|
|
418
418
|
</div>
|
419
419
|
|
420
420
|
<div id="footer">
|
421
|
-
Generated on
|
421
|
+
Generated on Tue Dec 19 09:58:14 2017 by
|
422
422
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
423
423
|
0.9.9 (ruby-2.4.1).
|
424
424
|
</div>
|
data/docs/_index.html
CHANGED
@@ -156,7 +156,7 @@
|
|
156
156
|
</div>
|
157
157
|
|
158
158
|
<div id="footer">
|
159
|
-
Generated on
|
159
|
+
Generated on Tue Dec 19 09:58:13 2017 by
|
160
160
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
161
161
|
0.9.9 (ruby-2.4.1).
|
162
162
|
</div>
|
data/docs/coverage/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<img src="./assets/0.10.2/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2017-12-
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2017-12-19T10:03:37-05:00">2017-12-19T10:03:37-05:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
data/docs/file.README.html
CHANGED
@@ -201,7 +201,7 @@ conduct[https://github.com/[USERNAME]/automate_soup/blob/master/CODE_OF_CONDUCT.
|
|
201
201
|
</div></div>
|
202
202
|
|
203
203
|
<div id="footer">
|
204
|
-
Generated on
|
204
|
+
Generated on Tue Dec 19 09:58:13 2017 by
|
205
205
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
206
206
|
0.9.9 (ruby-2.4.1).
|
207
207
|
</div>
|
data/docs/index.html
CHANGED
@@ -201,7 +201,7 @@ conduct[https://github.com/[USERNAME]/automate_soup/blob/master/CODE_OF_CONDUCT.
|
|
201
201
|
</div></div>
|
202
202
|
|
203
203
|
<div id="footer">
|
204
|
-
Generated on
|
204
|
+
Generated on Tue Dec 19 09:58:13 2017 by
|
205
205
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
206
206
|
0.9.9 (ruby-2.4.1).
|
207
207
|
</div>
|
@@ -100,7 +100,7 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on
|
103
|
+
Generated on Tue Dec 19 09:58:13 2017 by
|
104
104
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
105
|
0.9.9 (ruby-2.4.1).
|
106
106
|
</div>
|
data/lib/automate_soup.rb
CHANGED
@@ -61,21 +61,36 @@ module AutomateSoup
|
|
61
61
|
end
|
62
62
|
|
63
63
|
##
|
64
|
-
#
|
64
|
+
# Get the projects under and organization given the enterprise.
|
65
|
+
#
|
66
|
+
# @option enterprise [String] the enterprise to fetch org from, defaults to
|
67
|
+
# default.
|
68
|
+
# @option organization [String] the organization to fetch projects from.
|
65
69
|
#
|
66
70
|
def projects(enterprise: 'default', organization: nil)
|
67
71
|
@api.projects(enterprise: enterprise, organization: organization)
|
68
72
|
end
|
69
73
|
|
70
74
|
##
|
71
|
-
# Fetch all pipelines
|
75
|
+
# Fetch all project pipelines under an enterprise, organization pair
|
76
|
+
#
|
77
|
+
# @option enterprise [String] the enterprise to fetch org from, defaults to
|
78
|
+
# default.
|
79
|
+
# @option organization [String] the organization to fetch pipelines from.
|
80
|
+
# @option project [String] the project to fetch pipelines from.
|
72
81
|
#
|
73
82
|
def pipelines(enterprise: 'default', organization: nil, project: nil)
|
74
83
|
@api.pipelines(enterprise: enterprise, organization: organization, project: project)
|
75
84
|
end
|
76
85
|
|
77
86
|
##
|
78
|
-
# Fetch a pipeline
|
87
|
+
# Fetch a projects pipeline under an enterprise, organization pair
|
88
|
+
#
|
89
|
+
# @option enterprise [String] the enterprise to fetch org from, defaults to
|
90
|
+
# default.
|
91
|
+
# @option organization [String] the organization to fetch from.
|
92
|
+
# @option project [String] the project to fetch from.
|
93
|
+
# @option pipeline [String] the pipeline to fetch from.
|
79
94
|
#
|
80
95
|
def pipeline(enterprise: 'default', organization: nil, project: nil, pipeline: nil)
|
81
96
|
arr = []
|
@@ -94,6 +109,7 @@ module AutomateSoup
|
|
94
109
|
# @option project [String] the project to fetch from.
|
95
110
|
# @option pipeline [String] the pipeline to fetch from.
|
96
111
|
#
|
112
|
+
# @return [Array] an array of strings holding change topics.
|
97
113
|
def pipeline_topics(enterprise: 'default', organization: nil, project: nil, pipeline: nil)
|
98
114
|
self.pipeline(
|
99
115
|
enterprise: enterprise,
|
@@ -113,6 +129,7 @@ module AutomateSoup
|
|
113
129
|
# @option pipeline [String] the pipeline to fetch from.
|
114
130
|
# @option topic [String] the topic to fetch a change from.
|
115
131
|
#
|
132
|
+
# @return [AutomateSoup::Change] the change coresponding to the given topic.
|
116
133
|
def change_by_topic(enterprise: @enterprise, organization: @organization, project: @project, pipeline: @pipeline, topic: nil)
|
117
134
|
o = self.pipeline(
|
118
135
|
enterprise: enterprise,
|
@@ -137,6 +154,7 @@ module AutomateSoup
|
|
137
154
|
# to 10
|
138
155
|
# @option retries [Integer] the amount of retries to make, defaults to 5
|
139
156
|
#
|
157
|
+
# @return [Boolean] true if the change was approved, false otherwise.
|
140
158
|
def approve_change(enterprise: @enterprise, organization: @organization, project: @project, pipeline: @pipeline, topic: nil, wait: false, timeout: 10, retries: 5)
|
141
159
|
o = self.change_by_topic(
|
142
160
|
enterprise: enterprise,
|
@@ -163,8 +181,13 @@ module AutomateSoup
|
|
163
181
|
end
|
164
182
|
end
|
165
183
|
|
166
|
-
o.approve
|
167
|
-
return true if !wait && o.deliverable?
|
184
|
+
app = o.approve
|
185
|
+
return true if !wait && !app.nil? && o.deliverable?
|
186
|
+
if app.nil? && !o.deliverable?
|
187
|
+
puts "Could not approve change #{o.current_stage.stage}: #{o.current_stage.status}"
|
188
|
+
return false
|
189
|
+
end
|
190
|
+
|
168
191
|
times = 1
|
169
192
|
while times <= retries
|
170
193
|
o = self.change_by_topic(
|
@@ -198,6 +221,7 @@ module AutomateSoup
|
|
198
221
|
# to 10
|
199
222
|
# @option retries [Integer] the amount of retries to make, defaults to 5
|
200
223
|
#
|
224
|
+
# @return [Boolean] true if the change was delivered, false otherwise.
|
201
225
|
def deliver_change(enterprise: @enterprise, organization: @organization, project: @project, pipeline: @pipeline, topic: nil, wait: false, timeout: 10, retries: 5)
|
202
226
|
o = self.change_by_topic(
|
203
227
|
enterprise: enterprise,
|
@@ -225,8 +249,14 @@ module AutomateSoup
|
|
225
249
|
end
|
226
250
|
end
|
227
251
|
|
228
|
-
o.deliver
|
229
|
-
return true if !wait && o.delivered?
|
252
|
+
de = o.deliver
|
253
|
+
return true if !wait && !de.nil? && o.delivered?
|
254
|
+
|
255
|
+
if de.nil? && !o.deliverable?
|
256
|
+
puts "Could not deliver change #{o.current_stage.stage}: #{o.current_stage.status}"
|
257
|
+
return false
|
258
|
+
end
|
259
|
+
|
230
260
|
times = 1
|
231
261
|
while times <= retries
|
232
262
|
o = self.change_by_topic(
|
data/lib/automate_soup/change.rb
CHANGED
@@ -70,11 +70,13 @@ module AutomateSoup
|
|
70
70
|
end
|
71
71
|
|
72
72
|
##
|
73
|
-
# Approve this change.
|
73
|
+
# Approve this change. Raise exceptions where applicable.
|
74
|
+
#
|
75
|
+
# @return [Boolean] true if the change was approved, false otherwise.
|
74
76
|
def approve
|
75
77
|
return nil if current_stage.stage != 'verify'
|
76
78
|
raise 'Must run AutomateSoup.setup first' if AutomateSoup.url.nil? || AutomateSoup.credentials.nil?
|
77
|
-
raise
|
79
|
+
raise "Approve link not available, #{links.inspect}" if links.nil? || links['approve'].nil? || links['approve']['href'].nil?
|
78
80
|
url = "#{AutomateSoup.url}#{links['approve']['href']}"
|
79
81
|
res = AutomateSoup::Rest.post(
|
80
82
|
url: url,
|
@@ -86,12 +88,14 @@ module AutomateSoup
|
|
86
88
|
end
|
87
89
|
|
88
90
|
##
|
89
|
-
# Deliver this change.
|
91
|
+
# Deliver this change. Raise exceptions where applicable.
|
92
|
+
#
|
93
|
+
# @return [Boolean] true if the change was delivered, false otherwise.
|
90
94
|
def deliver
|
91
95
|
raise 'Must approve change first' if current_stage.stage.eql? 'verify'
|
92
96
|
return nil if current_stage.stage != 'acceptance'
|
93
97
|
raise 'Must run AutomateSoup.setup first' if AutomateSoup.url.nil? || AutomateSoup.credentials.nil?
|
94
|
-
raise
|
98
|
+
raise "Deliver link not available, #{links.inspect}" if links.nil? || links['deliver'].nil? || links['deliver']['href'].nil?
|
95
99
|
url = "#{AutomateSoup.url}#{links['deliver']['href']}"
|
96
100
|
res = AutomateSoup::Rest.post(
|
97
101
|
url: url,
|