mongrel 0.3 → 0.3.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 (78) hide show
  1. data/README +24 -28
  2. data/Rakefile +11 -4
  3. data/bin/mongrel_rails +82 -25
  4. data/doc/rdoc/classes/FactoryError.html +144 -0
  5. data/doc/rdoc/classes/FactoryError.src/M000001.html +23 -0
  6. data/doc/rdoc/classes/Mongrel.html +5 -5
  7. data/doc/rdoc/classes/Mongrel.src/{M000001.html → M000015.html} +4 -4
  8. data/doc/rdoc/classes/Mongrel/Const.html +2 -2
  9. data/doc/rdoc/classes/Mongrel/DirHandler.html +26 -26
  10. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000009.html → M000023.html} +0 -0
  11. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000010.html → M000024.html} +5 -2
  12. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000011.html → M000025.html} +26 -26
  13. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000012.html → M000026.html} +17 -17
  14. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000013.html → M000027.html} +24 -24
  15. data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
  16. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000033.html → M000047.html} +0 -0
  17. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000034.html → M000048.html} +0 -0
  18. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  19. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000019.html → M000033.html} +0 -0
  20. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000020.html → M000034.html} +0 -0
  21. data/doc/rdoc/classes/Mongrel/HttpHandler.html +5 -5
  22. data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000025.html → M000039.html} +0 -0
  23. data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
  24. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000002.html → M000016.html} +0 -0
  25. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000003.html → M000017.html} +0 -0
  26. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000004.html → M000018.html} +0 -0
  27. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000005.html → M000019.html} +0 -0
  28. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000006.html → M000020.html} +0 -0
  29. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000007.html → M000021.html} +0 -0
  30. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000008.html → M000022.html} +0 -0
  31. data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
  32. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000035.html → M000049.html} +0 -0
  33. data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
  34. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000026.html → M000040.html} +0 -0
  35. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000027.html → M000041.html} +1 -1
  36. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000028.html → M000042.html} +0 -0
  37. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000029.html → M000043.html} +1 -1
  38. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000030.html → M000044.html} +0 -0
  39. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000031.html → M000045.html} +0 -0
  40. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000032.html → M000046.html} +0 -0
  41. data/doc/rdoc/classes/Mongrel/HttpServer.html +28 -28
  42. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000014.html → M000028.html} +0 -0
  43. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000015.html → M000029.html} +0 -0
  44. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000016.html → M000030.html} +0 -0
  45. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000017.html → M000031.html} +0 -0
  46. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000018.html → M000032.html} +0 -0
  47. data/doc/rdoc/classes/Mongrel/URIClassifier.html +20 -20
  48. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000021.html → M000035.html} +0 -0
  49. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000022.html → M000036.html} +0 -0
  50. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000023.html → M000037.html} +0 -0
  51. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000024.html → M000038.html} +0 -0
  52. data/doc/rdoc/classes/PluginFactory.html +409 -0
  53. data/doc/rdoc/classes/PluginFactory.src/M000002.html +18 -0
  54. data/doc/rdoc/classes/PluginFactory.src/M000003.html +18 -0
  55. data/doc/rdoc/classes/PluginFactory.src/M000004.html +22 -0
  56. data/doc/rdoc/classes/PluginFactory.src/M000005.html +22 -0
  57. data/doc/rdoc/classes/PluginFactory.src/M000006.html +33 -0
  58. data/doc/rdoc/classes/PluginFactory.src/M000007.html +32 -0
  59. data/doc/rdoc/classes/PluginFactory.src/M000008.html +18 -0
  60. data/doc/rdoc/classes/PluginFactory.src/M000009.html +24 -0
  61. data/doc/rdoc/classes/PluginFactory.src/M000010.html +40 -0
  62. data/doc/rdoc/classes/PluginFactory.src/M000011.html +39 -0
  63. data/doc/rdoc/classes/PluginFactory.src/M000012.html +24 -0
  64. data/doc/rdoc/classes/PluginFactory.src/M000013.html +70 -0
  65. data/doc/rdoc/classes/PluginFactory.src/M000014.html +34 -0
  66. data/doc/rdoc/created.rid +1 -1
  67. data/doc/rdoc/files/README.html +29 -37
  68. data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
  69. data/doc/rdoc/files/lib/pluginfactory_rb.html +132 -0
  70. data/doc/rdoc/fr_class_index.html +2 -0
  71. data/doc/rdoc/fr_file_index.html +1 -0
  72. data/doc/rdoc/fr_method_index.html +49 -35
  73. data/examples/simpletest.rb +10 -3
  74. data/lib/mongrel.rb +6 -3
  75. data/lib/mongrel/command.rb +192 -0
  76. data/lib/pluginfactory.rb +384 -0
  77. data/tools/rakehelp.rb +33 -29
  78. metadata +71 -41
