<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: Selenium::Rake::ServerTask
  
    &mdash; Documentation by YARD 0.8.3
  
</title>

  <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../../';
  framesUrl = "../../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (S)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../../Selenium.html" title="Selenium (module)">Selenium</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Rake.html" title="Selenium::Rake (module)">Rake</a></span></span>
     &raquo; 
    <span class="title">ServerTask</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: Selenium::Rake::ServerTask
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Selenium::Rake::ServerTask</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
      <dt class="r2">Includes:</dt>
      <dd class="r2">Rake::DSL</dd>
      
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">rb/lib/selenium/rake/server_task.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    
<p>Defines rake tasks for starting, stopping and restarting the Selenium
server.</p>

<p>Usage:</p>

<pre class="code ruby"><code><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>selenium/rake/server_task</span><span class='tstring_end'>'</span></span>

<span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Rake</span><span class='op'>::</span><span class='const'>ServerTask</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_jar'>jar</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/path/to/selenium-server-standalone.jar</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span> <span class='op'>=</span> <span class='int'>4444</span>
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='qwords_beg'>%w[</span><span class='tstring_content'>-some</span><span class='words_sep'> </span><span class='tstring_content'>options</span><span class='words_sep'>]</span>
<span class='kw'>end</span></code></pre>

<p>Alternatively, you can have the task download a specific version of the
server:</p>

<pre class="code ruby"><code><span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Rake</span><span class='op'>::</span><span class='const'>ServerTask</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:server</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>2.6.0</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span></code></pre>

<p>or the latest version</p>

<pre class="code ruby"><code><span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Rake</span><span class='op'>::</span><span class='const'>ServerTask</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:server</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='symbol'>:latest</span>
<span class='kw'>end</span></code></pre>

<p>Tasks defined:</p>

<pre class="code ruby"><code>rake selenium:server:start
rake selenium:server:stop
rake selenium:server:restart</code></pre>


  </div>
</div>
<div class="tags">
  

</div>



  <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#background-instance_method" title="#background (instance method)">- (Object) <strong>background</strong> </a>
    

    
      (also: #background?)
    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Whether we should detach from the server process.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#jar-instance_method" title="#jar (instance method)">- (Object) <strong>jar</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Path to the selenium server jar.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#log-instance_method" title="#log (instance method)">- (Object) <strong>log</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Configure logging.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#opts-instance_method" title="#opts (instance method)">- (Object) <strong>opts</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Add additional options passed to the server jar.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#port-instance_method" title="#port (instance method)">- (Object) <strong>port</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Port to use for the server.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#timeout-instance_method" title="#timeout (instance method)">- (Object) <strong>timeout</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Timeout in seconds for the server to start/stop.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#version-instance_method" title="#version (instance method)">- (Object) <strong>version</strong> </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Specify the version of the server jar to download.</p>
</div></span>
  
</li>

    
  </ul>




  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (ServerTask) <strong>initialize</strong>(prefix = &quot;selenium:server&quot;) {|_self| ... }</a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>A new instance of ServerTask.</p>
</div></span>
  
</li>

      
    </ul>
  


  <div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <h3 class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="Selenium::Rake::ServerTask (class)">ServerTask</a></span></tt>) <strong>initialize</strong>(prefix = &quot;selenium:server&quot;) {|_self| ... }
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>A new instance of ServerTask</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Yields:</p>
<ul class="yield">
  
    <li>
      
      
        <span class='type'>(<tt>_self</tt>)</span>
      
      
      
    </li>
  
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
  
    <li>
      
        <span class='name'>_self</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="Selenium::Rake::ServerTask (class)">Selenium::Rake::ServerTask</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>the object that the method was called on</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 99</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_prefix'>prefix</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>selenium:server</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
  <span class='ivar'>@jar</span> <span class='op'>=</span> <span class='kw'>nil</span>
  <span class='ivar'>@prefix</span> <span class='op'>=</span> <span class='id identifier rubyid_prefix'>prefix</span>
  <span class='ivar'>@port</span> <span class='op'>=</span> <span class='int'>4444</span>
  <span class='ivar'>@timeout</span> <span class='op'>=</span> <span class='int'>30</span>
  <span class='ivar'>@background</span> <span class='op'>=</span> <span class='kw'>true</span>
  <span class='ivar'>@log</span> <span class='op'>=</span> <span class='kw'>true</span>
  <span class='ivar'>@opts</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
  <span class='ivar'>@version</span> <span class='op'>=</span> <span class='kw'>nil</span>

  <span class='kw'>yield</span> <span class='kw'>self</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>

  <span class='kw'>if</span> <span class='ivar'>@version</span>
    <span class='ivar'>@jar</span> <span class='op'>=</span> <span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_download'>download</span><span class='lparen'>(</span><span class='ivar'>@version</span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='kw'>unless</span> <span class='ivar'>@jar</span>
    <span class='id identifier rubyid_raise'>raise</span> <span class='const'>MissingJarFileError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>must provide path to the selenium server jar</span><span class='tstring_end'>&quot;</span></span>
  <span class='kw'>end</span>

  <span class='ivar'>@server</span> <span class='op'>=</span> <span class='const'>Selenium</span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@jar</span><span class='comma'>,</span> <span class='symbol'>:port</span>       <span class='op'>=&gt;</span> <span class='ivar'>@port</span><span class='comma'>,</span>
                                       <span class='symbol'>:timeout</span>    <span class='op'>=&gt;</span> <span class='ivar'>@timeout</span><span class='comma'>,</span>
                                       <span class='symbol'>:background</span> <span class='op'>=&gt;</span> <span class='ivar'>@background</span><span class='comma'>,</span>
                                       <span class='symbol'>:log</span>        <span class='op'>=&gt;</span> <span class='ivar'>@log</span> <span class='rparen'>)</span>

  <span class='ivar'>@server</span> <span class='op'>&lt;&lt;</span> <span class='ivar'>@opts</span>

  <span class='id identifier rubyid_define_start_task'>define_start_task</span>
  <span class='id identifier rubyid_define_stop_task'>define_stop_task</span>
  <span class='id identifier rubyid_define_restart_task'>define_restart_task</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="background=-instance_method"></span>
      <div class="method_details first">
  <h3 class="signature first" id="background-instance_method">
  
    - (<tt>Object</tt>) <strong>background</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='background?-instance_method'>background?</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Whether we should detach from the server process. Default: true</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


