mongrel 0.3.12 → 0.3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. data/Rakefile +1 -1
  2. data/bin/mongrel_rails +12 -6
  3. data/doc/rdoc/classes/Class.src/M000001.html +10 -10
  4. data/doc/rdoc/classes/Class.src/M000002.html +46 -46
  5. data/doc/rdoc/classes/Class.src/M000003.html +7 -7
  6. data/doc/rdoc/classes/Class.src/M000004.html +6 -6
  7. data/doc/rdoc/classes/IO.src/M000005.html +5 -5
  8. data/doc/rdoc/classes/IO.src/M000006.html +5 -5
  9. data/doc/rdoc/classes/Kernel.src/M000025.html +5 -5
  10. data/doc/rdoc/classes/Kernel.src/M000026.html +11 -11
  11. data/doc/rdoc/classes/Mongrel.html +1 -0
  12. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +1 -1
  13. data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +10 -10
  14. data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +9 -9
  15. data/doc/rdoc/classes/Mongrel/Configurator.src/M000101.html +4 -4
  16. data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +18 -18
  17. data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +5 -5
  18. data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +16 -16
  19. data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +19 -19
  20. data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +4 -4
  21. data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +10 -11
  22. data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +5 -5
  23. data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +8 -8
  24. data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +7 -7
  25. data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +4 -4
  26. data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +14 -13
  27. data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +5 -33
  28. data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +33 -5
  29. data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +18 -0
  30. data/doc/rdoc/classes/Mongrel/Const.html +11 -1
  31. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000116.html +5 -5
  32. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000117.html +18 -0
  33. data/doc/rdoc/classes/Mongrel/HeaderOut.html +0 -185
  34. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000072.html +4 -4
  35. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000073.html +4 -4
  36. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +3 -1
  37. data/doc/rdoc/classes/Mongrel/{StopServer.html → HttpParserError.html} +5 -11
  38. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000118.html +15 -7
  39. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000119.html +7 -7
  40. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000120.html +7 -19
  41. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000121.html +32 -0
  42. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +12 -12
  43. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +6 -6
  44. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +11 -11
  45. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +8 -8
  46. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +8 -8
  47. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +9 -9
  48. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +4 -4
  49. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +6 -6
  50. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +4 -4
  51. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +10 -10
  52. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +51 -50
  53. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +10 -10
  54. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +45 -45
  55. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +14 -14
  56. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +4 -4
  57. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000070.html +8 -8
  58. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000071.html +4 -4
  59. data/doc/rdoc/classes/ObjectTracker.src/M000019.html +20 -22
  60. data/doc/rdoc/classes/RequestLog/Access.src/M000122.html +19 -0
  61. data/doc/rdoc/classes/RequestLog/Files.src/{M000121.html → M000123.html} +5 -5
  62. data/doc/rdoc/classes/RequestLog/Objects.src/{M000122.html → M000124.html} +5 -5
  63. data/doc/rdoc/classes/RequestLog/Params.src/{M000123.html → M000125.html} +5 -5
  64. data/doc/rdoc/classes/Stats.html +1 -1
  65. data/doc/rdoc/classes/Stats.src/M000012.html +2 -2
  66. data/doc/rdoc/created.rid +1 -1
  67. data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
  68. data/doc/rdoc/files/lib/mongrel/command_rb.html +1 -1
  69. data/doc/rdoc/files/lib/mongrel/debug_rb.html +1 -1
  70. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +1 -1
  71. data/doc/rdoc/files/lib/mongrel/stats_rb.html +1 -1
  72. data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
  73. data/examples/random_thrash.rb +19 -0
  74. data/ext/http11/http11.c +57 -12
  75. data/ext/http11/http11_parser.c +58 -52
  76. data/lib/mongrel.rb +37 -10
  77. data/lib/mongrel/command.rb +1 -1
  78. data/lib/mongrel/debug.rb +39 -125
  79. data/lib/mongrel/handlers.rb +2 -2
  80. data/lib/mongrel/rails.rb +2 -1
  81. data/lib/mongrel/stats.rb +2 -2
  82. data/test/test_configurator.rb +2 -2
  83. data/test/test_debug.rb +2 -4
  84. data/test/test_http11.rb +76 -7
  85. data/test/test_stats.rb +6 -4
  86. data/test/test_uriclassifier.rb +0 -14
  87. metadata +12 -24
  88. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -383
  89. data/doc/rdoc/classes/Mongrel/Configurator.html +0 -563
  90. data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
  91. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000115.html +0 -18
  92. data/doc/rdoc/classes/Mongrel/HttpHandler.html +0 -152
  93. data/doc/rdoc/classes/Mongrel/HttpRequest.html +0 -222
  94. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000117.html +0 -28
  95. data/doc/rdoc/classes/Mongrel/HttpResponse.html +0 -371
  96. data/doc/rdoc/classes/Mongrel/URIClassifier.html +0 -301
  97. data/doc/rdoc/classes/RequestLog.html +0 -113
  98. data/doc/rdoc/classes/RequestLog/Files.html +0 -144
  99. data/doc/rdoc/classes/RequestLog/Objects.html +0 -144
  100. data/doc/rdoc/classes/RequestLog/Params.html +0 -144
  101. data/doc/rdoc/fr_class_index.html +0 -60
  102. data/doc/rdoc/fr_file_index.html +0 -40
  103. data/doc/rdoc/fr_method_index.html +0 -149
  104. data/doc/rdoc/index.html +0 -24
  105. data/lib/http11.bundle +0 -0
