bauxite 0.4.6 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Bauxite/Action.html +103 -13
- data/doc/Bauxite/ActionModule.html +1 -1
- data/doc/Bauxite/Application.html +1 -1
- data/doc/Bauxite/Context.html +149 -22
- data/doc/Bauxite/Errors/AssertionError.html +1 -1
- data/doc/Bauxite/Errors/FileNotFoundError.html +1 -1
- data/doc/Bauxite/Errors/FormatError.html +1 -1
- data/doc/Bauxite/Errors.html +1 -1
- data/doc/Bauxite/Loggers/CompositeLogger.html +1 -1
- data/doc/Bauxite/Loggers/EchoLogger.html +1 -1
- data/doc/Bauxite/Loggers/FileLogger.html +1 -1
- data/doc/Bauxite/Loggers/NullLogger.html +1 -1
- data/doc/Bauxite/Loggers/TerminalLogger.html +1 -1
- data/doc/Bauxite/Loggers/XtermLogger.html +1 -1
- data/doc/Bauxite/Loggers.html +1 -1
- data/doc/Bauxite/Parser.html +1 -1
- data/doc/Bauxite/ParserModule.html +1 -1
- data/doc/Bauxite/Selector.html +1 -1
- data/doc/Bauxite/SelectorModule.html +1 -1
- data/doc/Bauxite.html +1 -1
- data/doc/README_md.html +1 -1
- data/doc/created.rid +49 -47
- data/doc/index.html +1 -1
- data/doc/js/jquery.js +18 -4
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +68 -48
- data/lib/bauxite/actions/doif.rb +43 -0
- data/lib/bauxite/actions/failif.rb +3 -12
- data/lib/bauxite/actions/setif.rb +40 -0
- data/lib/bauxite/core/context.rb +67 -22
- data/lib/bauxite.rb +1 -1
- data/test/doif.bxt +6 -0
- data/test/setif.bxt +3 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce1815fb5ecd5df03042ee7a5397339bc2f240a3
|
4
|
+
data.tar.gz: 73720085f120a27120f67bb0eeb8b2418ca4eccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4951c5067482ad3de6a6757cd5c31205b020932acb4ed9ac51b7c132a4ceb36e4353015ca10394018f8dd8b65ebfd23f8b553734baa3ed8d3b562c2db06a26df
|
7
|
+
data.tar.gz: 66e4149bd2111fc289535a6c35f9fba6e710acfe72968c61a43cebcdd3c1e60bbf88350df14952a2b4bbefa1099aff597556ab29ff2f3eab33a38f265293eb8c
|
data/doc/Bauxite/Action.html
CHANGED
@@ -107,6 +107,8 @@
|
|
107
107
|
|
108
108
|
<li ><a href="#method-i-debug">#debug</a>
|
109
109
|
|
110
|
+
<li ><a href="#method-i-doif">#doif</a>
|
111
|
+
|
110
112
|
<li ><a href="#method-i-echo">#echo</a>
|
111
113
|
|
112
114
|
<li ><a href="#method-i-exec">#exec</a>
|
@@ -133,6 +135,8 @@
|
|
133
135
|
|
134
136
|
<li ><a href="#method-i-set">#set</a>
|
135
137
|
|
138
|
+
<li ><a href="#method-i-setif">#setif</a>
|
139
|
+
|
136
140
|
<li ><a href="#method-i-source">#source</a>
|
137
141
|
|
138
142
|
<li ><a href="#method-i-store">#store</a>
|
@@ -597,6 +601,56 @@ autocomplete (pressing the <code>TAB</code> key).</p>
|
|
597
601
|
|
598
602
|
|
599
603
|
|
604
|
+
</div>
|
605
|
+
|
606
|
+
|
607
|
+
<div id="method-i-doif" class="method-detail ">
|
608
|
+
|
609
|
+
<div class="method-heading">
|
610
|
+
<span class="method-name">doif</span><span
|
611
|
+
class="method-args">(expected, actual, action, *args)</span>
|
612
|
+
|
613
|
+
<span class="method-click-advice">click to toggle source</span>
|
614
|
+
|
615
|
+
</div>
|
616
|
+
|
617
|
+
|
618
|
+
<div class="method-description">
|
619
|
+
|
620
|
+
<p>Executes <code>action</code> only if <code>expected</code> matches
|
621
|
+
<code>actual</code>.</p>
|
622
|
+
|
623
|
+
<p>The conditional check in this action is similar to <a
|
624
|
+
href="Action.html#method-i-assertv">assertv</a>.</p>
|
625
|
+
|
626
|
+
<p>For example:</p>
|
627
|
+
|
628
|
+
<pre class="ruby"><span class="ruby-identifier">set</span> <span class="ruby-identifier">first</span> <span class="ruby-identifier">john</span>
|
629
|
+
<span class="ruby-identifier">set</span> <span class="ruby-identifier">last</span> <span class="ruby-identifier">doe</span>
|
630
|
+
<span class="ruby-identifier">doif</span> <span class="ruby-identifier">john</span> ${<span class="ruby-identifier">first</span>} <span class="ruby-identifier">assertv</span> <span class="ruby-identifier">doe</span> ${<span class="ruby-identifier">last</span>}
|
631
|
+
<span class="ruby-comment"># => this assertion would pass.</span>
|
632
|
+
|
633
|
+
<span class="ruby-identifier">doif</span> <span class="ruby-identifier">smith</span> ${<span class="ruby-identifier">last</span>} <span class="ruby-identifier">load</span> <span class="ruby-identifier">smith_specific_text</span>.<span class="ruby-identifier">bxt</span>
|
634
|
+
<span class="ruby-comment"># => this would only load smith_specific_text.bxt if the last</span>
|
635
|
+
<span class="ruby-comment"># variable matches 'smith'</span>
|
636
|
+
</pre>
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
<div class="method-source-code" id="doif-source">
|
642
|
+
<pre><span class="ruby-comment"># File lib/bauxite/actions/doif.rb, line 39</span>
|
643
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">doif</span>(<span class="ruby-identifier">expected</span>, <span class="ruby-identifier">actual</span>, <span class="ruby-identifier">action</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
644
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">actual</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">_pattern</span>(<span class="ruby-identifier">expected</span>)
|
645
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">exec_action_object</span>(<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>))
|
646
|
+
<span class="ruby-keyword">end</span></pre>
|
647
|
+
</div>
|
648
|
+
|
649
|
+
</div>
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
|
600
654
|
</div>
|
601
655
|
|
602
656
|
|
@@ -739,19 +793,10 @@ href="Action.html#method-i-test">test</a>, etc.) is undefined.</p>
|
|
739
793
|
<div class="method-source-code" id="failif-source">
|
740
794
|
<pre><span class="ruby-comment"># File lib/bauxite/actions/failif.rb, line 40</span>
|
741
795
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">failif</span>(<span class="ruby-identifier">action</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
742
|
-
<span class="ruby-
|
743
|
-
|
744
|
-
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">with_timeout</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span> <span class="ruby-keyword">do</span>
|
745
|
-
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">with_vars</span>({ <span class="ruby-string">'__TIMEOUT__'</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>}) <span class="ruby-keyword">do</span>
|
746
|
-
<span class="ruby-keyword">begin</span>
|
747
|
-
<span class="ruby-identifier">ret</span> = <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">exec_action_object</span>(<span class="ruby-identifier">action</span>)
|
748
|
-
<span class="ruby-identifier">ret</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:call</span>
|
749
|
-
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>
|
750
|
-
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
|
751
|
-
<span class="ruby-keyword">end</span>
|
752
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>, <span class="ruby-node">"Assertion did not failed as expected:#{action.text}"</span>
|
753
|
-
<span class="ruby-keyword">end</span>
|
796
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">try_exec_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
|
797
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>, <span class="ruby-node">"Assertion did not failed as expected:#{action} #{args.join(' ')}"</span>
|
754
798
|
<span class="ruby-keyword">end</span>
|
799
|
+
<span class="ruby-keyword">true</span>
|
755
800
|
<span class="ruby-keyword">end</span></pre>
|
756
801
|
</div>
|
757
802
|
|
@@ -1272,6 +1317,51 @@ href="Context.html#method-i-expand">Bauxite::Context#expand</a>).</p>
|
|
1272
1317
|
|
1273
1318
|
|
1274
1319
|
|
1320
|
+
</div>
|
1321
|
+
|
1322
|
+
|
1323
|
+
<div id="method-i-setif" class="method-detail ">
|
1324
|
+
|
1325
|
+
<div class="method-heading">
|
1326
|
+
<span class="method-name">setif</span><span
|
1327
|
+
class="method-args">(name, value, action, *args)</span>
|
1328
|
+
|
1329
|
+
<span class="method-click-advice">click to toggle source</span>
|
1330
|
+
|
1331
|
+
</div>
|
1332
|
+
|
1333
|
+
|
1334
|
+
<div class="method-description">
|
1335
|
+
|
1336
|
+
<p>Sets the variable named <code>name</code> to the <code>value</code>
|
1337
|
+
specified only if the. <code>action</code> execution succeeds. If the
|
1338
|
+
execution fails, the value of <code>name</code> is left unchanged.</p>
|
1339
|
+
|
1340
|
+
<p>For example:</p>
|
1341
|
+
|
1342
|
+
<pre class="ruby"><span class="ruby-identifier">set</span> <span class="ruby-identifier">name</span> <span class="ruby-identifier">john</span>
|
1343
|
+
<span class="ruby-identifier">setif</span> <span class="ruby-identifier">is_john</span> <span class="ruby-keyword">true</span> <span class="ruby-identifier">assertv</span> <span class="ruby-string">"/John/i"</span> <span class="ruby-string">"${name}"</span>
|
1344
|
+
<span class="ruby-identifier">assertv</span> <span class="ruby-keyword">true</span> ${<span class="ruby-identifier">is_john</span>]}
|
1345
|
+
<span class="ruby-comment"># => the assertion would pass</span>
|
1346
|
+
</pre>
|
1347
|
+
|
1348
|
+
|
1349
|
+
|
1350
|
+
|
1351
|
+
<div class="method-source-code" id="setif-source">
|
1352
|
+
<pre><span class="ruby-comment"># File lib/bauxite/actions/setif.rb, line 35</span>
|
1353
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setif</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">action</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
1354
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">try_exec_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
|
1355
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">variables</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
|
1356
|
+
<span class="ruby-keyword">true</span>
|
1357
|
+
<span class="ruby-keyword">end</span></pre>
|
1358
|
+
</div>
|
1359
|
+
|
1360
|
+
</div>
|
1361
|
+
|
1362
|
+
|
1363
|
+
|
1364
|
+
|
1275
1365
|
</div>
|
1276
1366
|
|
1277
1367
|
|
@@ -1633,7 +1723,7 @@ href="Context.html#method-i-expand">Bauxite::Context#expand</a>).</p>
|
|
1633
1723
|
|
1634
1724
|
<footer id="validator-badges" role="contentinfo">
|
1635
1725
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
1636
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
1726
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
1637
1727
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1638
1728
|
</footer>
|
1639
1729
|
|
@@ -336,7 +336,7 @@ might yield different results.</p>
|
|
336
336
|
|
337
337
|
<footer id="validator-badges" role="contentinfo">
|
338
338
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
339
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
339
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
340
340
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
341
341
|
</footer>
|
342
342
|
|
@@ -253,7 +253,7 @@ indicates success).</p>
|
|
253
253
|
|
254
254
|
<footer id="validator-badges" role="contentinfo">
|
255
255
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
256
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
256
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
257
257
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
258
258
|
</footer>
|
259
259
|
|
data/doc/Bauxite/Context.html
CHANGED
@@ -128,6 +128,8 @@
|
|
128
128
|
|
129
129
|
<li ><a href="#method-i-exec_file">#exec_file</a>
|
130
130
|
|
131
|
+
<li ><a href="#method-i-exec_parsed_action">#exec_parsed_action</a>
|
132
|
+
|
131
133
|
<li ><a href="#method-i-expand">#expand</a>
|
132
134
|
|
133
135
|
<li ><a href="#method-i-find">#find</a>
|
@@ -144,6 +146,8 @@
|
|
144
146
|
|
145
147
|
<li ><a href="#method-i-stop">#stop</a>
|
146
148
|
|
149
|
+
<li ><a href="#method-i-try_exec_action">#try_exec_action</a>
|
150
|
+
|
147
151
|
<li ><a href="#method-i-with_driver_timeout">#with_driver_timeout</a>
|
148
152
|
|
149
153
|
<li ><a href="#method-i-with_timeout">#with_timeout</a>
|
@@ -802,7 +806,7 @@ logger type.</p>
|
|
802
806
|
|
803
807
|
|
804
808
|
<div class="method-source-code" id="load_logger-source">
|
805
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
809
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 448</span>
|
806
810
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">load_logger</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>)
|
807
811
|
<span class="ruby-identifier">log_name</span> = (<span class="ruby-identifier">name</span> <span class="ruby-operator">||</span> <span class="ruby-string">'null'</span>).<span class="ruby-identifier">downcase</span>
|
808
812
|
|
@@ -844,7 +848,7 @@ logger type.</p>
|
|
844
848
|
|
845
849
|
|
846
850
|
<div class="method-source-code" id="parse_action_default-source">
|
847
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
851
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 470</span>
|
848
852
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parse_action_default</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span> = <span class="ruby-string">'<unknown>'</span>, <span class="ruby-identifier">line</span> = <span class="ruby-value">0</span>)
|
849
853
|
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">' '</span>, <span class="ruby-value">2</span>)
|
850
854
|
<span class="ruby-keyword">begin</span>
|
@@ -912,7 +916,7 @@ logger type.</p>
|
|
912
916
|
|
913
917
|
|
914
918
|
<div class="method-source-code" id="wait-source">
|
915
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
919
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 441</span>
|
916
920
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">wait</span>
|
917
921
|
<span class="ruby-constant">Readline</span>.<span class="ruby-identifier">readline</span>(<span class="ruby-string">"Press ENTER to continue\n"</span>)
|
918
922
|
<span class="ruby-keyword">end</span></pre>
|
@@ -954,7 +958,7 @@ with the arguments specified in <code>args</code>.</p>
|
|
954
958
|
|
955
959
|
|
956
960
|
<div class="method-source-code" id="add_alias-source">
|
957
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
961
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 464</span>
|
958
962
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_alias</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
|
959
963
|
<span class="ruby-ivar">@aliases</span>[<span class="ruby-identifier">name</span>] = { <span class="ruby-value">:action</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>, <span class="ruby-value">:args</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span> }
|
960
964
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1000,7 +1004,7 @@ behavior).</p>
|
|
1000
1004
|
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 293</span>
|
1001
1005
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_action</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">log</span> = <span class="ruby-keyword">true</span>, <span class="ruby-identifier">file</span> = <span class="ruby-string">'<unknown>'</span>, <span class="ruby-identifier">line</span> = <span class="ruby-value">0</span>)
|
1002
1006
|
<span class="ruby-identifier">data</span> = <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse_action_default</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
1003
|
-
<span class="ruby-identifier">
|
1007
|
+
<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">data</span>[<span class="ruby-value">:action</span>], <span class="ruby-identifier">data</span>[<span class="ruby-value">:args</span>], <span class="ruby-identifier">log</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
1004
1008
|
<span class="ruby-keyword">end</span></pre>
|
1005
1009
|
</div>
|
1006
1010
|
|
@@ -1045,7 +1049,7 @@ ret.call if ret.respond_to? :call</pre>
|
|
1045
1049
|
|
1046
1050
|
|
1047
1051
|
<div class="method-source-code" id="exec_action_object-source">
|
1048
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1052
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 550</span>
|
1049
1053
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_action_object</span>(<span class="ruby-identifier">action</span>)
|
1050
1054
|
<span class="ruby-comment"># Inject built-in variables</span>
|
1051
1055
|
<span class="ruby-identifier">file</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">file</span>
|
@@ -1092,7 +1096,70 @@ ret.call if ret.respond_to? :call</pre>
|
|
1092
1096
|
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 304</span>
|
1093
1097
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_file</span>(<span class="ruby-identifier">file</span>)
|
1094
1098
|
<span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
1095
|
-
<span class="ruby-identifier">
|
1099
|
+
<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-keyword">true</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
1100
|
+
<span class="ruby-keyword">end</span>
|
1101
|
+
<span class="ruby-keyword">end</span></pre>
|
1102
|
+
</div>
|
1103
|
+
|
1104
|
+
</div>
|
1105
|
+
|
1106
|
+
|
1107
|
+
|
1108
|
+
|
1109
|
+
</div>
|
1110
|
+
|
1111
|
+
|
1112
|
+
<div id="method-i-exec_parsed_action" class="method-detail ">
|
1113
|
+
|
1114
|
+
<div class="method-heading">
|
1115
|
+
<span class="method-name">exec_parsed_action</span><span
|
1116
|
+
class="method-args">(action, args, log = true, text = nil, file = nil, line = nil)</span>
|
1117
|
+
|
1118
|
+
<span class="method-click-advice">click to toggle source</span>
|
1119
|
+
|
1120
|
+
</div>
|
1121
|
+
|
1122
|
+
|
1123
|
+
<div class="method-description">
|
1124
|
+
|
1125
|
+
<p>Executes the specified action handling errors, logging and debug history.</p>
|
1126
|
+
|
1127
|
+
<p>This method if part of the action execution chain and is intended for
|
1128
|
+
advanced use (e.g. in complex actions). To execute an <a
|
1129
|
+
href="Action.html">Action</a> directly, the <a
|
1130
|
+
href="Context.html#method-i-exec_action">exec_action</a> method is
|
1131
|
+
preferred.</p>
|
1132
|
+
|
1133
|
+
<p>If <code>log</code> is <code>true</code>, log the action execution (default
|
1134
|
+
behavior).</p>
|
1135
|
+
|
1136
|
+
<p>For example:</p>
|
1137
|
+
|
1138
|
+
<pre class="ruby"><span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">exec_action</span> <span class="ruby-string">'open "http://www.ruby-lang.org"'</span>
|
1139
|
+
<span class="ruby-comment"># => navigates to www.ruby-lang.org</span>
|
1140
|
+
</pre>
|
1141
|
+
|
1142
|
+
|
1143
|
+
|
1144
|
+
|
1145
|
+
<div class="method-source-code" id="exec_parsed_action-source">
|
1146
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 323</span>
|
1147
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">log</span> = <span class="ruby-keyword">true</span>, <span class="ruby-identifier">text</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">file</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">line</span> = <span class="ruby-keyword">nil</span>)
|
1148
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-identifier">handle_errors</span>(<span class="ruby-keyword">true</span>) <span class="ruby-keyword">do</span>
|
1149
|
+
|
1150
|
+
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
1151
|
+
|
1152
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">log</span>
|
1153
|
+
<span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">log_cmd</span>(<span class="ruby-identifier">action</span>) <span class="ruby-keyword">do</span>
|
1154
|
+
<span class="ruby-constant">Readline</span><span class="ruby-operator">::</span><span class="ruby-constant">HISTORY</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">action</span>.<span class="ruby-identifier">text</span>
|
1155
|
+
<span class="ruby-identifier">exec_action_object</span>(<span class="ruby-identifier">action</span>)
|
1156
|
+
<span class="ruby-keyword">end</span>
|
1157
|
+
<span class="ruby-keyword">else</span>
|
1158
|
+
<span class="ruby-identifier">exec_action_object</span>(<span class="ruby-identifier">action</span>)
|
1159
|
+
<span class="ruby-keyword">end</span>
|
1160
|
+
<span class="ruby-keyword">end</span>
|
1161
|
+
<span class="ruby-identifier">handle_errors</span>(<span class="ruby-keyword">true</span>) <span class="ruby-keyword">do</span>
|
1162
|
+
<span class="ruby-identifier">ret</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:call</span> <span class="ruby-comment"># delayed actions (after log_cmd)</span>
|
1096
1163
|
<span class="ruby-keyword">end</span>
|
1097
1164
|
<span class="ruby-keyword">end</span></pre>
|
1098
1165
|
</div>
|
@@ -1109,7 +1176,7 @@ ret.call if ret.respond_to? :call</pre>
|
|
1109
1176
|
|
1110
1177
|
<div class="method-heading">
|
1111
1178
|
<span class="method-name">get_action</span><span
|
1112
|
-
class="method-args">(action, args, text, file, line)</span>
|
1179
|
+
class="method-args">(action, args, text = nil, file = nil, line = nil)</span>
|
1113
1180
|
|
1114
1181
|
<span class="method-click-advice">click to toggle source</span>
|
1115
1182
|
|
@@ -1131,8 +1198,8 @@ preferred.</p>
|
|
1131
1198
|
|
1132
1199
|
|
1133
1200
|
<div class="method-source-code" id="get_action-source">
|
1134
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1135
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
1201
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 510</span>
|
1202
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">file</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">line</span> = <span class="ruby-keyword">nil</span>)
|
1136
1203
|
<span class="ruby-keyword">while</span> (<span class="ruby-identifier">alias_action</span> = <span class="ruby-ivar">@aliases</span>[<span class="ruby-identifier">action</span>])
|
1137
1204
|
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">alias_action</span>[<span class="ruby-value">:action</span>]
|
1138
1205
|
<span class="ruby-identifier">args</span> = <span class="ruby-identifier">alias_action</span>[<span class="ruby-value">:args</span>].<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
@@ -1153,6 +1220,8 @@ preferred.</p>
|
|
1153
1220
|
<span class="ruby-keyword">end</span>
|
1154
1221
|
|
1155
1222
|
<span class="ruby-identifier">text</span> = ([<span class="ruby-identifier">action</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-string">'"'</span><span class="ruby-operator">+</span><span class="ruby-identifier">a</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'"'</span>, <span class="ruby-string">'""'</span>)<span class="ruby-operator">+</span><span class="ruby-string">'"'</span> }).<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">text</span>
|
1223
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__FILE__'</span>] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">file</span>
|
1224
|
+
<span class="ruby-identifier">line</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__LINE__'</span>] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">line</span>
|
1156
1225
|
|
1157
1226
|
<span class="ruby-constant">Action</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
1158
1227
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1205,7 +1274,7 @@ handler will not exit after printing the error message.</p>
|
|
1205
1274
|
|
1206
1275
|
|
1207
1276
|
<div class="method-source-code" id="handle_errors-source">
|
1208
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1277
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 362</span>
|
1209
1278
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">handle_errors</span>(<span class="ruby-identifier">break_into_debug</span> = <span class="ruby-keyword">false</span>, <span class="ruby-identifier">exit_on_error</span> = <span class="ruby-keyword">true</span>)
|
1210
1279
|
<span class="ruby-keyword">yield</span>
|
1211
1280
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
@@ -1237,6 +1306,64 @@ handler will not exit after printing the error message.</p>
|
|
1237
1306
|
|
1238
1307
|
|
1239
1308
|
|
1309
|
+
</div>
|
1310
|
+
|
1311
|
+
|
1312
|
+
<div id="method-i-try_exec_action" class="method-detail ">
|
1313
|
+
|
1314
|
+
<div class="method-heading">
|
1315
|
+
<span class="method-name">try_exec_action</span><span
|
1316
|
+
class="method-args">(action, args)</span>
|
1317
|
+
|
1318
|
+
<span class="method-click-advice">click to toggle source</span>
|
1319
|
+
|
1320
|
+
</div>
|
1321
|
+
|
1322
|
+
|
1323
|
+
<div class="method-description">
|
1324
|
+
|
1325
|
+
<p>Executes the specified <code>action</code> and returns <code>true</code> if
|
1326
|
+
the action succeeds and <code>false</code> otherwise.</p>
|
1327
|
+
|
1328
|
+
<p>This method is intended to simplify conditional actions that execute
|
1329
|
+
different code depending on the outcome of an action execution.</p>
|
1330
|
+
|
1331
|
+
<p>For example:</p>
|
1332
|
+
|
1333
|
+
<pre class="ruby"><span class="ruby-keyword">if</span> <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">try_exec_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
|
1334
|
+
<span class="ruby-comment"># => when action succeeds...</span>
|
1335
|
+
<span class="ruby-keyword">else</span>
|
1336
|
+
<span class="ruby-comment"># => when action fails...</span>
|
1337
|
+
<span class="ruby-keyword">end</span>
|
1338
|
+
</pre>
|
1339
|
+
|
1340
|
+
|
1341
|
+
|
1342
|
+
|
1343
|
+
<div class="method-source-code" id="try_exec_action-source">
|
1344
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 572</span>
|
1345
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">try_exec_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
|
1346
|
+
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
|
1347
|
+
|
1348
|
+
<span class="ruby-identifier">with_timeout</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span> <span class="ruby-keyword">do</span>
|
1349
|
+
<span class="ruby-identifier">with_vars</span>({ <span class="ruby-string">'__TIMEOUT__'</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>}) <span class="ruby-keyword">do</span>
|
1350
|
+
<span class="ruby-keyword">begin</span>
|
1351
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-identifier">exec_action_object</span>(<span class="ruby-identifier">action</span>)
|
1352
|
+
<span class="ruby-identifier">ret</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:call</span>
|
1353
|
+
<span class="ruby-keyword">true</span>
|
1354
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>
|
1355
|
+
<span class="ruby-keyword">false</span>
|
1356
|
+
<span class="ruby-keyword">end</span>
|
1357
|
+
<span class="ruby-keyword">end</span>
|
1358
|
+
<span class="ruby-keyword">end</span>
|
1359
|
+
<span class="ruby-keyword">end</span></pre>
|
1360
|
+
</div>
|
1361
|
+
|
1362
|
+
</div>
|
1363
|
+
|
1364
|
+
|
1365
|
+
|
1366
|
+
|
1240
1367
|
</div>
|
1241
1368
|
|
1242
1369
|
|
@@ -1272,7 +1399,7 @@ available <a href="Selector.html">Selector</a> strategies).</p>
|
|
1272
1399
|
|
1273
1400
|
|
1274
1401
|
<div class="method-source-code" id="with_driver_timeout-source">
|
1275
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1402
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 426</span>
|
1276
1403
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_driver_timeout</span>(<span class="ruby-identifier">timeout</span>)
|
1277
1404
|
<span class="ruby-identifier">current</span> = <span class="ruby-ivar">@driver_timeout</span>
|
1278
1405
|
<span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">manage</span>.<span class="ruby-identifier">timeouts</span>.<span class="ruby-identifier">implicit_wait</span> = <span class="ruby-identifier">timeout</span>
|
@@ -1321,7 +1448,7 @@ to execute the block itself.</p>
|
|
1321
1448
|
|
1322
1449
|
|
1323
1450
|
<div class="method-source-code" id="with_timeout-source">
|
1324
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1451
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 398</span>
|
1325
1452
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_timeout</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">error_types</span>)
|
1326
1453
|
<span class="ruby-identifier">stime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>
|
1327
1454
|
<span class="ruby-identifier">timeout</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">stime</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__TIMEOUT__'</span>]
|
@@ -1402,7 +1529,7 @@ to execute the block itself.</p>
|
|
1402
1529
|
|
1403
1530
|
|
1404
1531
|
<div class="method-source-code" id="action_args-source">
|
1405
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1532
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 609</span>
|
1406
1533
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">action_args</span>(<span class="ruby-identifier">action</span>)
|
1407
1534
|
<span class="ruby-identifier">action</span> <span class="ruby-operator">+=</span> <span class="ruby-string">'_action'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">_action_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">action</span>
|
1408
1535
|
<span class="ruby-constant">Action</span>.<span class="ruby-identifier">public_instance_method</span>(<span class="ruby-identifier">action</span>).<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">att</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span> }
|
@@ -1442,7 +1569,7 @@ to execute the block itself.</p>
|
|
1442
1569
|
|
1443
1570
|
|
1444
1571
|
<div class="method-source-code" id="actions-source">
|
1445
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1572
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 599</span>
|
1446
1573
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">actions</span>
|
1447
1574
|
<span class="ruby-identifier">_action_methods</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/_action$/</span>, <span class="ruby-string">''</span>) }
|
1448
1575
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1481,7 +1608,7 @@ to execute the block itself.</p>
|
|
1481
1608
|
|
1482
1609
|
|
1483
1610
|
<div class="method-source-code" id="loggers-source">
|
1484
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1611
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 638</span>
|
1485
1612
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">loggers</span>
|
1486
1613
|
<span class="ruby-constant">Loggers</span>.<span class="ruby-identifier">constants</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/logger$/</span>, <span class="ruby-string">''</span>) }
|
1487
1614
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1523,7 +1650,7 @@ to execute the block itself.</p>
|
|
1523
1650
|
|
1524
1651
|
|
1525
1652
|
<div class="method-source-code" id="max_action_name_size-source">
|
1526
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1653
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 662</span>
|
1527
1654
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">max_action_name_size</span>
|
1528
1655
|
<span class="ruby-identifier">actions</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span>,<span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-identifier">s</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">s</span> }
|
1529
1656
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1562,7 +1689,7 @@ to execute the block itself.</p>
|
|
1562
1689
|
|
1563
1690
|
|
1564
1691
|
<div class="method-source-code" id="parsers-source">
|
1565
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1692
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 648</span>
|
1566
1693
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parsers</span>
|
1567
1694
|
(<span class="ruby-constant">Parser</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>) <span class="ruby-operator">-</span> <span class="ruby-constant">ParserModule</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>))
|
1568
1695
|
.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_s</span> }
|
@@ -1606,7 +1733,7 @@ custom selectors are returned.</p>
|
|
1606
1733
|
|
1607
1734
|
|
1608
1735
|
<div class="method-source-code" id="selectors-source">
|
1609
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1736
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 624</span>
|
1610
1737
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">selectors</span>(<span class="ruby-identifier">include_standard_selectors</span> = <span class="ruby-keyword">true</span>)
|
1611
1738
|
<span class="ruby-identifier">ret</span> = <span class="ruby-constant">Selector</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/_selector$/</span>, <span class="ruby-string">''</span>) }
|
1612
1739
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">include_standard_selectors</span>
|
@@ -1688,7 +1815,7 @@ with the corresponding variable value.</p>
|
|
1688
1815
|
|
1689
1816
|
|
1690
1817
|
<div class="method-source-code" id="expand-source">
|
1691
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1818
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 683</span>
|
1692
1819
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">expand</span>(<span class="ruby-identifier">s</span>)
|
1693
1820
|
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@variables</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">s</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span>,<span class="ruby-identifier">kv</span><span class="ruby-operator">|</span>
|
1694
1821
|
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\$\{#{kv[0]}\}/</span>, <span class="ruby-identifier">kv</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_s</span>)
|
@@ -1741,7 +1868,7 @@ variables is restored.</p>
|
|
1741
1868
|
|
1742
1869
|
|
1743
1870
|
<div class="method-source-code" id="with_vars-source">
|
1744
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1871
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 706</span>
|
1745
1872
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_vars</span>(<span class="ruby-identifier">vars</span>)
|
1746
1873
|
<span class="ruby-identifier">current</span> = <span class="ruby-ivar">@variables</span>
|
1747
1874
|
<span class="ruby-ivar">@variables</span> = <span class="ruby-ivar">@variables</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">vars</span>)
|
@@ -1767,7 +1894,7 @@ variables is restored.</p>
|
|
1767
1894
|
|
1768
1895
|
<footer id="validator-badges" role="contentinfo">
|
1769
1896
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
1770
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
1897
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
1771
1898
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1772
1899
|
</footer>
|
1773
1900
|
|
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
103
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
104
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
104
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
103
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
104
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
104
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
103
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
104
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
104
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|