instiki/vendor/plugins/rack/doc/classes/Rack.html
Jacques Distler 4e14ccc74d Instiki 0.16.3: Rails 2.3.0
Instiki now runs on the Rails 2.3.0 Candidate Release.
Among other improvements, this means that it now 
automagically selects between WEBrick and Mongrel.

Just run

    ./instiki --daemon
2009-02-04 14:26:08 -06:00

438 lines
17 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</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</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/rack_rb.html">
lib/rack.rb
</a>
<br />
<a href="../files/lib/rack/builder_rb.html">
lib/rack/builder.rb
</a>
<br />
<a href="../files/lib/rack/cascade_rb.html">
lib/rack/cascade.rb
</a>
<br />
<a href="../files/lib/rack/commonlogger_rb.html">
lib/rack/commonlogger.rb
</a>
<br />
<a href="../files/lib/rack/conditionalget_rb.html">
lib/rack/conditionalget.rb
</a>
<br />
<a href="../files/lib/rack/content_length_rb.html">
lib/rack/content_length.rb
</a>
<br />
<a href="../files/lib/rack/deflater_rb.html">
lib/rack/deflater.rb
</a>
<br />
<a href="../files/lib/rack/directory_rb.html">
lib/rack/directory.rb
</a>
<br />
<a href="../files/lib/rack/file_rb.html">
lib/rack/file.rb
</a>
<br />
<a href="../files/lib/rack/forward_rb.html">
lib/rack/forward.rb
</a>
<br />
<a href="../files/lib/rack/handler_rb.html">
lib/rack/handler.rb
</a>
<br />
<a href="../files/lib/rack/head_rb.html">
lib/rack/head.rb
</a>
<br />
<a href="../files/lib/rack/lint_rb.html">
lib/rack/lint.rb
</a>
<br />
<a href="../files/lib/rack/lobster_rb.html">
lib/rack/lobster.rb
</a>
<br />
<a href="../files/lib/rack/methodoverride_rb.html">
lib/rack/methodoverride.rb
</a>
<br />
<a href="../files/lib/rack/mime_rb.html">
lib/rack/mime.rb
</a>
<br />
<a href="../files/lib/rack/mock_rb.html">
lib/rack/mock.rb
</a>
<br />
<a href="../files/lib/rack/recursive_rb.html">
lib/rack/recursive.rb
</a>
<br />
<a href="../files/lib/rack/reloader_rb.html">
lib/rack/reloader.rb
</a>
<br />
<a href="../files/lib/rack/request_rb.html">
lib/rack/request.rb
</a>
<br />
<a href="../files/lib/rack/response_rb.html">
lib/rack/response.rb
</a>
<br />
<a href="../files/lib/rack/showexceptions_rb.html">
lib/rack/showexceptions.rb
</a>
<br />
<a href="../files/lib/rack/showstatus_rb.html">
lib/rack/showstatus.rb
</a>
<br />
<a href="../files/lib/rack/static_rb.html">
lib/rack/static.rb
</a>
<br />
<a href="../files/lib/rack/urlmap_rb.html">
lib/rack/urlmap.rb
</a>
<br />
<a href="../files/lib/rack/utils_rb.html">
lib/rack/utils.rb
</a>
<br />
<a href="../files/lib/rack/adapter/camping_rb.html">
lib/rack/adapter/camping.rb
</a>
<br />
<a href="../files/lib/rack/auth/basic_rb.html">
lib/rack/auth/basic.rb
</a>
<br />
<a href="../files/lib/rack/auth/openid_rb.html">
lib/rack/auth/openid.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 />
<a href="../files/lib/rack/session/cookie_rb.html">
lib/rack/session/cookie.rb
</a>
<br />
<a href="../files/lib/rack/session/memcache_rb.html">
lib/rack/session/memcache.rb
</a>
<br />
<a href="../files/lib/rack/session/pool_rb.html">
lib/rack/session/pool.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
require &#8216;cgi&#8216;
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000004">call</a>&nbsp;&nbsp;
<a href="#M000003">release</a>&nbsp;&nbsp;
<a href="#M000002">version</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<div id="class-list">
<h3 class="section-bar">Classes and Modules</h3>
Module <a href="Rack/Adapter.html" class="link">Rack::Adapter</a><br />
Module <a href="Rack/Auth.html" class="link">Rack::Auth</a><br />
Module <a href="Rack/Handler.html" class="link">Rack::Handler</a><br />
Module <a href="Rack/Mime.html" class="link">Rack::Mime</a><br />
Module <a href="Rack/Session.html" class="link">Rack::Session</a><br />
Module <a href="Rack/Utils.html" class="link">Rack::Utils</a><br />
Class <a href="Rack/Builder.html" class="link">Rack::Builder</a><br />
Class <a href="Rack/Cascade.html" class="link">Rack::Cascade</a><br />
Class <a href="Rack/CommonLogger.html" class="link">Rack::CommonLogger</a><br />
Class <a href="Rack/ConditionalGet.html" class="link">Rack::ConditionalGet</a><br />
Class <a href="Rack/ContentLength.html" class="link">Rack::ContentLength</a><br />
Class <a href="Rack/Deflater.html" class="link">Rack::Deflater</a><br />
Class <a href="Rack/Directory.html" class="link">Rack::Directory</a><br />
Class <a href="Rack/File.html" class="link">Rack::File</a><br />
Class <a href="Rack/ForwardRequest.html" class="link">Rack::ForwardRequest</a><br />
Class <a href="Rack/Forwarder.html" class="link">Rack::Forwarder</a><br />
Class <a href="Rack/Head.html" class="link">Rack::Head</a><br />
Class <a href="Rack/Lint.html" class="link">Rack::Lint</a><br />
Class <a href="Rack/Lobster.html" class="link">Rack::Lobster</a><br />
Class <a href="Rack/MethodOverride.html" class="link">Rack::MethodOverride</a><br />
Class <a href="Rack/MockRequest.html" class="link">Rack::MockRequest</a><br />
Class <a href="Rack/MockResponse.html" class="link">Rack::MockResponse</a><br />
Class <a href="Rack/Recursive.html" class="link">Rack::Recursive</a><br />
Class <a href="Rack/Reloader.html" class="link">Rack::Reloader</a><br />
Class <a href="Rack/Request.html" class="link">Rack::Request</a><br />
Class <a href="Rack/Response.html" class="link">Rack::Response</a><br />
Class <a href="Rack/ShowExceptions.html" class="link">Rack::ShowExceptions</a><br />
Class <a href="Rack/ShowStatus.html" class="link">Rack::ShowStatus</a><br />
Class <a href="Rack/Static.html" class="link">Rack::Static</a><br />
Class <a href="Rack/URLMap.html" class="link">Rack::URLMap</a><br />
</div>
<div id="constants-list">
<h3 class="section-bar">Constants</h3>
<div class="name-list">
<table summary="Constants">
<tr class="top-aligned-row context-row">
<td class="context-item-name">VERSION</td>
<td>=</td>
<td class="context-item-value">[0,1]</td>
<td width="3em">&nbsp;</td>
<td class="context-item-desc">
The <a href="Rack.html">Rack</a> protocol <a
href="Rack.html#M000002">version</a> number implemented.
</td>
</tr>
</table>
</div>
</div>
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000003" class="method-detail">
<a name="M000003"></a>
<div class="method-heading">
<a href="#M000003" class="method-signature">
<span class="method-name">release</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p>
Return the <a href="Rack.html">Rack</a> <a
href="Rack.html#M000003">release</a> as a dotted string.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000003-source">
<pre>
<span class="ruby-comment cmt"># File lib/rack.rb, line 25</span>
25: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">release</span>
26: <span class="ruby-value str">&quot;0.9&quot;</span>
27: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000002" class="method-detail">
<a name="M000002"></a>
<div class="method-heading">
<a href="#M000002" class="method-signature">
<span class="method-name">version</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p>
Return the <a href="Rack.html">Rack</a> protocol <a
href="Rack.html#M000002">version</a> as a dotted string.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000002-source">
<pre>
<span class="ruby-comment cmt"># File lib/rack.rb, line 20</span>
20: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span>
21: <span class="ruby-constant">VERSION</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;.&quot;</span>)
22: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000004" class="method-detail">
<a name="M000004"></a>
<div class="method-heading">
<a href="#M000004" class="method-signature">
<span class="method-name">call</span><span class="method-args">(env)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000004-source">
<pre>
<span class="ruby-comment cmt"># File lib/rack/lobster.rb, line 32</span>
32: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
33: <span class="ruby-identifier">req</span> = <span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
34: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">req</span>.<span class="ruby-constant">GET</span>[<span class="ruby-value str">&quot;flip&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;left&quot;</span>
35: <span class="ruby-identifier">lobster</span> = <span class="ruby-constant">LobsterString</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).
36: <span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">ljust</span>(<span class="ruby-value">42</span>).<span class="ruby-identifier">reverse</span> }.
37: <span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
38: <span class="ruby-identifier">href</span> = <span class="ruby-value str">&quot;?flip=right&quot;</span>
39: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">req</span>.<span class="ruby-constant">GET</span>[<span class="ruby-value str">&quot;flip&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;crash&quot;</span>
40: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Lobster crashed&quot;</span>
41: <span class="ruby-keyword kw">else</span>
42: <span class="ruby-identifier">lobster</span> = <span class="ruby-constant">LobsterString</span>
43: <span class="ruby-identifier">href</span> = <span class="ruby-value str">&quot;?flip=left&quot;</span>
44: <span class="ruby-keyword kw">end</span>
45:
46: <span class="ruby-identifier">res</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>
47: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&lt;title&gt;Lobstericious!&lt;/title&gt;&quot;</span>
48: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&lt;pre&gt;&quot;</span>
49: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">lobster</span>
50: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&lt;/pre&gt;&quot;</span>
51: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;&lt;p&gt;&lt;a href='#{href}'&gt;flip!&lt;/a&gt;&lt;/p&gt;&quot;</span>
52: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&lt;p&gt;&lt;a href='?flip=crash'&gt;crash!&lt;/a&gt;&lt;/p&gt;&quot;</span>
53: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">finish</span>
54: <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>