@@ -1,383 +0,0 @@
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::CGIWrapper</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::CGIWrapper</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/mongrel/cgi_rb.html">
59
- lib/mongrel/cgi.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
- ::CGI
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
- The beginning of a complete wrapper around <a
84
- href="../Mongrel.html">Mongrel</a>&#8217;s internal HTTP processing system
85
- but maintaining the original Ruby CGI module. Use this only as a crutch to
86
- get existing CGI based systems working. It should handle everything, but
87
- please notify me if you see special warnings. This work is still very alpha
88
- so I need testers to help work out the various corner cases.
89
- </p>
90
- <p>
91
- The CGIWrapper.handler attribute is normally not set and is available for
92
- frameworks that need to get back to the handler. <a
93
- href="Rails.html">Rails</a> uses this to give people access to the
94
- RailsHandler#files (<a href="DirHandler.html">DirHandler</a> really) so
95
- they can look-up paths and do other things withthe files managed there.
96
- </p>
97
- <p>
98
- In <a href="Rails.html">Rails</a> you can get the real file for a request
99
- with:
100
- </p>
101
- <pre>
102
- path = @request.cgi.handler.files.can_serve(@request['PATH_INFO'])
103
- </pre>
104
- <p>
105
- Which is ugly but does the job. Feel free to write a <a
106
- href="Rails.html">Rails</a> helper for that. Refer to <a
107
- href="DirHandler.html#M000059">DirHandler#can_serve</a> for more
108
- information on this.
109
- </p>
110
-
111
- </div>
112
-
113
-
114
- </div>
115
-
116
- <div id="method-list">
117
- <h3 class="section-bar">Methods</h3>
118
-
119
- <div class="name-list">
120
- <a href="#M000095">args</a>&nbsp;&nbsp;
121
- <a href="#M000096">env_table</a>&nbsp;&nbsp;
122
- <a href="#M000091">header</a>&nbsp;&nbsp;
123
- <a href="#M000090">new</a>&nbsp;&nbsp;
124
- <a href="#M000093">out</a>&nbsp;&nbsp;
125
- <a href="#M000092">send_cookies</a>&nbsp;&nbsp;
126
- <a href="#M000094">status</a>&nbsp;&nbsp;
127
- <a href="#M000097">stdinput</a>&nbsp;&nbsp;
128
- <a href="#M000098">stdoutput</a>&nbsp;&nbsp;
129
- </div>
130
- </div>
131
-
132
- </div>
133
-
134
-
135
- <!-- if includes -->
136
-
137
- <div id="section">
138
-
139
-
140
- <div id="constants-list">
141
- <h3 class="section-bar">Constants</h3>
142
-
143
- <div class="name-list">
144
- <table summary="Constants">
145
- <tr class="top-aligned-row context-row">
146
- <td class="context-item-name">REMOVED_KEYS</td>
147
- <td>=</td>
148
- <td class="context-item-value">[ &quot;nph&quot;,&quot;status&quot;,&quot;server&quot;,&quot;connection&quot;,&quot;type&quot;, &quot;charset&quot;,&quot;length&quot;,&quot;language&quot;,&quot;expires&quot;]</td>
149
- <td width="3em">&nbsp;</td>
150
- <td class="context-item-desc">
151
- these are stripped out of any keys passed to <a
152
- href="CGIWrapper.html#M000091">CGIWrapper.header</a> function
153
-
154
- </td>
155
- </tr>
156
- </table>
157
- </div>
158
- </div>
159
-
160
-
161
-
162
- <div id="attribute-list">
163
- <h3 class="section-bar">Attributes</h3>
164
-
165
- <div class="name-list">
166
- <table>
167
- <tr class="top-aligned-row context-row">
168
- <td class="context-item-name">handler</td>
169
- <td class="context-item-value">&nbsp;[W]&nbsp;</td>
170
- <td class="context-item-desc"></td>
171
- </tr>
172
- <tr class="top-aligned-row context-row">
173
- <td class="context-item-name">handler</td>
174
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
175
- <td class="context-item-desc"></td>
176
- </tr>
177
- <tr class="top-aligned-row context-row">
178
- <td class="context-item-name">options</td>
179
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
180
- <td class="context-item-desc"></td>
181
- </tr>
182
- </table>
183
- </div>
184
- </div>
185
-
186
-
187
-
188
- <!-- if method_list -->
189
- <div id="methods">
190
- <h3 class="section-bar">Public Class methods</h3>
191
-
192
- <div id="method-M000090" class="method-detail">
193
- <a name="M000090"></a>
194
-
195
- <div class="method-heading">
196
- <a href="CGIWrapper.src/M000090.html" target="Code" class="method-signature"
197
- onclick="popupCode('CGIWrapper.src/M000090.html');return false;">
198
- <span class="method-name">new</span><span class="method-args">(request, response, *args)</span>
199
- </a>
200
- </div>
201
-
202
- <div class="method-description">
203
- <p>
204
- Takes an <a href="HttpRequest.html">HttpRequest</a> and <a
205
- href="HttpResponse.html">HttpResponse</a> object, plus any additional
206
- arguments normally passed to CGI. These are used internally to create a
207
- wrapper around the real CGI while maintaining <a
208
- href="../Mongrel.html">Mongrel</a>&#8217;s view of the world.
209
- </p>
210
- </div>
211
- </div>
212
-
213
- <h3 class="section-bar">Public Instance methods</h3>
214
-
215
- <div id="method-M000095" class="method-detail">
216
- <a name="M000095"></a>
217
-
218
- <div class="method-heading">
219
- <a href="CGIWrapper.src/M000095.html" target="Code" class="method-signature"
220
- onclick="popupCode('CGIWrapper.src/M000095.html');return false;">
221
- <span class="method-name">args</span><span class="method-args">()</span>
222
- </a>
223
- </div>
224
-
225
- <div class="method-description">
226
- <p>
227
- Used to wrap the normal args variable used inside CGI.
228
- </p>
229
- </div>
230
- </div>
231
-
232
- <div id="method-M000096" class="method-detail">
233
- <a name="M000096"></a>
234
-
235
- <div class="method-heading">
236
- <a href="CGIWrapper.src/M000096.html" target="Code" class="method-signature"
237
- onclick="popupCode('CGIWrapper.src/M000096.html');return false;">
238
- <span class="method-name">env_table</span><span class="method-args">()</span>
239
- </a>
240
- </div>
241
-
242
- <div class="method-description">
243
- <p>
244
- Used to wrap the normal <a href="CGIWrapper.html#M000096">env_table</a>
245
- variable used inside CGI.
246
- </p>
247
- </div>
248
- </div>
249
-
250
- <div id="method-M000091" class="method-detail">
251
- <a name="M000091"></a>
252
-
253
- <div class="method-heading">
254
- <a href="CGIWrapper.src/M000091.html" target="Code" class="method-signature"
255
- onclick="popupCode('CGIWrapper.src/M000091.html');return false;">
256
- <span class="method-name">header</span><span class="method-args">(options = &quot;text/html&quot;)</span>
257
- </a>
258
- </div>
259
-
260
- <div class="method-description">
261
- <p>
262
- The header is typically called to send back the header. In our case we
263
- collect it into a hash for later usage.
264
- </p>
265
- <p>
266
- nph &#8212; Mostly ignored. It&#8216;ll output the date. connection &#8212;
267
- Completely ignored. Why is CGI doing this? length &#8212; Ignored since <a
268
- href="../Mongrel.html">Mongrel</a> figures this out from what you write to
269
- output.
270
- </p>
271
- </div>
272
- </div>
273
-
274
- <div id="method-M000093" class="method-detail">
275
- <a name="M000093"></a>
276
-
277
- <div class="method-heading">
278
- <a href="CGIWrapper.src/M000093.html" target="Code" class="method-signature"
279
- onclick="popupCode('CGIWrapper.src/M000093.html');return false;">
280
- <span class="method-name">out</span><span class="method-args">(options = &quot;text/html&quot;) {||| &quot;&quot;)| ...}</span>
281
- </a>
282
- </div>
283
-
284
- <div class="method-description">
285
- <p>
286
- The dumb thing is people can call header or this or both and in any order.
287
- So, we just reuse header and then finalize the <a
288
- href="HttpResponse.html">HttpResponse</a> the right way. Status is taken
289
- from the various options and converted to what <a
290
- href="../Mongrel.html">Mongrel</a> needs via the <a
291
- href="CGIWrapper.html#M000094">CGIWrapper.status</a> function.
292
- </p>
293
- </div>
294
- </div>
295
-
296
- <div id="method-M000092" class="method-detail">
297
- <a name="M000092"></a>
298
-
299
- <div class="method-heading">
300
- <a href="CGIWrapper.src/M000092.html" target="Code" class="method-signature"
301
- onclick="popupCode('CGIWrapper.src/M000092.html');return false;">
302
- <span class="method-name">send_cookies</span><span class="method-args">(to)</span>
303
- </a>
304
- </div>
305
-
306
- <div class="method-description">
307
- <p>
308
- Takes any &#8216;cookie&#8217; setting and sends it over the <a
309
- href="../Mongrel.html">Mongrel</a> header, then removes the setting from
310
- the options. If cookie is an Array or Hash then it sends those on with
311
- .to_s, otherwise it just calls .to_s on it and hopefully your
312
- &quot;cookie&quot; can write itself correctly.
313
- </p>
314
- </div>
315
- </div>
316
-
317
- <div id="method-M000094" class="method-detail">
318
- <a name="M000094"></a>
319
-
320
- <div class="method-heading">
321
- <a href="CGIWrapper.src/M000094.html" target="Code" class="method-signature"
322
- onclick="popupCode('CGIWrapper.src/M000094.html');return false;">
323
- <span class="method-name">status</span><span class="method-args">()</span>
324
- </a>
325
- </div>
326
-
327
- <div class="method-description">
328
- <p>
329
- Computes the status once, but lazily so that people who call header twice
330
- don&#8217;t get penalized. Because CGI insists on including the options
331
- status message in the status we have to do a bit of parsing.
332
- </p>
333
- </div>
334
- </div>
335
-
336
- <div id="method-M000097" class="method-detail">
337
- <a name="M000097"></a>
338
-
339
- <div class="method-heading">
340
- <a href="CGIWrapper.src/M000097.html" target="Code" class="method-signature"
341
- onclick="popupCode('CGIWrapper.src/M000097.html');return false;">
342
- <span class="method-name">stdinput</span><span class="method-args">()</span>
343
- </a>
344
- </div>
345
-
346
- <div class="method-description">
347
- <p>
348
- Used to wrap the normal stdinput variable used inside CGI.
349
- </p>
350
- </div>
351
- </div>
352
-
353
- <div id="method-M000098" class="method-detail">
354
- <a name="M000098"></a>
355
-
356
- <div class="method-heading">
357
- <a href="CGIWrapper.src/M000098.html" target="Code" class="method-signature"
358
- onclick="popupCode('CGIWrapper.src/M000098.html');return false;">
359
- <span class="method-name">stdoutput</span><span class="method-args">()</span>
360
- </a>
361
- </div>
362
-
363
- <div class="method-description">
364
- <p>
365
- The stdoutput should be completely bypassed but we&#8217;ll drop a warning
366
- just in case
367
- </p>
368
- </div>
369
- </div>
370
-
371
-
372
- </div>
373
-
374
-
375
- </div>
376
-
377
-
378
- <div id="validator-badges">
379
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
380
- </div>
381
-
382
- </body>
383
- </html>
@@ -1,563 +0,0 @@
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 =&gt; &quot;127.0.0.1&quot; do
95
- listener :port =&gt; 3000 do
96
- uri &quot;/app&quot;, :handler =&gt; Mongrel::DirHandler.new(&quot;.&quot;, load_mime_map(&quot;mime.yaml&quot;))
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
- =&gt; &quot;127.0.0.1&quot; 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>&nbsp;&nbsp;
131
- <a href="#M000104">daemonize</a>&nbsp;&nbsp;
132
- <a href="#M000112">debug</a>&nbsp;&nbsp;
133
- <a href="#M000111">join</a>&nbsp;&nbsp;
134
- <a href="#M000102">listener</a>&nbsp;&nbsp;
135
- <a href="#M000107">load_mime_map</a>&nbsp;&nbsp;
136
- <a href="#M000105">load_plugins</a>&nbsp;&nbsp;
137
- <a href="#M000106">load_yaml</a>&nbsp;&nbsp;
138
- <a href="#M000114">log</a>&nbsp;&nbsp;
139
- <a href="#M000099">new</a>&nbsp;&nbsp;
140
- <a href="#M000108">plugin</a>&nbsp;&nbsp;
141
- <a href="#M000101">resolve_defaults</a>&nbsp;&nbsp;
142
- <a href="#M000109">run</a>&nbsp;&nbsp;
143
- <a href="#M000113">setup_signals</a>&nbsp;&nbsp;
144
- <a href="#M000110">stop</a>&nbsp;&nbsp;
145
- <a href="#M000103">uri</a>&nbsp;&nbsp;
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">&nbsp;[R]&nbsp;</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">&nbsp;[R]&nbsp;</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">&nbsp;[R]&nbsp;</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={}, &amp;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">(&amp;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
- &quot;server&quot; 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 =&gt; Directory to change to.
251
-
252
- </li>
253
- <li>:log_file =&gt; Where to write STDOUT and STDERR.
254
-
255
- </li>
256
- <li>:pid_file =&gt; 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={},&amp;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 =&gt; Host name to bind.
330
-
331
- </li>
332
- <li>:port =&gt; Port to bind.
333
-
334
- </li>
335
- <li>:num_processors =&gt; The maximum number of concurrent threads allowed.
336
- (950 default)
337
-
338
- </li>
339
- <li>:timeout =&gt; 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 =&gt; [] or :excludes =&gt;
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&#8217;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&#8217;s up to you to detect this and do whatever is needed for a
500
- &quot;restart&quot;.
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-&gt;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 =&gt; 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>