@@ -103,11 +103,11 @@ than it simply gives a 404.
103
103
  <h3 class="section-bar">Methods</h3>
104
104
 
105
105
  <div class="name-list">
106
- <a href="#M000010">can_serve</a>&nbsp;&nbsp;
107
- <a href="#M000009">new</a>&nbsp;&nbsp;
108
- <a href="#M000013">process</a>&nbsp;&nbsp;
109
- <a href="#M000011">send_dir_listing</a>&nbsp;&nbsp;
110
- <a href="#M000012">send_file</a>&nbsp;&nbsp;
106
+ <a href="#M000024">can_serve</a>&nbsp;&nbsp;
107
+ <a href="#M000023">new</a>&nbsp;&nbsp;
108
+ <a href="#M000027">process</a>&nbsp;&nbsp;
109
+ <a href="#M000025">send_dir_listing</a>&nbsp;&nbsp;
110
+ <a href="#M000026">send_file</a>&nbsp;&nbsp;
111
111
  </div>
112
112
  </div>
113
113
 
@@ -155,12 +155,12 @@ than it simply gives a 404.
155
155
  <div id="methods">
156
156
  <h3 class="section-bar">Public Class methods</h3>
157
157
 
158
- <div id="method-M000009" class="method-detail">
159
- <a name="M000009"></a>
158
+ <div id="method-M000023" class="method-detail">
159
+ <a name="M000023"></a>
160
160
 
161
161
  <div class="method-heading">
162
- <a href="DirHandler.src/M000009.html" target="Code" class="method-signature"
163
- onclick="popupCode('DirHandler.src/M000009.html');return false;">
162
+ <a href="DirHandler.src/M000023.html" target="Code" class="method-signature"
163
+ onclick="popupCode('DirHandler.src/M000023.html');return false;">
164
164
  <span class="method-name">new</span><span class="method-args">(path, listing_allowed=true, index_html=&quot;index.html&quot;)</span>
165
165
  </a>
166
166
  </div>
@@ -174,12 +174,12 @@ You give it the path to the directory root and an (optional)
174
174
 
175
175
  <h3 class="section-bar">Public Instance methods</h3>
176
176
 
177
- <div id="method-M000010" class="method-detail">
178
- <a name="M000010"></a>
177
+ <div id="method-M000024" class="method-detail">
178
+ <a name="M000024"></a>
179
179
 
180
180
  <div class="method-heading">
181
- <a href="DirHandler.src/M000010.html" target="Code" class="method-signature"
182
- onclick="popupCode('DirHandler.src/M000010.html');return false;">
181
+ <a href="DirHandler.src/M000024.html" target="Code" class="method-signature"
182
+ onclick="popupCode('DirHandler.src/M000024.html');return false;">
183
183
  <span class="method-name">can_serve</span><span class="method-args">(path_info)</span>
184
184
  </a>
185
185
  </div>
@@ -192,12 +192,12 @@ not).
192
192
  </div>
193
193
  </div>
194
194
 
195
- <div id="method-M000013" class="method-detail">
196
- <a name="M000013"></a>
195
+ <div id="method-M000027" class="method-detail">
196
+ <a name="M000027"></a>
197
197
 
198
198
  <div class="method-heading">