72
73
74</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 72</span>

<span class='kw'>def</span> <span class='id identifier rubyid_background'>background</span>
  <span class='ivar'>@background</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="jar=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="jar-instance_method">
  
    - (<tt>Object</tt>) <strong>jar</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Path to the selenium server jar</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


50
51
52</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 50</span>

<span class='kw'>def</span> <span class='id identifier rubyid_jar'>jar</span>
  <span class='ivar'>@jar</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="log=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="log-instance_method">
  
    - (<tt>Object</tt>) <strong>log</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Configure logging. Pass a log file path or a boolean. Default: true</p>

<p>true  - log to stdout/stderr false - no logging String - log to the
specified file</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


84
85
86</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 84</span>

<span class='kw'>def</span> <span class='id identifier rubyid_log'>log</span>
  <span class='ivar'>@log</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="opts=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="opts-instance_method">
  
    - (<tt>Object</tt>) <strong>opts</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Add additional options passed to the server jar.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


90
91
92</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 90</span>

<span class='kw'>def</span> <span class='id identifier rubyid_opts'>opts</span>
  <span class='ivar'>@opts</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="port=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="port-instance_method">
  
    - (<tt>Object</tt>) <strong>port</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Port to use for the server. Default: 4444</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 58</span>

<span class='kw'>def</span> <span class='id identifier rubyid_port'>port</span>
  <span class='ivar'>@port</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="timeout=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="timeout-instance_method">
  
    - (<tt>Object</tt>) <strong>timeout</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Timeout in seconds for the server to start/stop. Default: 30</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


65
66
67</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 65</span>

<span class='kw'>def</span> <span class='id identifier rubyid_timeout'>timeout</span>
  <span class='ivar'>@timeout</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="version=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="version-instance_method">
  
    - (<tt>Object</tt>) <strong>version</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Specify the version of the server jar to download</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


96
97
98</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'rb/lib/selenium/rake/server_task.rb', line 96</span>

<span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
  <span class='ivar'>@version</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


</div>

    <div id="footer">
  Generated on Mon Jan 21 19:22:44 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.3 (ruby-1.9.3).
</div>

  </body>
</html>