mongrel 0.3.13 → 0.3.13.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/Rakefile +1 -1
- data/bin/mongrel_rails +1 -1
- data/doc/rdoc/classes/Mongrel.html +1 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +49 -49
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +11 -21
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000099.html +34 -14
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000100.html +21 -12
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000101.html +14 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000102.html +12 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000103.html +5 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +5 -6
- data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000088.html → CGIWrapper.src/M000105.html} +5 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000106.html +19 -0
- data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
- data/doc/rdoc/classes/Mongrel/Camping.src/{M000046.html → M000047.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000048.html +5 -38
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000049.html +51 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +65 -65
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +11 -29
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +29 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +5 -9
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +9 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +5 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +11 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +11 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000038.html +7 -12
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +12 -37
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000040.html +50 -0
- data/doc/rdoc/classes/Mongrel/Configurator.html +143 -107
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +16 -7
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +18 -7
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +7 -10
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +7 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +10 -21
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +5 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +21 -17
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +6 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +17 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000116.html +20 -11
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000117.html +5 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +11 -9
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000119.html +6 -12
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000120.html +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000121.html +9 -22
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000122.html +12 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000123.html +5 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000124.html +22 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000125.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000126.html +33 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000127.html +18 -0
- data/doc/rdoc/classes/Mongrel/Const.html +6 -1
- data/doc/rdoc/classes/Mongrel/DeflateFilter.html +10 -10
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000094.html → M000096.html} +5 -5
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000095.html → M000097.html} +14 -14
- data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000057.html +8 -30
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +30 -29
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +29 -50
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +50 -26
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +26 -5
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +18 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000125.html → M000128.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000126.html → M000129.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000070.html +5 -5
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000071.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +31 -9
- data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000089.html → HttpHandler.src/M000076.html} +4 -5
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000075.html → M000077.html} +3 -3
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +30 -15
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000022.html +4 -6
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000023.html +6 -4
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000024.html +17 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000050.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +7 -37
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +37 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000049.html → M000056.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +20 -20
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000130.html → M000135.html} +38 -38
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000131.html → M000136.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000132.html → M000137.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000133.html → M000138.html} +18 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +61 -61
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +12 -12
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +7 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +12 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +9 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +9 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +9 -8
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +18 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +8 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000087.html +7 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000088.html +20 -0
- data/doc/rdoc/classes/Mongrel/{HeaderOut.src/M000069.html → HttpResponse.src/M000089.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpServer.html +38 -38
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +12 -70
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +76 -13
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +13 -50
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +50 -21
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +20 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +5 -9
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +22 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +15 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000041.html +26 -12
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +12 -13
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000043.html +26 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +15 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000044.html +9 -38
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +38 -10
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +23 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.html +187 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000133.html +22 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000134.html +27 -0
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +16 -16
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000127.html → M000130.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000128.html → M000131.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000129.html → M000132.html} +4 -4
- data/doc/rdoc/classes/Mongrel/StatusHandler.html +20 -20
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000072.html +5 -11
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000073.html +11 -29
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000074.html +29 -7
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000075.html +20 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000090.html +5 -26
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +5 -38
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +18 -15
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000093.html +25 -57
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000094.html +36 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000095.html +83 -0
- data/doc/rdoc/classes/RequestLog/Access.html +5 -5
- data/doc/rdoc/classes/RequestLog/Access.src/{M000134.html → M000139.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Files.html +5 -5
- data/doc/rdoc/classes/RequestLog/Files.src/{M000135.html → M000140.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Objects.html +5 -5
- data/doc/rdoc/classes/RequestLog/Objects.src/{M000137.html → M000142.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Params.html +5 -5
- data/doc/rdoc/classes/RequestLog/Params.src/{M000138.html → M000143.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Threads.html +5 -5
- data/doc/rdoc/classes/RequestLog/Threads.src/{M000136.html → M000141.html} +0 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +124 -119
- data/examples/simpletest.rb +2 -0
- data/ext/http11/http11.c +1 -1
- data/lib/mongrel.rb +30 -5
- data/lib/mongrel/handlers.rb +57 -2
- data/test/test_redirect_handler.rb +40 -0
- metadata +47 -38
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000096.html +0 -24
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000097.html +0 -47
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000047.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000037.html +0 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +0 -29
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +0 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +0 -21
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +0 -25
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000040.html +0 -39
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000043.html +0 -22
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +0 -18
|
@@ -5,14 +5,21 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>stop (Mongrel::Configurator)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 962</span>
|
|
14
|
+
962: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>(<span class="ruby-identifier">needs_restart</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">unlink_pid_file</span>=<span class="ruby-keyword kw">true</span>)
|
|
15
|
+
963: <span class="ruby-ivar">@listeners</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span>,<span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
|
16
|
+
964: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">stop</span>
|
|
17
|
+
965: }
|
|
18
|
+
966:
|
|
19
|
+
967: <span class="ruby-ivar">@needs_restart</span> = <span class="ruby-identifier">needs_restart</span>
|
|
20
|
+
968: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">unlink_pid_file</span>
|
|
21
|
+
969: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span> <span class="ruby-ivar">@pid_file</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@pid_file</span> <span class="ruby-keyword kw">and</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-ivar">@pid_file</span>))
|
|
22
|
+
970: <span class="ruby-keyword kw">end</span>
|
|
23
|
+
971: <span class="ruby-keyword kw">end</span></pre>
|
|
17
24
|
</body>
|
|
18
25
|
</html>
|
|
@@ -5,29 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>join (Mongrel::Configurator)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
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>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
1014: <span class="ruby-comment cmt"># forced shutdown, even if previously restarted (actually just like TERM but for CTRL-C)</span>
|
|
18
|
-
1015: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">"INT"</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">"INT signal received."</span>; <span class="ruby-identifier">stop</span>(<span class="ruby-identifier">need_restart</span>=<span class="ruby-keyword kw">false</span>) }
|
|
19
|
-
1016:
|
|
20
|
-
1017: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/mswin/</span>
|
|
21
|
-
1018: <span class="ruby-comment cmt"># graceful shutdown</span>
|
|
22
|
-
1019: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">"TERM"</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">"TERM signal received."</span>; <span class="ruby-identifier">stop</span> }
|
|
23
|
-
1020:
|
|
24
|
-
1021: <span class="ruby-comment cmt"># restart</span>
|
|
25
|
-
1022: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">"USR2"</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">"USR2 signal received."</span>; <span class="ruby-identifier">stop</span>(<span class="ruby-identifier">need_restart</span>=<span class="ruby-keyword kw">true</span>) }
|
|
26
|
-
1023:
|
|
27
|
-
1024: <span class="ruby-identifier">log</span> <span class="ruby-value str">"Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart)."</span>
|
|
28
|
-
1025: <span class="ruby-keyword kw">else</span>
|
|
29
|
-
1026: <span class="ruby-identifier">log</span> <span class="ruby-value str">"Signals ready. INT => stop (no restart)."</span>
|
|
30
|
-
1027: <span class="ruby-keyword kw">end</span>
|
|
31
|
-
1028: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 977</span>
|
|
14
|
+
977: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">join</span>
|
|
15
|
+
978: <span class="ruby-ivar">@listeners</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">acceptor</span>.<span class="ruby-identifier">join</span> }
|
|
16
|
+
979: <span class="ruby-keyword kw">end</span></pre>
|
|
32
17
|
</body>
|
|
33
18
|
</html>
|
|
@@ -5,14 +5,31 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>debug (Mongrel::Configurator)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 997</span>
|
|
14
|
+
997: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug</span>(<span class="ruby-identifier">location</span>, <span class="ruby-identifier">what</span> = [<span class="ruby-identifier">:object</span>, <span class="ruby-identifier">:rails</span>, <span class="ruby-identifier">:files</span>, <span class="ruby-identifier">:threads</span>, <span class="ruby-identifier">:params</span>])
|
|
15
|
+
998: <span class="ruby-identifier">require</span> <span class="ruby-value str">'mongrel/debug'</span>
|
|
16
|
+
999: <span class="ruby-identifier">handlers</span> = {
|
|
17
|
+
1000: <span class="ruby-identifier">:files</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"/handlers/requestlog::access"</span>,
|
|
18
|
+
1001: <span class="ruby-identifier">:rails</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"/handlers/requestlog::files"</span>,
|
|
19
|
+
1002: <span class="ruby-identifier">:object</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"/handlers/requestlog::objects"</span>,
|
|
20
|
+
1003: <span class="ruby-identifier">:threads</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"/handlers/requestlog::threads"</span>,
|
|
21
|
+
1004: <span class="ruby-identifier">:params</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"/handlers/requestlog::params"</span>
|
|
22
|
+
1005: }
|
|
23
|
+
1006:
|
|
24
|
+
1007: <span class="ruby-comment cmt"># turn on the debugging infrastructure, and ObjectTracker is a pig</span>
|
|
25
|
+
1008: <span class="ruby-constant">ObjectTracker</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">what</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">:object</span>
|
|
26
|
+
1009: <span class="ruby-constant">MongrelDbg</span>.<span class="ruby-identifier">configure</span>
|
|
27
|
+
1010:
|
|
28
|
+
1011: <span class="ruby-comment cmt"># now we roll through each requested debug type, turn it on and load that plugin</span>
|
|
29
|
+
1012: <span class="ruby-identifier">what</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span>
|
|
30
|
+
1013: <span class="ruby-constant">MongrelDbg</span>.<span class="ruby-identifier">begin_trace</span> <span class="ruby-identifier">type</span>
|
|
31
|
+
1014: <span class="ruby-identifier">uri</span> <span class="ruby-identifier">location</span>, <span class="ruby-identifier">:handler</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">plugin</span>(<span class="ruby-identifier">handlers</span>[<span class="ruby-identifier">type</span>])
|
|
32
|
+
1015: <span class="ruby-keyword kw">end</span>
|
|
33
|
+
1016: <span class="ruby-keyword kw">end</span></pre>
|
|
17
34
|
</body>
|
|
18
35
|
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>run_config (Mongrel::Configurator)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 1022</span>
|
|
14
|
+
1022: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_config</span>(<span class="ruby-identifier">script</span>)
|
|
15
|
+
1023: <span class="ruby-identifier">open</span>(<span class="ruby-identifier">script</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>, <span class="ruby-identifier">proc</span> {<span class="ruby-keyword kw">self</span>}) }
|
|
16
|
+
1024: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>setup_signals (Mongrel::Configurator)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 1036</span>
|
|
14
|
+
1036: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup_signals</span>(<span class="ruby-identifier">options</span>={})
|
|
15
|
+
1037: <span class="ruby-identifier">ops</span> = <span class="ruby-identifier">resolve_defaults</span>(<span class="ruby-identifier">options</span>)
|
|
16
|
+
1038:
|
|
17
|
+
1039: <span class="ruby-comment cmt"># forced shutdown, even if previously restarted (actually just like TERM but for CTRL-C)</span>
|
|
18
|
+
1040: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">"INT"</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">"INT signal received."</span>; <span class="ruby-identifier">stop</span>(<span class="ruby-identifier">need_restart</span>=<span class="ruby-keyword kw">false</span>) }
|
|
19
|
+
1041:
|
|
20
|
+
1042: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/mswin/</span>
|
|
21
|
+
1043: <span class="ruby-comment cmt"># graceful shutdown</span>
|
|
22
|
+
1044: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">"TERM"</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">"TERM signal received."</span>; <span class="ruby-identifier">stop</span> }
|
|
23
|
+
1045:
|
|
24
|
+
1046: <span class="ruby-comment cmt"># restart</span>
|
|
25
|
+
1047: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">"USR2"</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">"USR2 signal received."</span>; <span class="ruby-identifier">stop</span>(<span class="ruby-identifier">need_restart</span>=<span class="ruby-keyword kw">true</span>) }
|
|
26
|
+
1048:
|
|
27
|
+
1049: <span class="ruby-identifier">log</span> <span class="ruby-value str">"Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart)."</span>
|
|
28
|
+
1050: <span class="ruby-keyword kw">else</span>
|
|
29
|
+
1051: <span class="ruby-identifier">log</span> <span class="ruby-value str">"Signals ready. INT => stop (no restart)."</span>
|
|
30
|
+
1052: <span class="ruby-keyword kw">end</span>
|
|
31
|
+
1053: <span class="ruby-keyword kw">end</span></pre>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>log (Mongrel::Configurator)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 1056</span>
|
|
14
|
+
1056: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">msg</span>)
|
|
15
|
+
1057: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">print</span> <span class="ruby-value str">"** "</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-value str">"\n"</span>
|
|
16
|
+
1058: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -148,7 +148,7 @@ SCRIPT_NAME.
|
|
|
148
148
|
<tr class="top-aligned-row context-row">
|
|
149
149
|
<td class="context-item-name">MONGREL_VERSION</td>
|
|
150
150
|
<td>=</td>
|
|
151
|
-
<td class="context-item-value">"0.3.13".freeze</td>
|
|
151
|
+
<td class="context-item-value">"0.3.13.1".freeze</td>
|
|
152
152
|
</tr>
|
|
153
153
|
<tr class="top-aligned-row context-row">
|
|
154
154
|
<td class="context-item-name">MONGREL_TMP_BASE</td>
|
|
@@ -305,6 +305,11 @@ win32)
|
|
|
305
305
|
<td>=</td>
|
|
306
306
|
<td class="context-item-value">"HTTP_IF_NONE_MATCH".freeze</td>
|
|
307
307
|
</tr>
|
|
308
|
+
<tr class="top-aligned-row context-row">
|
|
309
|
+
<td class="context-item-name">REDIRECT</td>
|
|
310
|
+
<td>=</td>
|
|
311
|
+
<td class="context-item-value">"HTTP/1.1 302 Found\r\nLocation: %s\r\nConnection: close\r\n\r\n".freeze</td>
|
|
312
|
+
</tr>
|
|
308
313
|
</table>
|
|
309
314
|
</div>
|
|
310
315
|
</div>
|
|
@@ -100,8 +100,8 @@ deflate everything even if the client can’t handle it.
|
|
|
100
100
|
<h3 class="section-bar">Methods</h3>
|
|
101
101
|
|
|
102
102
|
<div class="name-list">
|
|
103
|
-
<a href="#
|
|
104
|
-
<a href="#
|
|
103
|
+
<a href="#M000096">new</a>
|
|
104
|
+
<a href="#M000097">process</a>
|
|
105
105
|
</div>
|
|
106
106
|
</div>
|
|
107
107
|
|
|
@@ -136,12 +136,12 @@ deflate everything even if the client can’t handle it.
|
|
|
136
136
|
<div id="methods">
|
|
137
137
|
<h3 class="section-bar">Public Class methods</h3>
|
|
138
138
|
|
|
139
|
-
<div id="method-
|
|
140
|
-
<a name="
|
|
139
|
+
<div id="method-M000096" class="method-detail">
|
|
140
|
+
<a name="M000096"></a>
|
|
141
141
|
|
|
142
142
|
<div class="method-heading">
|
|
143
|
-
<a href="DeflateFilter.src/
|
|
144
|
-
onclick="popupCode('DeflateFilter.src/
|
|
143
|
+
<a href="DeflateFilter.src/M000096.html" target="Code" class="method-signature"
|
|
144
|
+
onclick="popupCode('DeflateFilter.src/M000096.html');return false;">
|
|
145
145
|
<span class="method-name">new</span><span class="method-args">(ops={})</span>
|
|
146
146
|
</a>
|
|
147
147
|
</div>
|
|
@@ -152,12 +152,12 @@ deflate everything even if the client can’t handle it.
|
|
|
152
152
|
|
|
153
153
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
154
154
|
|
|
155
|
-
<div id="method-
|
|
156
|
-
<a name="
|
|
155
|
+
<div id="method-M000097" class="method-detail">
|
|
156
|
+
<a name="M000097"></a>
|
|
157
157
|
|
|
158
158
|
<div class="method-heading">
|
|
159
|
-
<a href="DeflateFilter.src/
|
|
160
|
-
onclick="popupCode('DeflateFilter.src/
|
|
159
|
+
<a href="DeflateFilter.src/M000097.html" target="Code" class="method-signature"
|
|
160
|
+
onclick="popupCode('DeflateFilter.src/M000097.html');return false;">
|
|
161
161
|
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
|
162
162
|
</a>
|
|
163
163
|
</div>
|
|
@@ -10,10 +10,10 @@
|
|
|
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/handlers.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 293</span>
|
|
14
|
+
293: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ops</span>={})
|
|
15
|
+
294: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">ops</span>
|
|
16
|
+
295: <span class="ruby-ivar">@always_deflate</span> = <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:always_deflate</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
|
|
17
|
+
296: <span class="ruby-keyword kw">end</span></pre>
|
|
18
18
|
</body>
|
|
19
19
|
</html>
|
|
@@ -10,19 +10,19 @@
|
|
|
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/handlers.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 298</span>
|
|
14
|
+
298: <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
|
+
299: <span class="ruby-identifier">accepts</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-constant">HTTP_ACCEPT_ENCODING</span>]
|
|
16
|
+
300: <span class="ruby-comment cmt"># only process if they support compression</span>
|
|
17
|
+
301: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@always_deflate</span> <span class="ruby-keyword kw">or</span> (<span class="ruby-identifier">accepts</span> <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">accepts</span>.<span class="ruby-identifier">include?</span> <span class="ruby-value str">"deflate"</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body_sent</span>))
|
|
18
|
+
302: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>[<span class="ruby-value str">"Content-Encoding"</span>] = <span class="ruby-value str">"deflate"</span>
|
|
19
|
+
303: <span class="ruby-comment cmt"># we can't just rewind the body and gzip it since the body could be an attached file</span>
|
|
20
|
+
304: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">rewind</span>
|
|
21
|
+
305: <span class="ruby-identifier">gzout</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Zlib</span><span class="ruby-operator">::</span><span class="ruby-constant">Deflate</span>.<span class="ruby-identifier">deflate</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">read</span>))
|
|
22
|
+
306: <span class="ruby-identifier">gzout</span>.<span class="ruby-identifier">rewind</span>
|
|
23
|
+
307: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">close</span>
|
|
24
|
+
308: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">gzout</span>
|
|
25
|
+
309: <span class="ruby-keyword kw">end</span>
|
|
26
|
+
310: <span class="ruby-keyword kw">end</span></pre>
|
|
27
27
|
</body>
|
|
28
28
|
</html>
|
|
@@ -108,12 +108,12 @@ DirHandler.default_content_type attribute.
|
|
|
108
108
|
<h3 class="section-bar">Methods</h3>
|
|
109
109
|
|
|
110
110
|
<div class="name-list">
|
|
111
|
-
<a href="#
|
|
112
|
-
<a href="#
|
|
113
|
-
<a href="#
|
|
114
|
-
<a href="#
|
|
115
|
-
<a href="#
|
|
116
|
-
<a href="#
|
|
111
|
+
<a href="#M000062">add_mime_type</a>
|
|
112
|
+
<a href="#M000058">can_serve</a>
|
|
113
|
+
<a href="#M000057">new</a>
|
|
114
|
+
<a href="#M000061">process</a>
|
|
115
|
+
<a href="#M000059">send_dir_listing</a>
|
|
116
|
+
<a href="#M000060">send_file</a>
|
|
117
117
|
</div>
|
|
118
118
|
</div>
|
|
119
119
|
|
|
@@ -176,12 +176,12 @@ DirHandler.default_content_type attribute.
|
|
|
176
176
|
<div id="methods">
|
|
177
177
|
<h3 class="section-bar">Public Class methods</h3>
|
|
178
178
|
|
|
179
|
-
<div id="method-
|
|
180
|
-
<a name="
|
|
179
|
+
<div id="method-M000062" class="method-detail">
|
|
180
|
+
<a name="M000062"></a>
|
|
181
181
|
|
|
182
182
|
<div class="method-heading">
|
|
183
|
-
<a href="DirHandler.src/
|
|
184
|
-
onclick="popupCode('DirHandler.src/
|
|
183
|
+
<a href="DirHandler.src/M000062.html" target="Code" class="method-signature"
|
|
184
|
+
onclick="popupCode('DirHandler.src/M000062.html');return false;">
|
|
185
185
|
<span class="method-name">add_mime_type</span><span class="method-args">(extension, type)</span>
|
|
186
186
|
</a>
|
|
187
187
|
</div>
|
|
@@ -194,12 +194,12 @@ you add any others you’ll need when serving content.
|
|
|
194
194
|
</div>
|
|
195
195
|
</div>
|
|
196
196
|
|
|
197
|
-
<div id="method-
|
|
198
|
-
<a name="
|
|
197
|
+
<div id="method-M000057" class="method-detail">
|
|
198
|
+
<a name="M000057"></a>
|
|
199
199
|
|
|
200
200
|
<div class="method-heading">
|
|
201
|
-
<a href="DirHandler.src/
|
|
202
|
-
onclick="popupCode('DirHandler.src/
|
|
201
|
+
<a href="DirHandler.src/M000057.html" target="Code" class="method-signature"
|
|
202
|
+
onclick="popupCode('DirHandler.src/M000057.html');return false;">
|
|
203
203
|
<span class="method-name">new</span><span class="method-args">(path, listing_allowed=true, index_html="index.html")</span>
|
|
204
204
|
</a>
|
|
205
205
|
</div>
|
|
@@ -213,12 +213,12 @@ You give it the path to the directory root and an (optional)
|
|
|
213
213
|
|
|
214
214
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
215
215
|
|
|
216
|
-
<div id="method-
|
|
217
|
-
<a name="
|
|
216
|
+
<div id="method-M000058" class="method-detail">
|
|
217
|
+
<a name="M000058"></a>
|
|
218
218
|
|
|
219
219
|
<div class="method-heading">
|
|
220
|
-
<a href="DirHandler.src/
|
|
221
|
-
onclick="popupCode('DirHandler.src/
|
|
220
|
+
<a href="DirHandler.src/M000058.html" target="Code" class="method-signature"
|
|
221
|
+
onclick="popupCode('DirHandler.src/M000058.html');return false;">
|
|
222
222
|
<span class="method-name">can_serve</span><span class="method-args">(path_info)</span>
|
|
223
223
|
</a>
|
|
224
224
|
</div>
|
|
@@ -231,12 +231,12 @@ not).
|
|
|
231
231
|
</div>
|
|
232
232
|
</div>
|
|
233
233
|
|
|
234
|
-
<div id="method-
|
|
235
|
-
<a name="
|
|
234
|
+
<div id="method-M000061" class="method-detail">
|
|
235
|
+
<a name="M000061"></a>
|
|
236
236
|
|
|
237
237
|
<div class="method-heading">
|
|
238
|
-
<a href="DirHandler.src/
|
|
239
|
-
onclick="popupCode('DirHandler.src/
|
|
238
|
+
<a href="DirHandler.src/M000061.html" target="Code" class="method-signature"
|
|
239
|
+
onclick="popupCode('DirHandler.src/M000061.html');return false;">
|
|
240
240
|
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
|
241
241
|
</a>
|
|
242
242
|
</div>
|
|
@@ -249,12 +249,12 @@ allowed (based on the listing_allowed parameter to the constructor).
|
|
|
249
249
|
</div>
|
|
250
250
|
</div>
|
|
251
251
|
|
|
252
|
-
<div id="method-
|
|
253
|
-
<a name="
|
|
252
|
+
<div id="method-M000059" class="method-detail">
|
|
253
|
+
<a name="M000059"></a>
|
|
254
254
|
|
|
255
255
|
<div class="method-heading">
|
|
256
|
-
<a href="DirHandler.src/
|
|
257
|
-
onclick="popupCode('DirHandler.src/
|
|
256
|
+
<a href="DirHandler.src/M000059.html" target="Code" class="method-signature"
|
|
257
|
+
onclick="popupCode('DirHandler.src/M000059.html');return false;">
|
|
258
258
|
<span class="method-name">send_dir_listing</span><span class="method-args">(base, dir, response)</span>
|
|
259
259
|
</a>
|
|
260
260
|
</div>
|
|
@@ -264,18 +264,18 @@ allowed (based on the listing_allowed parameter to the constructor).
|
|
|
264
264
|
Returns a simplistic directory listing if they’re enabled, otherwise
|
|
265
265
|
a 403. Base is the base URI from the REQUEST_URI, dir is the directory to
|
|
266
266
|
serve on the file system (comes from <a
|
|
267
|
-
href="DirHandler.html#
|
|
267
|
+
href="DirHandler.html#M000058">can_serve</a>()), and response is the <a
|
|
268
268
|
href="HttpResponse.html">HttpResponse</a> object to send the results on.
|
|
269
269
|
</p>
|
|
270
270
|
</div>
|
|
271
271
|
</div>
|
|
272
272
|
|
|
273
|
-
<div id="method-
|
|
274
|
-
<a name="
|
|
273
|
+
<div id="method-M000060" class="method-detail">
|
|
274
|
+
<a name="M000060"></a>
|
|
275
275
|
|
|
276
276
|
<div class="method-heading">
|
|
277
|
-
<a href="DirHandler.src/
|
|
278
|
-
onclick="popupCode('DirHandler.src/
|
|
277
|
+
<a href="DirHandler.src/M000060.html" target="Code" class="method-signature"
|
|
278
|
+
onclick="popupCode('DirHandler.src/M000060.html');return false;">
|
|
279
279
|
<span class="method-name">send_file</span><span class="method-args">(req_path, request, response, header_only=false)</span>
|
|
280
280
|
</a>
|
|
281
281
|
</div>
|
|
@@ -5,39 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (Mongrel::DirHandler)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
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/handlers.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
129: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req_path</span>
|
|
21
|
-
130: <span class="ruby-comment cmt"># the request is for a directory</span>
|
|
22
|
-
131: <span class="ruby-identifier">index</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">req_path</span>, <span class="ruby-ivar">@index_html</span>)
|
|
23
|
-
132: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-identifier">index</span>
|
|
24
|
-
133: <span class="ruby-comment cmt"># serve the index</span>
|
|
25
|
-
134: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">index</span>
|
|
26
|
-
135: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@listing_allowed</span>
|
|
27
|
-
136: <span class="ruby-comment cmt"># serve the directory</span>
|
|
28
|
-
137: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">req_path</span>
|
|
29
|
-
138: <span class="ruby-keyword kw">else</span>
|
|
30
|
-
139: <span class="ruby-comment cmt"># do not serve anything</span>
|
|
31
|
-
140: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
|
32
|
-
141: <span class="ruby-keyword kw">end</span>
|
|
33
|
-
142: <span class="ruby-keyword kw">else</span>
|
|
34
|
-
143: <span class="ruby-comment cmt"># it's a file and it's there</span>
|
|
35
|
-
144: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">req_path</span>
|
|
36
|
-
145: <span class="ruby-keyword kw">end</span>
|
|
37
|
-
146: <span class="ruby-keyword kw">else</span>
|
|
38
|
-
147: <span class="ruby-comment cmt"># does not exist or isn't in the right spot</span>
|
|
39
|
-
148: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
|
40
|
-
149: <span class="ruby-keyword kw">end</span>
|
|
41
|
-
150: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 126</span>
|
|
14
|
+
126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">listing_allowed</span>=<span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">index_html</span>=<span class="ruby-value str">"index.html"</span>)
|
|
15
|
+
127: <span class="ruby-ivar">@path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
|
|
16
|
+
128: <span class="ruby-ivar">@listing_allowed</span>=<span class="ruby-identifier">listing_allowed</span>
|
|
17
|
+
129: <span class="ruby-ivar">@index_html</span> = <span class="ruby-identifier">index_html</span>
|
|
18
|
+
130: <span class="ruby-ivar">@default_content_type</span> = <span class="ruby-value str">"text/plain; charset=ISO-8859-1"</span>.<span class="ruby-identifier">freeze</span>
|
|
19
|
+
131: <span class="ruby-keyword kw">end</span></pre>
|
|
42
20
|
</body>
|
|
43
21
|
</html>
|