199
- <a href="DirHandler.src/M000013.html" target="Code" class="method-signature"
200
- onclick="popupCode('DirHandler.src/M000013.html');return false;">
199
+ <a href="DirHandler.src/M000027.html" target="Code" class="method-signature"
200
+ onclick="popupCode('DirHandler.src/M000027.html');return false;">
201
201
  <span class="method-name">process</span><span class="method-args">(request, response)</span>
202
202
  </a>
203
203
  </div>
@@ -210,12 +210,12 @@ allowed (based on the listing_allowed paramter to the constructor).
210
210
  </div>
211
211
  </div>
212
212
 
213
- <div id="method-M000011" class="method-detail">
214
- <a name="M000011"></a>
213
+ <div id="method-M000025" class="method-detail">
214
+ <a name="M000025"></a>
215
215
 
216
216
  <div class="method-heading">
217
- <a href="DirHandler.src/M000011.html" target="Code" class="method-signature"
218
- onclick="popupCode('DirHandler.src/M000011.html');return false;">
217
+ <a href="DirHandler.src/M000025.html" target="Code" class="method-signature"
218
+ onclick="popupCode('DirHandler.src/M000025.html');return false;">
219
219
  <span class="method-name">send_dir_listing</span><span class="method-args">(base, dir, response)</span>
220
220
  </a>
221
221
  </div>
@@ -225,18 +225,18 @@ allowed (based on the listing_allowed paramter to the constructor).
225
225
  Returns a simplistic directory listing if they&#8217;re enabled, otherwise
226
226
  a 403. Base is the base URI from the REQUEST_URI, dir is the directory to
227
227
  serve on the file system (comes from <a
228
- href="DirHandler.html#M000010">can_serve</a>()), and response is the <a
228
+ href="DirHandler.html#M000024">can_serve</a>()), and response is the <a
229
229
  href="HttpResponse.html">HttpResponse</a> object to send the results on.
230
230
  </p>
231
231
  </div>
232
232
  </div>
233
233
 
234
- <div id="method-M000012" class="method-detail">
235
- <a name="M000012"></a>
234
+ <div id="method-M000026" class="method-detail">
235
+ <a name="M000026"></a>
236
236
 
237
237
  <div class="method-heading">
238
- <a href="DirHandler.src/M000012.html" target="Code" class="method-signature"
239
- onclick="popupCode('DirHandler.src/M000012.html');return false;">
238
+ <a href="DirHandler.src/M000026.html" target="Code" class="method-signature"
239
+ onclick="popupCode('DirHandler.src/M000026.html');return false;">
240
240
  <span class="method-name">send_file</span><span class="method-args">(req, response)</span>
241
241
  </a>
242
242
  </div>
@@ -33,7 +33,10 @@
33
33
  489: <span class="ruby-comment cmt"># it's a file and it's there</span>
34
34
  490: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">req</span>
35
35
  491: <span class="ruby-keyword kw">end</span>
36
- 492: <span class="ruby-keyword kw">end</span>
37
- 493: <span class="ruby-keyword kw">end</span></pre>
36
+ 492: <span class="ruby-keyword kw">else</span>
37
+ 493: <span class="ruby-comment cmt"># does not exist or isn't in the right spot</span>
38
+ 494: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
39
+ 495: <span class="ruby-keyword kw">end</span>
40
+ 496: <span class="ruby-keyword kw">end</span></pre>
38
41
  </body>
39
42
  </html>
