mongrel 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -2
- data/bin/mongrel_rails +65 -101
- data/bin/mongrel_rails_service +1 -1
- data/bin/mongrel_rails_svc +131 -115
- data/doc/rdoc/classes/Class.html +197 -0
- data/doc/rdoc/classes/Class.src/M000001.html +24 -0
- data/doc/rdoc/classes/Class.src/M000002.html +62 -0
- data/doc/rdoc/classes/Class.src/M000003.html +21 -0
- data/doc/rdoc/classes/Class.src/M000004.html +20 -0
- data/doc/rdoc/classes/IO.html +170 -0
- data/doc/rdoc/classes/IO.src/M000005.html +19 -0
- data/doc/rdoc/classes/IO.src/M000006.html +19 -0
- data/doc/rdoc/classes/Kernel.html +159 -0
- data/doc/rdoc/classes/Kernel.src/M000025.html +19 -0
- data/doc/rdoc/classes/Kernel.src/M000026.html +25 -0
- data/doc/rdoc/classes/Mongrel.html +181 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +383 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000090.html +24 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000091.html +47 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000092.html +34 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000093.html +27 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000094.html +25 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000095.html +18 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000096.html +18 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000097.html +18 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +19 -0
- data/doc/rdoc/classes/Mongrel/Camping.html +177 -0
- data/doc/rdoc/classes/Mongrel/Camping.src/M000048.html +22 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +165 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000049.html +18 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000050.html +27 -0
- data/doc/rdoc/classes/Mongrel/Command.html +119 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +337 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +24 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +41 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +22 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000038.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +192 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +20 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000040.html +25 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000041.html +46 -0
- data/doc/rdoc/classes/Mongrel/Configurator.html +563 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +24 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +23 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000101.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +32 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +19 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +31 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +33 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +25 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +19 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +22 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +21 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +27 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +46 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +18 -0
- data/doc/rdoc/classes/Mongrel/Const.html +286 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.html +288 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +20 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +42 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +40 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +51 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +40 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000063.html +18 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +171 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000115.html +18 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000116.html +18 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +185 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000072.html +18 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000073.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +152 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000074.html +17 -0
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +169 -0
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000027.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000028.html +17 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.html +271 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +28 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +29 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +29 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +41 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +27 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000056.html +27 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000057.html +28 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +222 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000117.html +28 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000118.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000119.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000120.html +32 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +371 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +26 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +25 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +22 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +22 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +23 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.html +360 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +24 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +65 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +24 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +60 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +28 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000070.html +22 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000071.html +18 -0
- data/doc/rdoc/classes/Mongrel/Rails.html +112 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +223 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +35 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000043.html +25 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000044.html +32 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +250 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +22 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +48 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000047.html +23 -0
- data/doc/rdoc/classes/Mongrel/StopServer.html +117 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +301 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000084.html +18 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000085.html +18 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000086.html +39 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000087.html +51 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +36 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +83 -0
- data/doc/rdoc/classes/MongrelDbg.html +209 -0
- data/doc/rdoc/classes/MongrelDbg.src/M000020.html +19 -0
- data/doc/rdoc/classes/MongrelDbg.src/M000021.html +20 -0
- data/doc/rdoc/classes/MongrelDbg.src/M000022.html +22 -0
- data/doc/rdoc/classes/MongrelDbg.src/M000023.html +21 -0
- data/doc/rdoc/classes/MongrelDbg.src/M000024.html +18 -0
- data/doc/rdoc/classes/ObjectTracker.html +176 -0
- data/doc/rdoc/classes/ObjectTracker.src/M000016.html +22 -0
- data/doc/rdoc/classes/ObjectTracker.src/M000017.html +18 -0
- data/doc/rdoc/classes/ObjectTracker.src/M000018.html +18 -0
- data/doc/rdoc/classes/ObjectTracker.src/M000019.html +46 -0
- data/doc/rdoc/classes/RequestLog.html +113 -0
- data/doc/rdoc/classes/RequestLog/Files.html +144 -0
- data/doc/rdoc/classes/RequestLog/Files.src/M000121.html +19 -0
- data/doc/rdoc/classes/RequestLog/Objects.html +144 -0
- data/doc/rdoc/classes/RequestLog/Objects.src/M000122.html +19 -0
- data/doc/rdoc/classes/RequestLog/Params.html +144 -0
- data/doc/rdoc/classes/RequestLog/Params.src/M000123.html +19 -0
- data/doc/rdoc/classes/Stats.html +306 -0
- data/doc/rdoc/classes/Stats.src/M000009.html +19 -0
- data/doc/rdoc/classes/Stats.src/M000010.html +23 -0
- data/doc/rdoc/classes/Stats.src/M000011.html +26 -0
- data/doc/rdoc/classes/Stats.src/M000012.html +18 -0
- data/doc/rdoc/classes/Stats.src/M000013.html +18 -0
- data/doc/rdoc/classes/Stats.src/M000014.html +19 -0
- data/doc/rdoc/classes/Stats.src/M000015.html +20 -0
- data/doc/rdoc/classes/TCPServer.html +173 -0
- data/doc/rdoc/classes/TCPServer.src/M000007.html +19 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/COPYING.html +756 -0
- data/doc/rdoc/files/LICENSE.html +756 -0
- data/doc/rdoc/files/README.html +302 -0
- data/doc/rdoc/files/ext/http11/http11_c.html +101 -0
- data/doc/rdoc/files/lib/mongrel/camping_rb.html +108 -0
- data/doc/rdoc/files/lib/mongrel/cgi_rb.html +108 -0
- data/doc/rdoc/files/lib/mongrel/command_rb.html +111 -0
- data/doc/rdoc/files/lib/mongrel/debug_rb.html +110 -0
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +109 -0
- data/doc/rdoc/files/lib/mongrel/init_rb.html +109 -0
- data/doc/rdoc/files/lib/mongrel/rails_rb.html +111 -0
- data/doc/rdoc/files/lib/mongrel/stats_rb.html +117 -0
- data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +109 -0
- data/doc/rdoc/files/lib/mongrel_rb.html +118 -0
- data/doc/rdoc/fr_class_index.html +60 -0
- data/doc/rdoc/fr_file_index.html +40 -0
- data/doc/rdoc/fr_method_index.html +149 -0
- data/doc/rdoc/index.html +24 -0
- data/doc/rdoc/rdoc-style.css +208 -0
- data/examples/builder.rb +29 -0
- data/examples/camping/blog.rb +11 -2
- data/examples/simpletest.rb +20 -7
- data/ext/http11/http11.c +71 -14
- data/ext/http11/http11_parser.c +27 -24
- data/ext/http11/http11_parser.h +2 -1
- data/lib/http11.bundle +0 -0
- data/lib/mongrel.rb +498 -135
- data/lib/mongrel/command.rb +1 -1
- data/lib/mongrel/debug.rb +259 -0
- data/lib/mongrel/handlers.rb +76 -22
- data/lib/mongrel/rails.rb +165 -72
- data/lib/mongrel/stats.rb +71 -0
- data/test/test_configurator.rb +67 -0
- data/test/test_debug.rb +31 -0
- data/test/test_http11.rb +16 -0
- data/test/test_response.rb +5 -0
- data/test/test_stats.rb +28 -0
- metadata +224 -2
@@ -0,0 +1,46 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>run (Mongrel::Command::Registry)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/command.rb, line 137</span>
|
14
|
+
137: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">args</span>)
|
15
|
+
138: <span class="ruby-comment cmt"># find the command</span>
|
16
|
+
139: <span class="ruby-identifier">cmd_name</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
|
17
|
+
140:
|
18
|
+
141: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cmd_name</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">cmd_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"?"</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">cmd_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"help"</span>
|
19
|
+
142: <span class="ruby-identifier">print_command_list</span>
|
20
|
+
143: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
21
|
+
144: <span class="ruby-keyword kw">end</span>
|
22
|
+
145:
|
23
|
+
146: <span class="ruby-comment cmt"># command exists, set it up and validate it</span>
|
24
|
+
147: <span class="ruby-keyword kw">begin</span>
|
25
|
+
148: <span class="ruby-identifier">command</span> = <span class="ruby-constant">GemPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Manager</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">create</span>(<span class="ruby-node">"/commands/#{cmd_name}"</span>, <span class="ruby-identifier">:argv</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span>)
|
26
|
+
149: <span class="ruby-keyword kw">rescue</span>
|
27
|
+
150: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"INVALID COMMAND: #$!"</span>
|
28
|
+
151: <span class="ruby-identifier">print_command_list</span>
|
29
|
+
152: <span class="ruby-keyword kw">return</span>
|
30
|
+
153: <span class="ruby-keyword kw">end</span>
|
31
|
+
154:
|
32
|
+
155: <span class="ruby-comment cmt"># Normally the command is NOT valid right after being created</span>
|
33
|
+
156: <span class="ruby-comment cmt"># but sometimes (like with -h or -v) there's no further processing</span>
|
34
|
+
157: <span class="ruby-comment cmt"># needed so the command is already valid so we can skip it.</span>
|
35
|
+
158: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">done_validating</span>
|
36
|
+
159: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">validate</span>
|
37
|
+
160: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{cmd_name} reported an error. Use -h to get help."</span>
|
38
|
+
161: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
39
|
+
162: <span class="ruby-keyword kw">else</span>
|
40
|
+
163: <span class="ruby-identifier">command</span>.<span class="ruby-identifier">run</span>
|
41
|
+
164: <span class="ruby-keyword kw">end</span>
|
42
|
+
165: <span class="ruby-keyword kw">end</span>
|
43
|
+
166: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
44
|
+
167: <span class="ruby-keyword kw">end</span></pre>
|
45
|
+
</body>
|
46
|
+
</html>
|
@@ -0,0 +1,563 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Mongrel::Configurator</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Mongrel::Configurator</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/mongrel_rb.html">
|
59
|
+
lib/mongrel.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Implements a simple DSL for configuring a <a
|
84
|
+
href="../Mongrel.html">Mongrel</a> server for your purposes. More used by
|
85
|
+
framework implementers to setup <a href="../Mongrel.html">Mongrel</a> how
|
86
|
+
they like, but could be used by regular folks to add more things to an
|
87
|
+
existing mongrel configuration.
|
88
|
+
</p>
|
89
|
+
<p>
|
90
|
+
It is used like this:
|
91
|
+
</p>
|
92
|
+
<pre>
|
93
|
+
require 'mongrel'
|
94
|
+
config = Mongrel::Configurator.new :host => "127.0.0.1" do
|
95
|
+
listener :port => 3000 do
|
96
|
+
uri "/app", :handler => Mongrel::DirHandler.new(".", load_mime_map("mime.yaml"))
|
97
|
+
end
|
98
|
+
run
|
99
|
+
end
|
100
|
+
</pre>
|
101
|
+
<p>
|
102
|
+
This will setup a simple <a href="DirHandler.html">DirHandler</a> at the
|
103
|
+
current directory and load additional mime types from mimy.yaml. The :host
|
104
|
+
=> "127.0.0.1" is actually not specific to the servers but
|
105
|
+
just a hash of default parameters that all server or uri calls receive.
|
106
|
+
</p>
|
107
|
+
<p>
|
108
|
+
When you are inside the block after <a
|
109
|
+
href="Configurator.html#M000099">Mongrel::Configurator.new</a> you can
|
110
|
+
simply call functions that are part of <a
|
111
|
+
href="Configurator.html">Configurator</a> (like server, uri, daemonize,
|
112
|
+
etc) without having to refer to anything else. You can also call these
|
113
|
+
functions on the resulting object directly for additional configuration.
|
114
|
+
</p>
|
115
|
+
<p>
|
116
|
+
A major thing about <a href="Configurator.html">Configurator</a> is that it
|
117
|
+
actually lets you configure multiple listeners for any hosts and ports you
|
118
|
+
want. These are kept in a map config.listeners so you can get to them.
|
119
|
+
</p>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div id="method-list">
|
127
|
+
<h3 class="section-bar">Methods</h3>
|
128
|
+
|
129
|
+
<div class="name-list">
|
130
|
+
<a href="#M000100">cloaker</a>
|
131
|
+
<a href="#M000104">daemonize</a>
|
132
|
+
<a href="#M000112">debug</a>
|
133
|
+
<a href="#M000111">join</a>
|
134
|
+
<a href="#M000102">listener</a>
|
135
|
+
<a href="#M000107">load_mime_map</a>
|
136
|
+
<a href="#M000105">load_plugins</a>
|
137
|
+
<a href="#M000106">load_yaml</a>
|
138
|
+
<a href="#M000114">log</a>
|
139
|
+
<a href="#M000099">new</a>
|
140
|
+
<a href="#M000108">plugin</a>
|
141
|
+
<a href="#M000101">resolve_defaults</a>
|
142
|
+
<a href="#M000109">run</a>
|
143
|
+
<a href="#M000113">setup_signals</a>
|
144
|
+
<a href="#M000110">stop</a>
|
145
|
+
<a href="#M000103">uri</a>
|
146
|
+
</div>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
<!-- if includes -->
|
153
|
+
|
154
|
+
<div id="section">
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<div id="attribute-list">
|
161
|
+
<h3 class="section-bar">Attributes</h3>
|
162
|
+
|
163
|
+
<div class="name-list">
|
164
|
+
<table>
|
165
|
+
<tr class="top-aligned-row context-row">
|
166
|
+
<td class="context-item-name">defaults</td>
|
167
|
+
<td class="context-item-value"> [R] </td>
|
168
|
+
<td class="context-item-desc"></td>
|
169
|
+
</tr>
|
170
|
+
<tr class="top-aligned-row context-row">
|
171
|
+
<td class="context-item-name">listeners</td>
|
172
|
+
<td class="context-item-value"> [R] </td>
|
173
|
+
<td class="context-item-desc"></td>
|
174
|
+
</tr>
|
175
|
+
<tr class="top-aligned-row context-row">
|
176
|
+
<td class="context-item-name">needs_restart</td>
|
177
|
+
<td class="context-item-value"> [R] </td>
|
178
|
+
<td class="context-item-desc"></td>
|
179
|
+
</tr>
|
180
|
+
</table>
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<!-- if method_list -->
|
187
|
+
<div id="methods">
|
188
|
+
<h3 class="section-bar">Public Class methods</h3>
|
189
|
+
|
190
|
+
<div id="method-M000099" class="method-detail">
|
191
|
+
<a name="M000099"></a>
|
192
|
+
|
193
|
+
<div class="method-heading">
|
194
|
+
<a href="Configurator.src/M000099.html" target="Code" class="method-signature"
|
195
|
+
onclick="popupCode('Configurator.src/M000099.html');return false;">
|
196
|
+
<span class="method-name">new</span><span class="method-args">(defaults={}, &blk)</span>
|
197
|
+
</a>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="method-description">
|
201
|
+
<p>
|
202
|
+
You pass in initial defaults and then a block to continue configuring.
|
203
|
+
</p>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
208
|
+
|
209
|
+
<div id="method-M000100" class="method-detail">
|
210
|
+
<a name="M000100"></a>
|
211
|
+
|
212
|
+
<div class="method-heading">
|
213
|
+
<a href="Configurator.src/M000100.html" target="Code" class="method-signature"
|
214
|
+
onclick="popupCode('Configurator.src/M000100.html');return false;">
|
215
|
+
<span class="method-name">cloaker</span><span class="method-args">(&blk)</span>
|
216
|
+
</a>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div class="method-description">
|
220
|
+
<p>
|
221
|
+
Do not call this. You were warned.
|
222
|
+
</p>
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
<div id="method-M000104" class="method-detail">
|
227
|
+
<a name="M000104"></a>
|
228
|
+
|
229
|
+
<div class="method-heading">
|
230
|
+
<a href="Configurator.src/M000104.html" target="Code" class="method-signature"
|
231
|
+
onclick="popupCode('Configurator.src/M000104.html');return false;">
|
232
|
+
<span class="method-name">daemonize</span><span class="method-args">(options={})</span>
|
233
|
+
</a>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
<p>
|
238
|
+
Daemonizes the current Ruby script turning all the listeners into an actual
|
239
|
+
"server" or detached process. You must call this <b>before</b>
|
240
|
+
frameworks that open files as otherwise the files will be closed by this
|
241
|
+
function.
|
242
|
+
</p>
|
243
|
+
<p>
|
244
|
+
Does not work for Win32 systems (the call is silently ignored).
|
245
|
+
</p>
|
246
|
+
<p>
|
247
|
+
Requires the following options or defaults:
|
248
|
+
</p>
|
249
|
+
<ul>
|
250
|
+
<li>:cwd => Directory to change to.
|
251
|
+
|
252
|
+
</li>
|
253
|
+
<li>:log_file => Where to write STDOUT and STDERR.
|
254
|
+
|
255
|
+
</li>
|
256
|
+
<li>:pid_file => Where to write the process ID.
|
257
|
+
|
258
|
+
</li>
|
259
|
+
</ul>
|
260
|
+
<p>
|
261
|
+
It is safe to call this on win32 as it will only require daemons if NOT
|
262
|
+
win32.
|
263
|
+
</p>
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
<div id="method-M000112" class="method-detail">
|
268
|
+
<a name="M000112"></a>
|
269
|
+
|
270
|
+
<div class="method-heading">
|
271
|
+
<a href="Configurator.src/M000112.html" target="Code" class="method-signature"
|
272
|
+
onclick="popupCode('Configurator.src/M000112.html');return false;">
|
273
|
+
<span class="method-name">debug</span><span class="method-args">(location)</span>
|
274
|
+
</a>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div class="method-description">
|
278
|
+
<p>
|
279
|
+
Calling this before you register your URIs to the given location will setup
|
280
|
+
a set of handlers that log open files, objects, and the parameters for each
|
281
|
+
request. This helps you track common problems found in <a
|
282
|
+
href="Rails.html">Rails</a> applications that are either slow or become
|
283
|
+
unresponsive after a little while.
|
284
|
+
</p>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div id="method-M000111" class="method-detail">
|
289
|
+
<a name="M000111"></a>
|
290
|
+
|
291
|
+
<div class="method-heading">
|
292
|
+
<a href="Configurator.src/M000111.html" target="Code" class="method-signature"
|
293
|
+
onclick="popupCode('Configurator.src/M000111.html');return false;">
|
294
|
+
<span class="method-name">join</span><span class="method-args">()</span>
|
295
|
+
</a>
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
<p>
|
300
|
+
This method should actually be called <b>outside</b> of the <a
|
301
|
+
href="Configurator.html">Configurator</a> block so that you can control it.
|
302
|
+
In otherwords do it like: config.join.
|
303
|
+
</p>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
<div id="method-M000102" class="method-detail">
|
308
|
+
<a name="M000102"></a>
|
309
|
+
|
310
|
+
<div class="method-heading">
|
311
|
+
<a href="Configurator.src/M000102.html" target="Code" class="method-signature"
|
312
|
+
onclick="popupCode('Configurator.src/M000102.html');return false;">
|
313
|
+
<span class="method-name">listener</span><span class="method-args">(options={},&blk)</span>
|
314
|
+
</a>
|
315
|
+
</div>
|
316
|
+
|
317
|
+
<div class="method-description">
|
318
|
+
<p>
|
319
|
+
Starts a listener block. This is the only one that actually takes a block
|
320
|
+
and then you make <a href="Configurator.html#M000103">Configurator.uri</a>
|
321
|
+
calls in order to setup your URIs and handlers. If you write your Handlers
|
322
|
+
as GemPlugins then you can use <a
|
323
|
+
href="Configurator.html#M000105">load_plugins</a> and plugin to load them.
|
324
|
+
</p>
|
325
|
+
<p>
|
326
|
+
It expects the following options (or defaults):
|
327
|
+
</p>
|
328
|
+
<ul>
|
329
|
+
<li>:host => Host name to bind.
|
330
|
+
|
331
|
+
</li>
|
332
|
+
<li>:port => Port to bind.
|
333
|
+
|
334
|
+
</li>
|
335
|
+
<li>:num_processors => The maximum number of concurrent threads allowed.
|
336
|
+
(950 default)
|
337
|
+
|
338
|
+
</li>
|
339
|
+
<li>:timeout => 1/100th of a second timeout between requests. (10 is 1/10th,
|
340
|
+
0 is not timeout)
|
341
|
+
|
342
|
+
</li>
|
343
|
+
</ul>
|
344
|
+
</div>
|
345
|
+
</div>
|
346
|
+
|
347
|
+
<div id="method-M000107" class="method-detail">
|
348
|
+
<a name="M000107"></a>
|
349
|
+
|
350
|
+
<div class="method-heading">
|
351
|
+
<a href="Configurator.src/M000107.html" target="Code" class="method-signature"
|
352
|
+
onclick="popupCode('Configurator.src/M000107.html');return false;">
|
353
|
+
<span class="method-name">load_mime_map</span><span class="method-args">(file, mime={})</span>
|
354
|
+
</a>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
<div class="method-description">
|
358
|
+
<p>
|
359
|
+
Loads the MIME map file and checks that it is correct on loading. This is
|
360
|
+
commonly passed to <a href="DirHandler.html">Mongrel::DirHandler</a> or any
|
361
|
+
framework handler that uses <a href="DirHandler.html">DirHandler</a> to
|
362
|
+
serve files. You can also include a set of default MIME types as additional
|
363
|
+
settings. See <a href="DirHandler.html">Mongrel::DirHandler</a> for how the
|
364
|
+
MIME types map is organized.
|
365
|
+
</p>
|
366
|
+
</div>
|
367
|
+
</div>
|
368
|
+
|
369
|
+
<div id="method-M000105" class="method-detail">
|
370
|
+
<a name="M000105"></a>
|
371
|
+
|
372
|
+
<div class="method-heading">
|
373
|
+
<a href="Configurator.src/M000105.html" target="Code" class="method-signature"
|
374
|
+
onclick="popupCode('Configurator.src/M000105.html');return false;">
|
375
|
+
<span class="method-name">load_plugins</span><span class="method-args">(options={})</span>
|
376
|
+
</a>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
<div class="method-description">
|
380
|
+
<p>
|
381
|
+
Uses the GemPlugin system to easily load plugins based on their gem
|
382
|
+
dependencies. You pass in either an :includes => [] or :excludes =>
|
383
|
+
[] setting listing the names of plugins to include or exclude from the
|
384
|
+
loading.
|
385
|
+
</p>
|
386
|
+
</div>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
<div id="method-M000106" class="method-detail">
|
390
|
+
<a name="M000106"></a>
|
391
|
+
|
392
|
+
<div class="method-heading">
|
393
|
+
<a href="Configurator.src/M000106.html" target="Code" class="method-signature"
|
394
|
+
onclick="popupCode('Configurator.src/M000106.html');return false;">
|
395
|
+
<span class="method-name">load_yaml</span><span class="method-args">(file, default={})</span>
|
396
|
+
</a>
|
397
|
+
</div>
|
398
|
+
|
399
|
+
<div class="method-description">
|
400
|
+
<p>
|
401
|
+
Easy way to load a YAML file and apply default settings.
|
402
|
+
</p>
|
403
|
+
</div>
|
404
|
+
</div>
|
405
|
+
|
406
|
+
<div id="method-M000114" class="method-detail">
|
407
|
+
<a name="M000114"></a>
|
408
|
+
|
409
|
+
<div class="method-heading">
|
410
|
+
<a href="Configurator.src/M000114.html" target="Code" class="method-signature"
|
411
|
+
onclick="popupCode('Configurator.src/M000114.html');return false;">
|
412
|
+
<span class="method-name">log</span><span class="method-args">(msg)</span>
|
413
|
+
</a>
|
414
|
+
</div>
|
415
|
+
|
416
|
+
<div class="method-description">
|
417
|
+
<p>
|
418
|
+
Logs a simple message to STDERR (or the mongrel log if in daemon mode).
|
419
|
+
</p>
|
420
|
+
</div>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
<div id="method-M000108" class="method-detail">
|
424
|
+
<a name="M000108"></a>
|
425
|
+
|
426
|
+
<div class="method-heading">
|
427
|
+
<a href="Configurator.src/M000108.html" target="Code" class="method-signature"
|
428
|
+
onclick="popupCode('Configurator.src/M000108.html');return false;">
|
429
|
+
<span class="method-name">plugin</span><span class="method-args">(name, options={})</span>
|
430
|
+
</a>
|
431
|
+
</div>
|
432
|
+
|
433
|
+
<div class="method-description">
|
434
|
+
<p>
|
435
|
+
Loads and creates a plugin for you based on the given name and configured
|
436
|
+
with the selected options. The options are merged with the defaults prior
|
437
|
+
to passing them in.
|
438
|
+
</p>
|
439
|
+
</div>
|
440
|
+
</div>
|
441
|
+
|
442
|
+
<div id="method-M000101" class="method-detail">
|
443
|
+
<a name="M000101"></a>
|
444
|
+
|
445
|
+
<div class="method-heading">
|
446
|
+
<a href="Configurator.src/M000101.html" target="Code" class="method-signature"
|
447
|
+
onclick="popupCode('Configurator.src/M000101.html');return false;">
|
448
|
+
<span class="method-name">resolve_defaults</span><span class="method-args">(options)</span>
|
449
|
+
</a>
|
450
|
+
</div>
|
451
|
+
|
452
|
+
<div class="method-description">
|
453
|
+
<p>
|
454
|
+
This will resolve the given options against the defaults. Normally just
|
455
|
+
used internally.
|
456
|
+
</p>
|
457
|
+
</div>
|
458
|
+
</div>
|
459
|
+
|
460
|
+
<div id="method-M000109" class="method-detail">
|
461
|
+
<a name="M000109"></a>
|
462
|
+
|
463
|
+
<div class="method-heading">
|
464
|
+
<a href="Configurator.src/M000109.html" target="Code" class="method-signature"
|
465
|
+
onclick="popupCode('Configurator.src/M000109.html');return false;">
|
466
|
+
<span class="method-name">run</span><span class="method-args">()</span>
|
467
|
+
</a>
|
468
|
+
</div>
|
469
|
+
|
470
|
+
<div class="method-description">
|
471
|
+
<p>
|
472
|
+
Works like a meta run method which goes through all the configured
|
473
|
+
listeners. Use the <a
|
474
|
+
href="Configurator.html#M000111">Configurator.join</a> method to prevent
|
475
|
+
Ruby from exiting until each one is done.
|
476
|
+
</p>
|
477
|
+
</div>
|
478
|
+
</div>
|
479
|
+
|
480
|
+
<div id="method-M000113" class="method-detail">
|
481
|
+
<a name="M000113"></a>
|
482
|
+
|
483
|
+
<div class="method-heading">
|
484
|
+
<a href="Configurator.src/M000113.html" target="Code" class="method-signature"
|
485
|
+
onclick="popupCode('Configurator.src/M000113.html');return false;">
|
486
|
+
<span class="method-name">setup_signals</span><span class="method-args">(options={})</span>
|
487
|
+
</a>
|
488
|
+
</div>
|
489
|
+
|
490
|
+
<div class="method-description">
|
491
|
+
<p>
|
492
|
+
Sets up the standard signal handlers that are used on most Ruby It only
|
493
|
+
configures if the platform is not win32 and doesn’t do a HUP signal
|
494
|
+
since this is typically framework specific.
|
495
|
+
</p>
|
496
|
+
<p>
|
497
|
+
Requires a :pid_file option to indicate a file to delete. It sets the
|
498
|
+
MongrelConfig.needs_restart attribute if the start command should reload.
|
499
|
+
It’s up to you to detect this and do whatever is needed for a
|
500
|
+
"restart".
|
501
|
+
</p>
|
502
|
+
<p>
|
503
|
+
This command is safely ignored if the platform is win32 (with a warning)
|
504
|
+
</p>
|
505
|
+
</div>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
<div id="method-M000110" class="method-detail">
|
509
|
+
<a name="M000110"></a>
|
510
|
+
|
511
|
+
<div class="method-heading">
|
512
|
+
<a href="Configurator.src/M000110.html" target="Code" class="method-signature"
|
513
|
+
onclick="popupCode('Configurator.src/M000110.html');return false;">
|
514
|
+
<span class="method-name">stop</span><span class="method-args">()</span>
|
515
|
+
</a>
|
516
|
+
</div>
|
517
|
+
|
518
|
+
<div class="method-description">
|
519
|
+
<p>
|
520
|
+
Calls .stop on all the configured listeners so they stop processing
|
521
|
+
requests (gracefully).
|
522
|
+
</p>
|
523
|
+
</div>
|
524
|
+
</div>
|
525
|
+
|
526
|
+
<div id="method-M000103" class="method-detail">
|
527
|
+
<a name="M000103"></a>
|
528
|
+
|
529
|
+
<div class="method-heading">
|
530
|
+
<a href="Configurator.src/M000103.html" target="Code" class="method-signature"
|
531
|
+
onclick="popupCode('Configurator.src/M000103.html');return false;">
|
532
|
+
<span class="method-name">uri</span><span class="method-args">(location, options={})</span>
|
533
|
+
</a>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
<div class="method-description">
|
537
|
+
<p>
|
538
|
+
Called inside a <a
|
539
|
+
href="Configurator.html#M000102">Configurator.listener</a> block in order
|
540
|
+
to add URI->handler mappings for that listener. Use this as many times
|
541
|
+
as you like. It expects the following options or defaults:
|
542
|
+
</p>
|
543
|
+
<ul>
|
544
|
+
<li>:handler => Handler to use for this location.
|
545
|
+
|
546
|
+
</li>
|
547
|
+
</ul>
|
548
|
+
</div>
|
549
|
+
</div>
|
550
|
+
|
551
|
+
|
552
|
+
</div>
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
|
558
|
+
<div id="validator-badges">
|
559
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
560
|
+
</div>
|
561
|
+
|
562
|
+
</body>
|
563
|
+
</html>
|