doc/Bauxite/Context.html in bauxite-0.6.9 vs doc/Bauxite/Context.html in bauxite-0.6.10

- old
+ new

@@ -120,10 +120,12 @@ <li ><a href="#method-i-add_alias">#add_alias</a> <li ><a href="#method-i-debug">#debug</a> + <li ><a href="#method-i-driver">#driver</a> + <li ><a href="#method-i-exec_action">#exec_action</a> <li ><a href="#method-i-exec_action_object">#exec_action_object</a> <li ><a href="#method-i-exec_file">#exec_file</a> @@ -287,23 +289,10 @@ <header> <h3>Attributes</h3> </header> - <div id="attribute-i-driver" class="method-detail"> - <div class="method-heading attribute-method-heading"> - <span class="method-name">driver</span><span - class="attribute-access-type">[R]</span> - </div> - - <div class="method-description"> - - <p>Test engine driver instance (Selenium WebDriver).</p> - - </div> - </div> - <div id="attribute-i-logger" class="method-detail"> <div class="method-heading attribute-method-heading"> <span class="method-name">logger</span><span class="attribute-access-type">[R]</span> </div> @@ -412,11 +401,11 @@ <div class="method-source-code" id="new-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 141</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 138</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>, @@ -480,11 +469,11 @@ <div class="method-source-code" id="debug-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 272</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 269</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> @@ -494,10 +483,44 @@ </div> + <div id="method-i-driver" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">driver</span><span + class="method-args">()</span> + + <span class="method-click-advice">click to toggle source</span> + + </div> + + + <div class="method-description"> + + <p>Test engine driver instance (Selenium WebDriver).</p> + + + + + <div class="method-source-code" id="driver-source"> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 259</span> +<span class="ruby-keyword">def</span> <span class="ruby-identifier">driver</span> + <span class="ruby-identifier">_load_driver</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@driver</span> + <span class="ruby-ivar">@driver</span> +<span class="ruby-keyword">end</span></pre> + </div> + + </div> + + + + + </div> + + <div id="method-i-find" class="method-detail "> <div class="method-heading"> <span class="method-name">find</span><span class="method-args">(selector) { |element| ... }</span> @@ -537,11 +560,11 @@ <div class="method-source-code" id="find-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 261</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 252</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> @@ -587,11 +610,11 @@ <div class="method-source-code" id="get_value-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 291</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 288</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> @@ -630,14 +653,14 @@ <div class="method-source-code" id="reset_driver-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 209</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 200</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-ivar">@driver</span>.<span class="ruby-identifier">quit</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@driver</span> + <span class="ruby-ivar">@driver</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">end</span></pre> </div> </div> @@ -679,18 +702,12 @@ <div class="method-source-code" id="start-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 180</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 177</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">actions</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>) @@ -749,20 +766,20 @@ <div class="method-source-code" id="stop-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 229</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 220</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> <span class="ruby-identifier">print_error</span>(<span class="ruby-identifier">e</span>) <span class="ruby-identifier">raise</span> <span class="ruby-keyword">ensure</span> - <span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">quit</span> + <span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">quit</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@driver</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> </div> </div> @@ -822,11 +839,11 @@ <div class="method-source-code" id="load_logger-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 429</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 426</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> @@ -870,11 +887,11 @@ <div class="method-source-code" id="parse_action_default-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 457</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 454</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> = [] @@ -938,11 +955,11 @@ <div class="method-source-code" id="wait-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 422</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 419</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> @@ -980,11 +997,11 @@ <div class="method-source-code" id="add_alias-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 451</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 448</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> @@ -1023,11 +1040,11 @@ <div class="method-source-code" id="exec_action-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 312</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 309</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> @@ -1071,11 +1088,11 @@ <div class="method-source-code" id="exec_action_object-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 537</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 534</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> @@ -1110,11 +1127,11 @@ <div class="method-source-code" id="exec_file-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 323</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 320</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>] @@ -1171,11 +1188,11 @@ <div class="method-source-code" id="exec_parsed_action-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 353</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 350</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> @@ -1222,11 +1239,11 @@ <div class="method-source-code" id="get_action-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 497</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 494</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> @@ -1290,11 +1307,11 @@ <div class="method-source-code" id="output_path-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 582</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 579</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> @@ -1341,11 +1358,11 @@ <div class="method-source-code" id="print_error-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 552</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 549</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> @@ -1401,18 +1418,18 @@ <div class="method-source-code" id="with_driver_timeout-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 407</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 404</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-identifier">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> <span class="ruby-ivar">@driver_timeout</span> = <span class="ruby-identifier">current</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">current</span> + <span class="ruby-identifier">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">current</span> <span class="ruby-keyword">end</span></pre> </div> </div> @@ -1450,11 +1467,11 @@ <div class="method-source-code" id="with_timeout-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 379</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 376</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> @@ -1531,11 +1548,11 @@ <div class="method-source-code" id="action_args-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 613</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 610</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> @@ -1571,11 +1588,11 @@ <div class="method-source-code" id="actions-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 603</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 600</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> @@ -1610,11 +1627,11 @@ <div class="method-source-code" id="loggers-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 642</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 639</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> @@ -1652,11 +1669,11 @@ <div class="method-source-code" id="max_action_name_size-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 666</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 663</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> @@ -1691,11 +1708,11 @@ <div class="method-source-code" id="parsers-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 649</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> @@ -1735,11 +1752,11 @@ <div class="method-source-code" id="selectors-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 628</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 625</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> @@ -1817,11 +1834,11 @@ <div class="method-source-code" id="expand-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 687</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 684</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> @@ -1870,10 +1887,10 @@ <div class="method-source-code" id="with_vars-source"> - <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 710</span> + <pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 707</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-identifier">ret_vars</span> = <span class="ruby-keyword">nil</span>