@@ -10,31 +10,31 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 500</span>
14
- 500: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">base</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">response</span>)
15
- 501: <span class="ruby-comment cmt"># take off any trailing / so the links come out right</span>
16
- 502: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">chop!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;/&quot;</span>[<span class="ruby-value">-1</span>]
17
- 503:
18
- 504: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@listing_allowed</span>
19
- 505: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
20
- 506: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">&quot;text/html&quot;</span>
21
- 507: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Directory Listing&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&quot;</span>
22
- 508: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
23
- 509: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;.&quot;</span>
24
- 510:
25
- 511: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;..&quot;</span>
26
- 512: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;a href=\&quot;#{base}/#{child}\&quot;&gt;Up to parent..&lt;/a&gt;&lt;br/&gt;&quot;</span>
27
- 513: <span class="ruby-keyword kw">else</span>
28
- 514: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;a href=\&quot;#{base}/#{child}\&quot;&gt;#{child}&lt;/a&gt;&lt;br/&gt;&quot;</span>
29
- 515: <span class="ruby-keyword kw">end</span>
30
- 516: <span class="ruby-keyword kw">end</span>
31
- 517: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</span>
32
- 518: <span class="ruby-keyword kw">end</span>
33
- 519: <span class="ruby-keyword kw">else</span>
34
- 520: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
35
- 521: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;Directory listings not allowed&quot;</span>)
36
- 522: <span class="ruby-keyword kw">end</span>
37
- 523: <span class="ruby-keyword kw">end</span>
38
- 524: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 503</span>
14
+ 503: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">base</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">response</span>)
15
+ 504: <span class="ruby-comment cmt"># take off any trailing / so the links come out right</span>
16
+ 505: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">chop!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;/&quot;</span>[<span class="ruby-value">-1</span>]
17
+ 506:
18
+ 507: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@listing_allowed</span>
19
+ 508: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
20
+ 509: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">&quot;text/html&quot;</span>
21
+ 510: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Directory Listing&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&quot;</span>
22
+ 511: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
23
+ 512: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;.&quot;</span>
24
+ 513:
25
+ 514: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;..&quot;</span>
26
+ 515: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;a href=\&quot;#{base}/#{child}\&quot;&gt;Up to parent..&lt;/a&gt;&lt;br/&gt;&quot;</span>
27
+ 516: <span class="ruby-keyword kw">else</span>
28
+ 517: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;a href=\&quot;#{base}/#{child}\&quot;&gt;#{child}&lt;/a&gt;&lt;br/&gt;&quot;</span>
29
+ 518: <span class="ruby-keyword kw">end</span>
30
+ 519: <span class="ruby-keyword kw">end</span>
31
+ 520: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</span>
32
+ 521: <span class="ruby-keyword kw">end</span>
33
+ 522: <span class="ruby-keyword kw">else</span>
34
+ 523: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
35
+ 524: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;Directory listings not allowed&quot;</span>)
36
+ 525: <span class="ruby-keyword kw">end</span>
37
+ 526: <span class="ruby-keyword kw">end</span>
38
+ 527: <span class="ruby-keyword kw">end</span></pre>
39
39
  </body>
40
40
  </html>
@@ -10,22 +10,22 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 529</span>
14
- 529: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
15
- 530: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
16
- 531: <span class="ruby-comment cmt"># set the mime type from our map based on the ending</span>
17
- 532: <span class="ruby-identifier">dot_at</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">&quot;.&quot;</span>)
18
- 533: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dot_at</span>
19
- 534: <span class="ruby-identifier">ext</span> = <span class="ruby-identifier">req</span>[<span class="ruby-identifier">dot_at</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]
20
- 535: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
21
- 536: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
22
- 537: <span class="ruby-keyword kw">end</span>
23
- 538: <span class="ruby-keyword kw">end</span>
24
- 539:
25
- 540: <span class="ruby-identifier">open</span>(<span class="ruby-identifier">req</span>, <span class="ruby-value str">&quot;r&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
26
- 541: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>)
27
- 542: <span class="ruby-keyword kw">end</span>
28
- 543: <span class="ruby-keyword kw">end</span>
29
- 544: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 532</span>
14
+ 532: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
15
+ 533: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
16
+ 534: <span class="ruby-comment cmt"># set the mime type from our map based on the ending</span>
17
+ 535: <span class="ruby-identifier">dot_at</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">&quot;.&quot;</span>)
18
+ 536: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dot_at</span>
19
+ 537: <span class="ruby-identifier">ext</span> = <span class="ruby-identifier">req</span>[<span class="ruby-identifier">dot_at</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]
20
+ 538: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
21
+ 539: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
22
+ 540: <span class="ruby-keyword kw">end</span>
23
+ 541: <span class="ruby-keyword kw">end</span>
24
+ 542:
25
+ 543: <span class="ruby-identifier">open</span>(<span class="ruby-identifier">req</span>, <span class="ruby-value str">&quot;r&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
26
+ 544: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>)
27
+ 545: <span class="ruby-keyword kw">end</span>
28
+ 546: <span class="ruby-keyword kw">end</span>
29
+ 547: <span class="ruby-keyword kw">end</span></pre>
30
30
  </body>
