doc/Bauxite/Context.html in bauxite-0.6.5 vs doc/Bauxite/Context.html in bauxite-0.6.6

- old
+ new

@@ -136,10 +136,12 @@ <li ><a href="#method-i-get_action">#get_action</a> <li ><a href="#method-i-get_value">#get_value</a> + <li ><a href="#method-i-output_path">#output_path</a> + <li ><a href="#method-i-print_error">#print_error</a> <li ><a href="#method-i-reset_driver">#reset_driver</a> <li ><a href="#method-i-start">#start</a> @@ -410,11 +412,11 @@ <div class="method-source-code" id="new-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 140</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 141</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>) <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span> <span class="ruby-ivar">@driver_name</span> = (<span class="ruby-identifier">options</span>[<span class="ruby-value">:driver</span>] <span class="ruby-operator">||</span> <span class="ruby-value">:firefox</span>).<span class="ruby-identifier">to_sym</span> <span class="ruby-ivar">@variables</span> = { <span class="ruby-string">&#39;__TIMEOUT__&#39;</span> =<span class="ruby-operator">&gt;</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">10</span>).<span class="ruby-identifier">to_i</span>, @@ -478,11 +480,11 @@ <div class="method-source-code" id="debug-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 266</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 272</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">debug</span> <span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-string">&#39;debug&#39;</span>, [], <span class="ruby-keyword">false</span>) <span class="ruby-keyword">end</span></pre> </div> @@ -535,11 +537,11 @@ <div class="method-source-code" id="find-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 255</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 261</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># yields: element</span> <span class="ruby-identifier">with_timeout</span> <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">NoSuchElementError</span> <span class="ruby-keyword">do</span> <span class="ruby-constant">Selector</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-ivar">@variables</span>[<span class="ruby-string">&#39;__SELECTOR__&#39;</span>]).<span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> @@ -585,11 +587,11 @@ <div class="method-source-code" id="get_value-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 285</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 291</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">element</span>) <span class="ruby-keyword">if</span> [<span class="ruby-string">&#39;input&#39;</span>,<span class="ruby-string">&#39;select&#39;</span>,<span class="ruby-string">&#39;textarea&#39;</span>].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">tag_name</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">attribute</span>(<span class="ruby-string">&#39;value&#39;</span>) <span class="ruby-keyword">else</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">text</span> @@ -628,11 +630,11 @@ <div class="method-source-code" id="reset_driver-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 203</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 209</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">reset_driver</span> <span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">quit</span> <span class="ruby-identifier">_load_driver</span> <span class="ruby-keyword">end</span></pre> </div> @@ -677,13 +679,18 @@ <div class="method-source-code" id="start-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 179</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 180</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">actions</span> = []) - <span class="ruby-identifier">_load_driver</span> + <span class="ruby-keyword">begin</span> + <span class="ruby-identifier">_load_driver</span> + <span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span> + <span class="ruby-identifier">print_error</span>(<span class="ruby-identifier">e</span>) + <span class="ruby-identifier">raise</span> + <span class="ruby-keyword">end</span> <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">actions</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">begin</span> <span class="ruby-identifier">actions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">action</span><span class="ruby-operator">|</span> <span class="ruby-keyword">begin</span> <span class="ruby-identifier">exec_action</span>(<span class="ruby-identifier">action</span>) @@ -742,11 +749,11 @@ <div class="method-source-code" id="stop-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 223</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 229</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">stop</span> <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">wait</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:wait</span>] <span class="ruby-keyword">begin</span> <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">finalize</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span> @@ -799,11 +806,11 @@ <div id="method-c-load_logger" class="method-detail "> <div class="method-heading"> <span class="method-name">load_logger</span><span - class="method-args">(name, options)</span> + class="method-args">(loggers, options)</span> <span class="method-click-advice">click to toggle source</span> </div> @@ -815,12 +822,18 @@ <div class="method-source-code" id="load_logger-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 423</span> -<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>) + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 429</span> +<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">load_logger</span>(<span class="ruby-identifier">loggers</span>, <span class="ruby-identifier">options</span>) + <span class="ruby-keyword">if</span> <span class="ruby-identifier">loggers</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span> + <span class="ruby-keyword">return</span> <span class="ruby-constant">Loggers</span><span class="ruby-operator">::</span><span class="ruby-constant">CompositeLogger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">loggers</span>) + <span class="ruby-keyword">end</span> + + <span class="ruby-identifier">name</span> = <span class="ruby-identifier">loggers</span> + <span class="ruby-identifier">log_name</span> = (<span class="ruby-identifier">name</span> <span class="ruby-operator">||</span> <span class="ruby-string">&#39;null&#39;</span>).<span class="ruby-identifier">downcase</span> <span class="ruby-identifier">class_name</span> = <span class="ruby-node">&quot;#{log_name.capitalize}Logger&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Loggers</span>.<span class="ruby-identifier">const_defined?</span> <span class="ruby-identifier">class_name</span>.<span class="ruby-identifier">to_sym</span> @@ -857,11 +870,11 @@ <div class="method-source-code" id="parse_action_default-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 445</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 457</span> <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">&#39;&lt;unknown&gt;&#39;</span>, <span class="ruby-identifier">line</span> = <span class="ruby-value">0</span>) <span class="ruby-identifier">data</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39; &#39;</span>, <span class="ruby-value">2</span>) <span class="ruby-keyword">begin</span> <span class="ruby-identifier">args_text</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">data</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">strip</span> <span class="ruby-operator">:</span> <span class="ruby-string">&#39;&#39;</span> <span class="ruby-identifier">args</span> = [] @@ -925,11 +938,11 @@ <div class="method-source-code" id="wait-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 416</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 422</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">wait</span> <span class="ruby-constant">Readline</span>.<span class="ruby-identifier">readline</span>(<span class="ruby-string">&quot;Press ENTER to continue\n&quot;</span>) <span class="ruby-keyword">end</span></pre> </div> @@ -967,11 +980,11 @@ <div class="method-source-code" id="add_alias-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 439</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 451</span> <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>) <span class="ruby-ivar">@aliases</span>[<span class="ruby-identifier">name</span>] = { <span class="ruby-value">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">action</span>, <span class="ruby-value">:args</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span> } <span class="ruby-keyword">end</span></pre> </div> @@ -1010,11 +1023,11 @@ <div class="method-source-code" id="exec_action-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 306</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 312</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_action</span>(<span class="ruby-identifier">text</span>) <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-string">&#39;&lt;unknown&gt;&#39;</span>, <span class="ruby-value">0</span>) <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-keyword">true</span>, <span class="ruby-identifier">text</span>) <span class="ruby-keyword">end</span></pre> </div> @@ -1058,11 +1071,11 @@ <div class="method-source-code" id="exec_action_object-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 525</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 537</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_action_object</span>(<span class="ruby-identifier">action</span>) <span class="ruby-identifier">action</span>.<span class="ruby-identifier">execute</span> <span class="ruby-keyword">end</span></pre> </div> @@ -1097,11 +1110,11 @@ <div class="method-source-code" id="exec_file-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 317</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 323</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_file</span>(<span class="ruby-identifier">file</span>) <span class="ruby-identifier">current_dir</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">&#39;__DIR__&#39;</span> ] <span class="ruby-identifier">current_file</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">&#39;__FILE__&#39;</span>] <span class="ruby-identifier">current_line</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">&#39;__LINE__&#39;</span>] @@ -1158,11 +1171,11 @@ <div class="method-source-code" id="exec_parsed_action-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 347</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 353</span> <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">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">ret</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">log</span> <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> @@ -1209,11 +1222,11 @@ <div class="method-source-code" id="get_action-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 485</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 497</span> <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-keyword">while</span> (<span class="ruby-identifier">alias_action</span> = <span class="ruby-ivar">@aliases</span>[<span class="ruby-identifier">action</span>]) <span class="ruby-identifier">action</span> = <span class="ruby-identifier">alias_action</span>[<span class="ruby-value">:action</span>] <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> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\$\{(\d+)(\*q?)?\}/</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> @@ -1246,10 +1259,62 @@ </div> + <div id="method-i-output_path" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">output_path</span><span + class="method-args">(path)</span> + + <span class="method-click-advice">click to toggle source</span> + + </div> + + + <div class="method-description"> + + <p>Returns the output path for <code>path</code> accounting for the +<code>__OUTPUT__</code> variable.</p> + +<p>For example:</p> + +<pre class="ruby"><span class="ruby-comment"># assuming --output /mnt/disk</span> + +<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">output_path</span> <span class="ruby-string">&#39;/tmp/myfile.txt&#39;</span> +<span class="ruby-comment"># =&gt; returns &#39;/tmp/myfile.txt&#39;</span> + +<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">output_path</span> <span class="ruby-string">&#39;myfile.txt&#39;</span> +<span class="ruby-comment"># =&gt; returns &#39;/mnt/disk/myfile.txt&#39;</span> +</pre> + + + + + <div class="method-source-code" id="output_path-source"> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 582</span> +<span class="ruby-keyword">def</span> <span class="ruby-identifier">output_path</span>(<span class="ruby-identifier">path</span>) + <span class="ruby-keyword">unless</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">absolute?</span> + <span class="ruby-identifier">output</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">&#39;__OUTPUT__&#39;</span>] + <span class="ruby-keyword">if</span> <span class="ruby-identifier">output</span> + <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span> <span class="ruby-identifier">output</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-identifier">output</span> + <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">path</span>) + <span class="ruby-keyword">end</span> + <span class="ruby-keyword">end</span> + <span class="ruby-identifier">path</span> +<span class="ruby-keyword">end</span></pre> + </div> + + </div> + + + + + </div> + + <div id="method-i-print_error" class="method-detail "> <div class="method-heading"> <span class="method-name">print_error</span><span class="method-args">(e, capture = true)</span> @@ -1276,11 +1341,11 @@ <div class="method-source-code" id="print_error-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 540</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 552</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">print_error</span>(<span class="ruby-identifier">e</span>, <span class="ruby-identifier">capture</span> = <span class="ruby-keyword">true</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@logger</span> <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">log</span> <span class="ruby-node">&quot;#{e.message}\n&quot;</span>, <span class="ruby-value">:error</span> <span class="ruby-keyword">else</span> <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span> @@ -1336,11 +1401,11 @@ <div class="method-source-code" id="with_driver_timeout-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 401</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 407</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">with_driver_timeout</span>(<span class="ruby-identifier">timeout</span>) <span class="ruby-identifier">current</span> = <span class="ruby-ivar">@driver_timeout</span> <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> <span class="ruby-keyword">yield</span> <span class="ruby-keyword">ensure</span> @@ -1385,11 +1450,11 @@ <div class="method-source-code" id="with_timeout-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 373</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 379</span> <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>) <span class="ruby-identifier">stime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span> <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">&#39;__TIMEOUT__&#39;</span>] <span class="ruby-keyword">yield</span> <span class="ruby-keyword">rescue</span> <span class="ruby-operator">*</span><span class="ruby-identifier">error_types</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span> @@ -1466,11 +1531,11 @@ <div class="method-source-code" id="action_args-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 578</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 613</span> <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>) <span class="ruby-identifier">action</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&#39;_action&#39;</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> <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> } <span class="ruby-keyword">end</span></pre> </div> @@ -1506,11 +1571,11 @@ <div class="method-source-code" id="actions-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 568</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 603</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">actions</span> <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">&#39;&#39;</span>) } <span class="ruby-keyword">end</span></pre> </div> @@ -1545,11 +1610,11 @@ <div class="method-source-code" id="loggers-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 607</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 642</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">loggers</span> <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">&#39;&#39;</span>) } <span class="ruby-keyword">end</span></pre> </div> @@ -1587,11 +1652,11 @@ <div class="method-source-code" id="max_action_name_size-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 631</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 666</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">max_action_name_size</span> <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">&gt;</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> } <span class="ruby-keyword">end</span></pre> </div> @@ -1626,11 +1691,11 @@ <div class="method-source-code" id="parsers-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 617</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 652</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parsers</span> (<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>)) .<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> } <span class="ruby-keyword">end</span></pre> </div> @@ -1670,11 +1735,11 @@ <div class="method-source-code" id="selectors-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 593</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 628</span> <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>) <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">&#39;&#39;</span>) } <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_standard_selectors</span> <span class="ruby-identifier">ret</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">SearchContext</span><span class="ruby-operator">::</span><span class="ruby-constant">FINDERS</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span> } <span class="ruby-keyword">end</span> @@ -1752,11 +1817,11 @@ <div class="method-source-code" id="expand-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 652</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 687</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">expand</span>(<span class="ruby-identifier">s</span>) <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> <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>) <span class="ruby-keyword">end</span> <span class="ruby-identifier">result</span> = <span class="ruby-identifier">expand</span>(<span class="ruby-identifier">result</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">s</span> @@ -1805,10 +1870,10 @@ <div class="method-source-code" id="with_vars-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 675</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 710</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">with_vars</span>(<span class="ruby-identifier">vars</span>) <span class="ruby-identifier">current</span> = <span class="ruby-ivar">@variables</span> <span class="ruby-ivar">@variables</span> = <span class="ruby-ivar">@variables</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">vars</span>) <span class="ruby-keyword">yield</span> <span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>