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.
- data/README +24 -28
- data/Rakefile +11 -4
- data/bin/mongrel_rails +82 -25
- data/doc/rdoc/classes/FactoryError.html +144 -0
- data/doc/rdoc/classes/FactoryError.src/M000001.html +23 -0
- data/doc/rdoc/classes/Mongrel.html +5 -5
- data/doc/rdoc/classes/Mongrel.src/{M000001.html → M000015.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Const.html +2 -2
- data/doc/rdoc/classes/Mongrel/DirHandler.html +26 -26
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000009.html → M000023.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000010.html → M000024.html} +5 -2
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000011.html → M000025.html} +26 -26
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000012.html → M000026.html} +17 -17
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000013.html → M000027.html} +24 -24
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000033.html → M000047.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000034.html → M000048.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000019.html → M000033.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000020.html → M000034.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000025.html → M000039.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000002.html → M000016.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000003.html → M000017.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000004.html → M000018.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000005.html → M000019.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000006.html → M000020.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000007.html → M000021.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000008.html → M000022.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000035.html → M000049.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000026.html → M000040.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000027.html → M000041.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000028.html → M000042.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000029.html → M000043.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000030.html → M000044.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000031.html → M000045.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000032.html → M000046.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.html +28 -28
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000014.html → M000028.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000015.html → M000029.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000016.html → M000030.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000017.html → M000031.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000018.html → M000032.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +20 -20
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000021.html → M000035.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000022.html → M000036.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000023.html → M000037.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000024.html → M000038.html} +0 -0
- data/doc/rdoc/classes/PluginFactory.html +409 -0
- data/doc/rdoc/classes/PluginFactory.src/M000002.html +18 -0
- data/doc/rdoc/classes/PluginFactory.src/M000003.html +18 -0
- data/doc/rdoc/classes/PluginFactory.src/M000004.html +22 -0
- data/doc/rdoc/classes/PluginFactory.src/M000005.html +22 -0
- data/doc/rdoc/classes/PluginFactory.src/M000006.html +33 -0
- data/doc/rdoc/classes/PluginFactory.src/M000007.html +32 -0
- data/doc/rdoc/classes/PluginFactory.src/M000008.html +18 -0
- data/doc/rdoc/classes/PluginFactory.src/M000009.html +24 -0
- data/doc/rdoc/classes/PluginFactory.src/M000010.html +40 -0
- data/doc/rdoc/classes/PluginFactory.src/M000011.html +39 -0
- data/doc/rdoc/classes/PluginFactory.src/M000012.html +24 -0
- data/doc/rdoc/classes/PluginFactory.src/M000013.html +70 -0
- data/doc/rdoc/classes/PluginFactory.src/M000014.html +34 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +29 -37
- data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
- data/doc/rdoc/files/lib/pluginfactory_rb.html +132 -0
- data/doc/rdoc/fr_class_index.html +2 -0
- data/doc/rdoc/fr_file_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +49 -35
- data/examples/simpletest.rb +10 -3
- data/lib/mongrel.rb +6 -3
- data/lib/mongrel/command.rb +192 -0
- data/lib/pluginfactory.rb +384 -0
- data/tools/rakehelp.rb +33 -29
- 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="#
|
|
107
|
-
<a href="#
|
|
108
|
-
<a href="#
|
|
109
|
-
<a href="#
|
|
110
|
-
<a href="#
|
|
106
|
+
<a href="#M000024">can_serve</a>
|
|
107
|
+
<a href="#M000023">new</a>
|
|
108
|
+
<a href="#M000027">process</a>
|
|
109
|
+
<a href="#M000025">send_dir_listing</a>
|
|
110
|
+
<a href="#M000026">send_file</a>
|
|
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-
|
|
159
|
-
<a name="
|
|
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/
|
|
163
|
-
onclick="popupCode('DirHandler.src/
|
|
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="index.html")</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-
|
|
178
|
-
<a name="
|
|
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/
|
|
182
|
-
onclick="popupCode('DirHandler.src/
|
|
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-
|
|
196
|
-
<a name="
|
|
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/
|
|
200
|
-
onclick="popupCode('DirHandler.src/
|
|
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-
|
|
214
|
-
<a name="
|
|
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/
|
|
218
|
-
onclick="popupCode('DirHandler.src/
|
|
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’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#
|
|
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-
|
|
235
|
-
<a name="
|
|
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/
|
|
239
|
-
onclick="popupCode('DirHandler.src/
|
|
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>
|
|
File without changes
|
|
@@ -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">
|
|
37
|
-
493:
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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">"/"</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">"text/html"</span>
|
|
21
|
+
510: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<html><head><title>Directory Listing</title></head><body>"</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">"."</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">".."</span>
|
|
26
|
+
515: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<a href=\"#{base}/#{child}\">Up to parent..</a><br/>"</span>
|
|
27
|
+
516: <span class="ruby-keyword kw">else</span>
|
|
28
|
+
517: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<a href=\"#{base}/#{child}\">#{child}</a><br/>"</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"><<</span> <span class="ruby-value str">"</body></html>"</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">"Directory listings not allowed"</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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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">"."</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">"r"</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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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"><<</span> <span class="ruby-value str">"File not found"</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">"REQUEST_URI"</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">></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"><<</span> <span class="ruby-node">"Error accessing file: #{details}"</span>
|
|
32
|
+
570: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">details</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</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="#
|
|
100
|
-
<a href="#
|
|
99
|
+
<a href="#M000047">new</a>
|
|
100
|
+
<a href="#M000048">process</a>
|
|
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-
|
|
123
|
-
<a name="
|
|
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/
|
|
127
|
-
onclick="popupCode('Error404Handler.src/
|
|
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’s pretty efficient.
|
|
|
139
139
|
|
|
140
140
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
141
141
|
|
|
142
|
-
<div id="method-
|
|
143
|
-
<a name="
|
|
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/
|
|
147
|
-
onclick="popupCode('Error404Handler.src/
|
|
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>
|
|
File without changes
|
|
File without changes
|
|
@@ -101,8 +101,8 @@ there.
|
|
|
101
101
|
<h3 class="section-bar">Methods</h3>
|
|
102
102
|
|
|
103
103
|
<div class="name-list">
|
|
104
|
-
<a href="#
|
|
105
|
-
<a href="#
|
|
104
|
+
<a href="#M000034">[]=</a>
|
|
105
|
+
<a href="#M000033">new</a>
|
|
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-
|
|
141
|
-
<a name="
|
|
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/
|
|
145
|
-
onclick="popupCode('HeaderOut.src/
|
|
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-
|
|
157
|
-
<a name="
|
|
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/
|
|
161
|
-
onclick="popupCode('HeaderOut.src/
|
|
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>
|
|
File without changes
|
|
File without changes
|
|
@@ -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="#
|
|
98
|
+
<a href="#M000039">process</a>
|
|
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-
|
|
121
|
-
<a name="
|
|
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/
|
|
125
|
-
onclick="popupCode('HttpHandler.src/
|
|
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>
|
|
File without changes
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
89
|
+
<a href="#M000020">error?</a>
|
|
90
|
+
<a href="#M000019">execute</a>
|
|
91
|
+
<a href="#M000018">finish</a>
|
|
92
|
+
<a href="#M000021">finished?</a>
|
|
93
|
+
<a href="#M000016">new</a>
|
|
94
|
+
<a href="#M000022">nread</a>
|
|
95
|
+
<a href="#M000017">reset</a>
|
|
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-
|
|
118
|
-
<a name="
|
|
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/
|
|
122
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → 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-
|
|
138
|
-
<a name="
|
|
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/
|
|
142
|
-
onclick="popupCode('HttpParser.src/
|
|
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? → 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-
|
|
156
|
-
<a name="
|
|
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/
|
|
160
|
-
onclick="popupCode('HttpParser.src/
|
|
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) → 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-
|
|
184
|
-
<a name="
|
|
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/
|
|
188
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → 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-
|
|
203
|
-
<a name="
|
|
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/
|
|
207
|
-
onclick="popupCode('HttpParser.src/
|
|
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? → 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-
|
|
221
|
-
<a name="
|
|
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/
|
|
225
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → 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-
|
|
241
|
-
<a name="
|
|
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/
|
|
245
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → nil<br />
|
|
247
247
|
</span>
|
|
248
248
|
</a>
|