31
31
  </html>
@@ -10,29 +10,29 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 549</span>
14
- 549: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
15
- 550: <span class="ruby-identifier">req</span> = <span class="ruby-identifier">can_serve</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">'PATH_INFO'</span>]
16
- 551: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">req</span>
17
- 552: <span class="ruby-comment cmt"># not found, return a 404</span>
18
- 553: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">404</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
19
- 554: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;File not found&quot;</span>
20
- 555: <span class="ruby-keyword kw">end</span>
21
- 556: <span class="ruby-keyword kw">else</span>
22
- 557: <span class="ruby-keyword kw">begin</span>
23
- 558: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req</span>
24
- 559: <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">&quot;REQUEST_URI&quot;</span>],<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
25
- 560: <span class="ruby-keyword kw">else</span>
26
- 561: <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
27
- 562: <span class="ruby-keyword kw">end</span>
28
- 563: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">details</span>
29
- 564: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">reset</span>
30
- 565: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
31
- 566: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Error accessing file: #{details}&quot;</span>
32
- 567: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">details</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
33
- 568: <span class="ruby-keyword kw">end</span>
34
- 569: <span class="ruby-keyword kw">end</span>
35
- 570: <span class="ruby-keyword kw">end</span>
36
- 571: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 552</span>
14
+ 552: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
15
+ 553: <span class="ruby-identifier">req</span> = <span class="ruby-identifier">can_serve</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">'PATH_INFO'</span>]
16
+ 554: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">req</span>
17
+ 555: <span class="ruby-comment cmt"># not found, return a 404</span>
18
+ 556: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">404</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
19
+ 557: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;File not found&quot;</span>
20
+ 558: <span class="ruby-keyword kw">end</span>
21
+ 559: <span class="ruby-keyword kw">else</span>
22
+ 560: <span class="ruby-keyword kw">begin</span>
23
+ 561: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req</span>
24
+ 562: <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">&quot;REQUEST_URI&quot;</span>],<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
25
+ 563: <span class="ruby-keyword kw">else</span>
26
+ 564: <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
27
+ 565: <span class="ruby-keyword kw">end</span>
28
+ 566: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">details</span>
29
+ 567: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">reset</span>
30
+ 568: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
31
+ 569: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Error accessing file: #{details}&quot;</span>
32
+ 570: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">details</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
33
+ 571: <span class="ruby-keyword kw">end</span>
34
+ 572: <span class="ruby-keyword kw">end</span>
35
+ 573: <span class="ruby-keyword kw">end</span>
36
+ 574: <span class="ruby-keyword kw">end</span></pre>
37
37
  </body>
38
38
  </html>
@@ -96,8 +96,8 @@ custom message for special URIs.
96
96
  <h3 class="section-bar">Methods</h3>
97
97
 
98
98
  <div class="name-list">
99
- <a href="#M000033">new</a>&nbsp;&nbsp;
100
- <a href="#M000034">process</a>&nbsp;&nbsp;
99
+ <a href="#M000047">new</a>&nbsp;&nbsp;
100
+ <a href="#M000048">process</a>&nbsp;&nbsp;
101
101
  </div>
102
102
  </div>
103
103
 
@@ -119,12 +119,12 @@ custom message for special URIs.
119
119
  <div id="methods">
120
120
  <h3 class="section-bar">Public Class methods</h3>
121
121
 
122
- <div id="method-M000033" class="method-detail">
123
- <a name="M000033"></a>
122
+ <div id="method-M000047" class="method-detail">
123
+ <a name="M000047"></a>
124
124
 
