242 lines
8.5 KiB
HTML
242 lines
8.5 KiB
HTML
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
<!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>
|
||
|
<title>Module: Rack::Handler</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
||
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
||
|
<script type="text/javascript">
|
||
|
// <![CDATA[
|
||
|
|
||
|
function popupCode( url ) {
|
||
|
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
||
|
}
|
||
|
|
||
|
function toggleCode( id ) {
|
||
|
if ( document.getElementById )
|
||
|
elem = document.getElementById( id );
|
||
|
else if ( document.all )
|
||
|
elem = eval( "document.all." + id );
|
||
|
else
|
||
|
return false;
|
||
|
|
||
|
elemStyle = elem.style;
|
||
|
|
||
|
if ( elemStyle.display != "block" ) {
|
||
|
elemStyle.display = "block"
|
||
|
} else {
|
||
|
elemStyle.display = "none"
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
// Make codeblocks hidden by default
|
||
|
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
||
|
|
||
|
// ]]>
|
||
|
</script>
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
|
||
|
|
||
|
<div id="classHeader">
|
||
|
<table class="header-table">
|
||
|
<tr class="top-aligned-row">
|
||
|
<td><strong>Module</strong></td>
|
||
|
<td class="class-name-in-header">Rack::Handler</td>
|
||
|
</tr>
|
||
|
<tr class="top-aligned-row">
|
||
|
<td><strong>In:</strong></td>
|
||
|
<td>
|
||
|
<a href="../../files/lib/rack/handler_rb.html">
|
||
|
lib/rack/handler.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/cgi_rb.html">
|
||
|
lib/rack/handler/cgi.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/evented_mongrel_rb.html">
|
||
|
lib/rack/handler/evented_mongrel.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/fastcgi_rb.html">
|
||
|
lib/rack/handler/fastcgi.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/lsws_rb.html">
|
||
|
lib/rack/handler/lsws.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/mongrel_rb.html">
|
||
|
lib/rack/handler/mongrel.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/scgi_rb.html">
|
||
|
lib/rack/handler/scgi.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/swiftiplied_mongrel_rb.html">
|
||
|
lib/rack/handler/swiftiplied_mongrel.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/thin_rb.html">
|
||
|
lib/rack/handler/thin.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
<a href="../../files/lib/rack/handler/webrick_rb.html">
|
||
|
lib/rack/handler/webrick.rb
|
||
|
</a>
|
||
|
<br />
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</div>
|
||
|
<!-- banner header -->
|
||
|
|
||
|
<div id="bodyContent">
|
||
|
|
||
|
|
||
|
|
||
|
<div id="contextContent">
|
||
|
|
||
|
<div id="description">
|
||
|
<p>
|
||
|
<b>Handlers</b> connect web servers with <a href="../Rack.html">Rack</a>.
|
||
|
</p>
|
||
|
<p>
|
||
|
<a href="../Rack.html">Rack</a> includes Handlers for <a
|
||
|
href="Handler/Mongrel.html">Mongrel</a>, <a
|
||
|
href="Handler/WEBrick.html">WEBrick</a>, <a
|
||
|
href="Handler/FastCGI.html">FastCGI</a>, <a
|
||
|
href="Handler/CGI.html">CGI</a>, <a href="Handler/SCGI.html">SCGI</a> and
|
||
|
LiteSpeed.
|
||
|
</p>
|
||
|
<p>
|
||
|
Handlers usually are activated by calling <tt>MyHandler.run(myapp)</tt>. A
|
||
|
second optional hash can be passed to include server-specific
|
||
|
configuration.
|
||
|
</p>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div id="method-list">
|
||
|
<h3 class="section-bar">Methods</h3>
|
||
|
|
||
|
<div class="name-list">
|
||
|
<a href="#M000044">get</a>
|
||
|
<a href="#M000045">register</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!-- if includes -->
|
||
|
|
||
|
<div id="section">
|
||
|
|
||
|
<div id="class-list">
|
||
|
<h3 class="section-bar">Classes and Modules</h3>
|
||
|
|
||
|
Class <a href="Handler/CGI.html" class="link">Rack::Handler::CGI</a><br />
|
||
|
Class <a href="Handler/EventedMongrel.html" class="link">Rack::Handler::EventedMongrel</a><br />
|
||
|
Class <a href="Handler/FastCGI.html" class="link">Rack::Handler::FastCGI</a><br />
|
||
|
Class <a href="Handler/LSWS.html" class="link">Rack::Handler::LSWS</a><br />
|
||
|
Class <a href="Handler/Mongrel.html" class="link">Rack::Handler::Mongrel</a><br />
|
||
|
Class <a href="Handler/SCGI.html" class="link">Rack::Handler::SCGI</a><br />
|
||
|
Class <a href="Handler/SwiftipliedMongrel.html" class="link">Rack::Handler::SwiftipliedMongrel</a><br />
|
||
|
Class <a href="Handler/Thin.html" class="link">Rack::Handler::Thin</a><br />
|
||
|
Class <a href="Handler/WEBrick.html" class="link">Rack::Handler::WEBrick</a><br />
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<!-- if method_list -->
|
||
|
<div id="methods">
|
||
|
<h3 class="section-bar">Public Class methods</h3>
|
||
|
|
||
|
<div id="method-M000044" class="method-detail">
|
||
|
<a name="M000044"></a>
|
||
|
|
||
|
<div class="method-heading">
|
||
|
<a href="#M000044" class="method-signature">
|
||
|
<span class="method-name">get</span><span class="method-args">(server)</span>
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
<div class="method-description">
|
||
|
<p><a class="source-toggle" href="#"
|
||
|
onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
|
||
|
<div class="method-source-code" id="M000044-source">
|
||
|
<pre>
|
||
|
<span class="ruby-comment cmt"># File lib/rack/handler.rb, line 11</span>
|
||
|
11: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">server</span>)
|
||
|
12: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">server</span>
|
||
|
13:
|
||
|
14: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span> = <span class="ruby-ivar">@handlers</span>[<span class="ruby-identifier">server</span>]
|
||
|
15: <span class="ruby-identifier">obj</span> = <span class="ruby-constant">Object</span>
|
||
|
16: <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">x</span>) }
|
||
|
17: <span class="ruby-identifier">obj</span>
|
||
|
18: <span class="ruby-keyword kw">else</span>
|
||
|
19: <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Handler</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">server</span>.<span class="ruby-identifier">capitalize</span>)
|
||
|
20: <span class="ruby-keyword kw">end</span>
|
||
|
21: <span class="ruby-keyword kw">end</span>
|
||
|
</pre>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div id="method-M000045" class="method-detail">
|
||
|
<a name="M000045"></a>
|
||
|
|
||
|
<div class="method-heading">
|
||
|
<a href="#M000045" class="method-signature">
|
||
|
<span class="method-name">register</span><span class="method-args">(server, klass)</span>
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
<div class="method-description">
|
||
|
<p><a class="source-toggle" href="#"
|
||
|
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
|
||
|
<div class="method-source-code" id="M000045-source">
|
||
|
<pre>
|
||
|
<span class="ruby-comment cmt"># File lib/rack/handler.rb, line 23</span>
|
||
|
23: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">server</span>, <span class="ruby-identifier">klass</span>)
|
||
|
24: <span class="ruby-ivar">@handlers</span> <span class="ruby-operator">||=</span> {}
|
||
|
25: <span class="ruby-ivar">@handlers</span>[<span class="ruby-identifier">server</span>] = <span class="ruby-identifier">klass</span>
|
||
|
26: <span class="ruby-keyword kw">end</span>
|
||
|
</pre>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<div id="validator-badges">
|
||
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|