125
125
  <div class="method-heading">
126
- <a href="Error404Handler.src/M000033.html" target="Code" class="method-signature"
127
- onclick="popupCode('Error404Handler.src/M000033.html');return false;">
126
+ <a href="Error404Handler.src/M000047.html" target="Code" class="method-signature"
127
+ onclick="popupCode('Error404Handler.src/M000047.html');return false;">
128
128
  <span class="method-name">new</span><span class="method-args">(msg)</span>
129
129
  </a>
130
130
  </div>
@@ -139,12 +139,12 @@ it&#8217;s pretty efficient.
139
139
 
140
140
  <h3 class="section-bar">Public Instance methods</h3>
141
141
 
142
- <div id="method-M000034" class="method-detail">
143
- <a name="M000034"></a>
142
+ <div id="method-M000048" class="method-detail">
143
+ <a name="M000048"></a>
144
144
 
145
145
  <div class="method-heading">
146
- <a href="Error404Handler.src/M000034.html" target="Code" class="method-signature"
147
- onclick="popupCode('Error404Handler.src/M000034.html');return false;">
146
+ <a href="Error404Handler.src/M000048.html" target="Code" class="method-signature"
147
+ onclick="popupCode('Error404Handler.src/M000048.html');return false;">
148
148
  <span class="method-name">process</span><span class="method-args">(request, response)</span>
149
149
  </a>
150
150
  </div>
@@ -101,8 +101,8 @@ there.
101
101
  <h3 class="section-bar">Methods</h3>
102
102
 
103
103
  <div class="name-list">
104
- <a href="#M000020">[]=</a>&nbsp;&nbsp;
105
- <a href="#M000019">new</a>&nbsp;&nbsp;
104
+ <a href="#M000034">[]=</a>&nbsp;&nbsp;
105
+ <a href="#M000033">new</a>&nbsp;&nbsp;
106
106
  </div>
107
107
  </div>
108
108
 
@@ -137,12 +137,12 @@ there.
137
137
  <div id="methods">
138
138
  <h3 class="section-bar">Public Class methods</h3>
139
139
 
140
- <div id="method-M000019" class="method-detail">
141
- <a name="M000019"></a>
140
+ <div id="method-M000033" class="method-detail">
141
+ <a name="M000033"></a>
142
142
 
143
143
  <div class="method-heading">
144
- <a href="HeaderOut.src/M000019.html" target="Code" class="method-signature"
145
- onclick="popupCode('HeaderOut.src/M000019.html');return false;">
144
+ <a href="HeaderOut.src/M000033.html" target="Code" class="method-signature"
145
+ onclick="popupCode('HeaderOut.src/M000033.html');return false;">
146
146
  <span class="method-name">new</span><span class="method-args">(out)</span>
147
147
  </a>
148
148
  </div>
@@ -153,12 +153,12 @@ there.
153
153
 
154
154
  <h3 class="section-bar">Public Instance methods</h3>
155
155
 
156
- <div id="method-M000020" class="method-detail">
157
- <a name="M000020"></a>
156
+ <div id="method-M000034" class="method-detail">
157
+ <a name="M000034"></a>
158
158
 
159
159
  <div class="method-heading">
160
- <a href="HeaderOut.src/M000020.html" target="Code" class="method-signature"
161
- onclick="popupCode('HeaderOut.src/M000020.html');return false;">
160
+ <a href="HeaderOut.src/M000034.html" target="Code" class="method-signature"
161
+ onclick="popupCode('HeaderOut.src/M000034.html');return false;">
162
162
  <span class="method-name">[]=</span><span class="method-args">(key,value)</span>
163
163
  </a>
164
164
  </div>
@@ -95,7 +95,7 @@ back a response. Look at the <a href="HttpRequest.html">HttpRequest</a> and
95
95
  <h3 class="section-bar">Methods</h3>
96
96
 
97
97
  <div class="name-list">
98
- <a href="#M000025">process</a>&nbsp;&nbsp;
98
+ <a href="#M000039">process</a>&nbsp;&nbsp;
99
99
  </div>
100
100
  </div>
101
101
 
@@ -117,12 +117,12 @@ back a response. Look at the <a href="HttpRequest.html">HttpRequest</a> and
117
117
  <div id="methods">
118
118
  <h3 class="section-bar">Public Instance methods</h3>
119
119
 
120
- <div id="method-M000025" class="method-detail">
121
- <a name="M000025"></a>
120
+ <div id="method-M000039" class="method-detail">
121
+ <a name="M000039"></a>
122
122
 
123
123
  <div class="method-heading">
124
- <a href="HttpHandler.src/M000025.html" target="Code" class="method-signature"
125
- onclick="popupCode('HttpHandler.src/M000025.html');return false;">
124
+ <a href="HttpHandler.src/M000039.html" target="Code" class="method-signature"
125
+ onclick="popupCode('HttpHandler.src/M000039.html');return false;">
126
126
  <span class="method-name">process</span><span class="method-args">(request, response)</span>
127
127
  </a>
128
128
  </div>
@@ -86,13 +86,13 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000006">error?</a>&nbsp;&nbsp;
90
- <a href="#M000005">execute</a>&nbsp;&nbsp;
91
- <a href="#M000004">finish</a>&nbsp;&nbsp;
92
- <a href="#M000007">finished?</a>&nbsp;&nbsp;
93
- <a href="#M000002">new</a>&nbsp;&nbsp;
94
- <a href="#M000008">nread</a>&nbsp;&nbsp;
95
- <a href="#M000003">reset</a>&nbsp;&nbsp;
89
+ <a href="#M000020">error?</a>&nbsp;&nbsp;
90
+ <a href="#M000019">execute</a>&nbsp;&nbsp;
91
+ <a href="#M000018">finish</a>&nbsp;&nbsp;
92
+ <a href="#M000021">finished?</a>&nbsp;&nbsp;
93
+ <a href="#M000016">new</a>&nbsp;&nbsp;
94
+ <a href="#M000022">nread</a>&nbsp;&nbsp;
95
+ <a href="#M000017">reset</a>&nbsp;&nbsp;
96
96
  </div>
97
97
  </div>
98
98
 
@@ -114,12 +114,12 @@
114
114
  <div id="methods">
115
115
  <h3 class="section-bar">Public Class methods</h3>
116
116
 
117
- <div id="method-M000002" class="method-detail">
118
- <a name="M000002"></a>
117
+ <div id="method-M000016" class="method-detail">
118
+ <a name="M000016"></a>
119
119
 
120
120
  <div class="method-heading">
121
- <a href="HttpParser.src/M000002.html" target="Code" class="method-signature"
122
- onclick="popupCode('HttpParser.src/M000002.html');return false;">
121
+ <a href="HttpParser.src/M000016.html" target="Code" class="method-signature"
122
+ onclick="popupCode('HttpParser.src/M000016.html');return false;">
123
123
  <span class="method-name">parser.new &rarr; parser<br />
124
124
  </span>
125
125
  </a>
@@ -134,12 +134,12 @@ Creates a new parser.
134
134
 
135
135
  <h3 class="section-bar">Public Instance methods</h3>
136
136
 
137
- <div id="method-M000006" class="method-detail">
138
- <a name="M000006"></a>
137
+ <div id="method-M000020" class="method-detail">
138
+ <a name="M000020"></a>
139
139
 
140
140
  <div class="method-heading">
141
- <a href="HttpParser.src/M000006.html" target="Code" class="method-signature"
142
- onclick="popupCode('HttpParser.src/M000006.html');return false;">
141
+ <a href="HttpParser.src/M000020.html" target="Code" class="method-signature"
142
+ onclick="popupCode('HttpParser.src/M000020.html');return false;">
143
143
  <span class="method-name">parser.error? &rarr; true/false<br />
144
144
  </span>
145
145
  </a>
@@ -152,12 +152,12 @@ Tells you whether the parser is in an error state.
152
152
  </div>
153
153
  </div>
154
154
 
155
- <div id="method-M000005" class="method-detail">
156
- <a name="M000005"></a>
155
+ <div id="method-M000019" class="method-detail">
156
+ <a name="M000019"></a>
157
157
 
158
158
  <div class="method-heading">
159
- <a href="HttpParser.src/M000005.html" target="Code" class="method-signature"
160
- onclick="popupCode('HttpParser.src/M000005.html');return false;">
159
+ <a href="HttpParser.src/M000019.html" target="Code" class="method-signature"
160
+ onclick="popupCode('HttpParser.src/M000019.html');return false;">
161
161
  <span class="method-name">parser.execute(req_hash, data) &rarr; Integer<br />
162
162
  </span>
163
163
  </a>
@@ -180,12 +180,12 @@ handling block.
180
180
  </div>
181
181
  </div>
182
182
 
183
- <div id="method-M000004" class="method-detail">
184
- <a name="M000004"></a>
183
+ <div id="method-M000018" class="method-detail">
184
+ <a name="M000018"></a>
185
185
 
186
186
  <div class="method-heading">
187
- <a href="HttpParser.src/M000004.html" target="Code" class="method-signature"
188
- onclick="popupCode('HttpParser.src/M000004.html');return false;">
187
+ <a href="HttpParser.src/M000018.html" target="Code" class="method-signature"
188
+ onclick="popupCode('HttpParser.src/M000018.html');return false;">
189
189
  <span class="method-name">parser.finish &rarr; true/false<br />
190
190
  </span>
191
191
  </a>
@@ -199,12 +199,12 @@ You should call reset after finish it or bad things will happen.
199
199
  </div>
200
200
  </div>
201
201
 
202
- <div id="method-M000007" class="method-detail">
203
- <a name="M000007"></a>
202
+ <div id="method-M000021" class="method-detail">
203
+ <a name="M000021"></a>
204
204
 
205
205
  <div class="method-heading">
206
- <a href="HttpParser.src/M000007.html" target="Code" class="method-signature"
207
- onclick="popupCode('HttpParser.src/M000007.html');return false;">
206
+ <a href="HttpParser.src/M000021.html" target="Code" class="method-signature"
207
+ onclick="popupCode('HttpParser.src/M000021.html');return false;">
208
208
  <span class="method-name">parser.finished? &rarr; true/false<br />
209
209
  </span>
210
210
  </a>
@@ -217,12 +217,12 @@ Tells you whether the parser is finished or not and in a good state.
217
217
  </div>
218
218
  </div>
219
219
 
220
- <div id="method-M000008" class="method-detail">
221
- <a name="M000008"></a>
220
+ <div id="method-M000022" class="method-detail">
221
+ <a name="M000022"></a>
222
222
 
223
223
  <div class="method-heading">
224
- <a href="HttpParser.src/M000008.html" target="Code" class="method-signature"
225
- onclick="popupCode('HttpParser.src/M000008.html');return false;">
224
+ <a href="HttpParser.src/M000022.html" target="Code" class="method-signature"
225
+ onclick="popupCode('HttpParser.src/M000022.html');return false;">
226
226
  <span class="method-name">parser.nread &rarr; Integer<br />
227
227
  </span>
228
228
  </a>
@@ -237,12 +237,12 @@ execute is called.
237
237
  </div>
238
238
  </div>
239
239
 
240
- <div id="method-M000003" class="method-detail">
241
- <a name="M000003"></a>
240
+ <div id="method-M000017" class="method-detail">
241
+ <a name="M000017"></a>
242
242
 
243
243
  <div class="method-heading">
244
- <a href="HttpParser.src/M000003.html" target="Code" class="method-signature"
245
- onclick="popupCode('HttpParser.src/M000003.html');return false;">
244
+ <a href="HttpParser.src/M000017.html" target="Code" class="method-signature"
245
+ onclick="popupCode('HttpParser.src/M000017.html');return false;">
246
246
  <span class="method-name">parser.reset &rarr; nil<br />
247
247
  </span>
248
248
  </a>