mongrel 0.3.13 → 0.3.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/Rakefile +1 -1
  2. data/bin/mongrel_rails +1 -1
  3. data/doc/rdoc/classes/Mongrel.html +1 -0
  4. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +49 -49
  5. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +11 -21
  6. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000099.html +34 -14
  7. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000100.html +21 -12
  8. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000101.html +14 -5
  9. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000102.html +12 -5
  10. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000103.html +5 -5
  11. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +5 -6
  12. data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000088.html → CGIWrapper.src/M000105.html} +5 -5
  13. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000106.html +19 -0
  14. data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
  15. data/doc/rdoc/classes/Mongrel/Camping.src/{M000046.html → M000047.html} +0 -0
  16. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
  17. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000048.html +5 -38
  18. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000049.html +51 -0
  19. data/doc/rdoc/classes/Mongrel/Command/Base.html +65 -65
  20. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +11 -29
  21. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +29 -5
  22. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +5 -5
  23. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +5 -5
  24. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +5 -5
  25. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +5 -9
  26. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +9 -5
  27. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +5 -5
  28. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +5 -5
  29. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +5 -11
  30. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +11 -11
  31. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +11 -5
  32. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +18 -0
  33. data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
  34. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000038.html +7 -12
  35. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +12 -37
  36. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000040.html +50 -0
  37. data/doc/rdoc/classes/Mongrel/Configurator.html +143 -107
  38. data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +16 -7
  39. data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +18 -7
  40. data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +7 -10
  41. data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +7 -5
  42. data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +10 -21
  43. data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +5 -6
  44. data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +21 -17
  45. data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +6 -20
  46. data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +17 -5
  47. data/doc/rdoc/classes/Mongrel/Configurator.src/M000116.html +20 -11
  48. data/doc/rdoc/classes/Mongrel/Configurator.src/M000117.html +5 -6
  49. data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +11 -9
  50. data/doc/rdoc/classes/Mongrel/Configurator.src/M000119.html +6 -12
  51. data/doc/rdoc/classes/Mongrel/Configurator.src/M000120.html +5 -5
  52. data/doc/rdoc/classes/Mongrel/Configurator.src/M000121.html +9 -22
  53. data/doc/rdoc/classes/Mongrel/Configurator.src/M000122.html +12 -5
  54. data/doc/rdoc/classes/Mongrel/Configurator.src/M000123.html +5 -20
  55. data/doc/rdoc/classes/Mongrel/Configurator.src/M000124.html +22 -5
  56. data/doc/rdoc/classes/Mongrel/Configurator.src/M000125.html +18 -0
  57. data/doc/rdoc/classes/Mongrel/Configurator.src/M000126.html +33 -0
  58. data/doc/rdoc/classes/Mongrel/Configurator.src/M000127.html +18 -0
  59. data/doc/rdoc/classes/Mongrel/Const.html +6 -1
  60. data/doc/rdoc/classes/Mongrel/DeflateFilter.html +10 -10
  61. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000094.html → M000096.html} +5 -5
  62. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000095.html → M000097.html} +14 -14
  63. data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
  64. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000057.html +8 -30
  65. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +30 -29
  66. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +29 -50
  67. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +50 -26
  68. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +26 -5
  69. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +18 -0
  70. data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
  71. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000125.html → M000128.html} +4 -4
  72. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000126.html → M000129.html} +4 -4
  73. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  74. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000070.html +5 -5
  75. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000071.html +18 -0
  76. data/doc/rdoc/classes/Mongrel/HttpHandler.html +31 -9
  77. data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000089.html → HttpHandler.src/M000076.html} +4 -5
  78. data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000075.html → M000077.html} +3 -3
  79. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +30 -15
  80. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000022.html +4 -6
  81. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000023.html +6 -4
  82. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000024.html +17 -0
  83. data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
  84. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000050.html +5 -6
  85. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +7 -7
  86. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +7 -37
  87. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +37 -5
  88. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +5 -5
  89. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +5 -6
  90. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000049.html → M000056.html} +6 -6
  91. data/doc/rdoc/classes/Mongrel/HttpRequest.html +20 -20
  92. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000130.html → M000135.html} +38 -38
  93. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000131.html → M000136.html} +6 -6
  94. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000132.html → M000137.html} +6 -6
  95. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000133.html → M000138.html} +18 -18
  96. data/doc/rdoc/classes/Mongrel/HttpResponse.html +61 -61
  97. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +12 -12
  98. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +7 -9
  99. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +12 -9
  100. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +9 -9
  101. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +9 -18
  102. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +9 -8
  103. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +18 -7
  104. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +8 -7
  105. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +7 -7
  106. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000087.html +7 -5
  107. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000088.html +20 -0
  108. data/doc/rdoc/classes/Mongrel/{HeaderOut.src/M000069.html → HttpResponse.src/M000089.html} +5 -5
  109. data/doc/rdoc/classes/Mongrel/HttpServer.html +38 -38
  110. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +12 -70
  111. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +76 -13
  112. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +13 -50
  113. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +50 -21
  114. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +20 -4
  115. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +5 -9
  116. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +22 -0
  117. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +15 -15
  118. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000041.html +26 -12
  119. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +12 -13
  120. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000043.html +26 -0
  121. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +15 -15
  122. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000044.html +9 -38
  123. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +38 -10
  124. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +23 -0
  125. data/doc/rdoc/classes/Mongrel/RedirectHandler.html +187 -0
  126. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000133.html +22 -0
  127. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000134.html +27 -0
  128. data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +16 -16
  129. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000127.html → M000130.html} +10 -10
  130. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000128.html → M000131.html} +10 -10
  131. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000129.html → M000132.html} +4 -4
  132. data/doc/rdoc/classes/Mongrel/StatusHandler.html +20 -20
  133. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000072.html +5 -11
  134. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000073.html +11 -29
  135. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000074.html +29 -7
  136. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000075.html +20 -0
  137. data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
  138. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000090.html +5 -26
  139. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +5 -38
  140. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +18 -15
  141. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000093.html +25 -57
  142. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000094.html +36 -0
  143. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000095.html +83 -0
  144. data/doc/rdoc/classes/RequestLog/Access.html +5 -5
  145. data/doc/rdoc/classes/RequestLog/Access.src/{M000134.html → M000139.html} +0 -0
  146. data/doc/rdoc/classes/RequestLog/Files.html +5 -5
  147. data/doc/rdoc/classes/RequestLog/Files.src/{M000135.html → M000140.html} +0 -0
  148. data/doc/rdoc/classes/RequestLog/Objects.html +5 -5
  149. data/doc/rdoc/classes/RequestLog/Objects.src/{M000137.html → M000142.html} +0 -0
  150. data/doc/rdoc/classes/RequestLog/Params.html +5 -5
  151. data/doc/rdoc/classes/RequestLog/Params.src/{M000138.html → M000143.html} +0 -0
  152. data/doc/rdoc/classes/RequestLog/Threads.html +5 -5
  153. data/doc/rdoc/classes/RequestLog/Threads.src/{M000136.html → M000141.html} +0 -0
  154. data/doc/rdoc/created.rid +1 -1
  155. data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
  156. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +1 -1
  157. data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
  158. data/doc/rdoc/fr_class_index.html +1 -0
  159. data/doc/rdoc/fr_method_index.html +124 -119
  160. data/examples/simpletest.rb +2 -0
  161. data/ext/http11/http11.c +1 -1
  162. data/lib/mongrel.rb +30 -5
  163. data/lib/mongrel/handlers.rb +57 -2
  164. data/test/test_redirect_handler.rb +40 -0
  165. metadata +47 -38
  166. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000096.html +0 -24
  167. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000097.html +0 -47
  168. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000047.html +0 -18
  169. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +0 -24
  170. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000037.html +0 -20
  171. data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +0 -29
  172. data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +0 -31
  173. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +0 -21
  174. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +0 -25
  175. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +0 -20
  176. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +0 -25
  177. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000040.html +0 -39
  178. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000043.html +0 -22
  179. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +0 -18
@@ -5,59 +5,22 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>run (Mongrel::HttpServer)</title>
8
+ <title>reap_dead_workers (Mongrel::HttpServer)</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 602</span>
14
- 602: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
15
- 603: <span class="ruby-constant">BasicSocket</span>.<span class="ruby-identifier">do_not_reverse_lookup</span>=<span class="ruby-keyword kw">true</span>
16
- 604:
17
- 605: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
18
- 606: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
19
- 607: <span class="ruby-keyword kw">begin</span>
20
- 608: <span class="ruby-identifier">client</span> = <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>
21
- 609: <span class="ruby-identifier">worker_list</span> = <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>
22
- 610:
23
- 611: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@num_processors</span>
24
- 612: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection.&quot;</span>
25
- 613: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span>
26
- 614: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-identifier">worker_list</span>)
27
- 615: <span class="ruby-keyword kw">else</span>
28
- 616: <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
29
- 617: <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
30
- 618: <span class="ruby-keyword kw">end</span>
31
- 619:
32
- 620: <span class="ruby-identifier">thread</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
33
- 621: <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">priority</span>=<span class="ruby-value">1</span>
34
- 622: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">thread</span>)
35
- 623:
36
- 624: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@timeout</span><span class="ruby-operator">/</span><span class="ruby-value">100</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
37
- 625: <span class="ruby-keyword kw">end</span>
38
- 626: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StopServer</span>
39
- 627: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">closed?</span>
40
- 628: <span class="ruby-keyword kw">break</span>
41
- 629: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
42
- 630: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Too many open files. Try increasing ulimits.&quot;</span>
43
- 631: <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>
44
- 632: <span class="ruby-keyword kw">end</span>
45
- 633: <span class="ruby-keyword kw">end</span>
46
- 634:
47
- 635: <span class="ruby-comment cmt"># troll through the threads that are waiting and kill any that take too long</span>
48
- 636: <span class="ruby-comment cmt"># TODO: Allow for death time to be set if people ask for it.</span>
49
- 637: <span class="ruby-ivar">@death_time</span> = <span class="ruby-value">10</span>
50
- 638: <span class="ruby-identifier">shutdown_start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
51
- 639:
52
- 640: <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
53
- 641: <span class="ruby-identifier">waited_for</span> = (<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">shutdown_start</span>).<span class="ruby-identifier">ceil</span>
54
- 642: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Shutdown waited #{waited_for} for #{@workers.list.length} requests, could take #{@death_time + @timeout} seconds.\r&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
55
- 643: <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span>
56
- 644: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>)
57
- 645: <span class="ruby-keyword kw">end</span>
58
- 646: <span class="ruby-keyword kw">end</span>
59
- 647:
60
- 648: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@acceptor</span>
61
- 649: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 594</span>
14
+ 594: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-identifier">worker_list</span>)
15
+ 595: <span class="ruby-identifier">mark</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
16
+ 596: <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
17
+ 597: <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>]
18
+ 598:
19
+ 599: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mark</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@death_time</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@timeout</span>
20
+ 600: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Thread #{w.inspect} is too old, killing.&quot;</span>
21
+ 601: <span class="ruby-identifier">w</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">StopServer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Timed out thread.&quot;</span>))
22
+ 602: <span class="ruby-keyword kw">end</span>
23
+ 603: <span class="ruby-keyword kw">end</span>
24
+ 604: <span class="ruby-keyword kw">end</span></pre>
62
25
  </body>
63
26
  </html>
@@ -5,30 +5,59 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>register (Mongrel::HttpServer)</title>
8
+ <title>run (Mongrel::HttpServer)</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 658</span>
14
- 658: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>, <span class="ruby-identifier">in_front</span>=<span class="ruby-keyword kw">false</span>)
15
- 659: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handlers</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">uri</span>)
16
- 660:
17
- 661: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">handlers</span>
18
- 662: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
19
- 663: <span class="ruby-keyword kw">else</span>
20
- 664: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path_info</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">or</span> (<span class="ruby-identifier">script_name</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">path_info</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span>)
21
- 665: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_front</span>
22
- 666: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">handler</span>)
23
- 667: <span class="ruby-keyword kw">else</span>
24
- 668: <span class="ruby-identifier">handlers</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">handler</span>
25
- 669: <span class="ruby-keyword kw">end</span>
26
- 670: <span class="ruby-keyword kw">else</span>
27
- 671: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
28
- 672: <span class="ruby-keyword kw">end</span>
29
- 673: <span class="ruby-keyword kw">end</span>
30
- 674:
31
- 675: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">listener</span> = <span class="ruby-keyword kw">self</span>
32
- 676: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 609</span>
14
+ 609: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
15
+ 610: <span class="ruby-constant">BasicSocket</span>.<span class="ruby-identifier">do_not_reverse_lookup</span>=<span class="ruby-keyword kw">true</span>
16
+ 611:
17
+ 612: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
18
+ 613: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
19
+ 614: <span class="ruby-keyword kw">begin</span>
20
+ 615: <span class="ruby-identifier">client</span> = <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>
21
+ 616: <span class="ruby-identifier">worker_list</span> = <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>
22
+ 617:
23
+ 618: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@num_processors</span>
24
+ 619: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection.&quot;</span>
25
+ 620: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span>
26
+ 621: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-identifier">worker_list</span>)
27
+ 622: <span class="ruby-keyword kw">else</span>
28
+ 623: <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
29
+ 624: <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
30
+ 625: <span class="ruby-keyword kw">end</span>
31
+ 626:
32
+ 627: <span class="ruby-identifier">thread</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
33
+ 628: <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">priority</span>=<span class="ruby-value">1</span>
34
+ 629: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">thread</span>)
35
+ 630:
36
+ 631: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@timeout</span><span class="ruby-operator">/</span><span class="ruby-value">100</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
37
+ 632: <span class="ruby-keyword kw">end</span>
38
+ 633: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StopServer</span>
39
+ 634: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">closed?</span>
40
+ 635: <span class="ruby-keyword kw">break</span>
41
+ 636: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
42
+ 637: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Too many open files. Try increasing ulimits.&quot;</span>
43
+ 638: <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>
44
+ 639: <span class="ruby-keyword kw">end</span>
45
+ 640: <span class="ruby-keyword kw">end</span>
46
+ 641:
47
+ 642: <span class="ruby-comment cmt"># troll through the threads that are waiting and kill any that take too long</span>
48
+ 643: <span class="ruby-comment cmt"># TODO: Allow for death time to be set if people ask for it.</span>
49
+ 644: <span class="ruby-ivar">@death_time</span> = <span class="ruby-value">10</span>
50
+ 645: <span class="ruby-identifier">shutdown_start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
51
+ 646:
52
+ 647: <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
53
+ 648: <span class="ruby-identifier">waited_for</span> = (<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">shutdown_start</span>).<span class="ruby-identifier">ceil</span>
54
+ 649: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Shutdown waited #{waited_for} for #{@workers.list.length} requests, could take #{@death_time + @timeout} seconds.\r&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
55
+ 650: <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span>
56
+ 651: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>)
57
+ 652: <span class="ruby-keyword kw">end</span>
58
+ 653: <span class="ruby-keyword kw">end</span>
59
+ 654:
60
+ 655: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@acceptor</span>
61
+ 656: <span class="ruby-keyword kw">end</span></pre>
33
62
  </body>
34
63
  </html>
@@ -5,14 +5,30 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>unregister (Mongrel::HttpServer)</title>
8
+ <title>register (Mongrel::HttpServer)</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 681</span>
14
- 681: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
15
- 682: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 665</span>
14
+ 665: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>, <span class="ruby-identifier">in_front</span>=<span class="ruby-keyword kw">false</span>)
15
+ 666: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handlers</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">uri</span>)
16
+ 667:
17
+ 668: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">handlers</span>
18
+ 669: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
19
+ 670: <span class="ruby-keyword kw">else</span>
20
+ 671: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path_info</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">or</span> (<span class="ruby-identifier">script_name</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">path_info</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span>)
21
+ 672: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_front</span>
22
+ 673: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">handler</span>)
23
+ 674: <span class="ruby-keyword kw">else</span>
24
+ 675: <span class="ruby-identifier">handlers</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">handler</span>
25
+ 676: <span class="ruby-keyword kw">end</span>
26
+ 677: <span class="ruby-keyword kw">else</span>
27
+ 678: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
28
+ 679: <span class="ruby-keyword kw">end</span>
29
+ 680: <span class="ruby-keyword kw">end</span>
30
+ 681:
31
+ 682: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">listener</span> = <span class="ruby-keyword kw">self</span>
16
32
  683: <span class="ruby-keyword kw">end</span></pre>
17
33
  </body>
18
34
  </html>
@@ -5,18 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>stop (Mongrel::HttpServer)</title>
8
+ <title>unregister (Mongrel::HttpServer)</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 687</span>
14
- 687: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
15
- 688: <span class="ruby-identifier">stopper</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
16
- 689: <span class="ruby-identifier">exc</span> = <span class="ruby-constant">StopServer</span>.<span class="ruby-identifier">new</span>
17
- 690: <span class="ruby-ivar">@acceptor</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-identifier">exc</span>)
18
- 691: <span class="ruby-keyword kw">end</span>
19
- 692: <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">priority</span> = <span class="ruby-value">10</span>
20
- 693: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 688</span>
14
+ 688: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
15
+ 689: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
16
+ 690: <span class="ruby-keyword kw">end</span></pre>
21
17
  </body>
22
18
  </html>
@@ -0,0 +1,22 @@
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>stop (Mongrel::HttpServer)</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 694</span>
14
+ 694: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
15
+ 695: <span class="ruby-identifier">stopper</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
16
+ 696: <span class="ruby-identifier">exc</span> = <span class="ruby-constant">StopServer</span>.<span class="ruby-identifier">new</span>
17
+ 697: <span class="ruby-ivar">@acceptor</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-identifier">exc</span>)
18
+ 698: <span class="ruby-keyword kw">end</span>
19
+ 699: <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">priority</span> = <span class="ruby-value">10</span>
20
+ 700: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -96,9 +96,9 @@ href="../Configurator.html">Configurator</a>.
96
96
  <h3 class="section-bar">Methods</h3>
97
97
 
98
98
  <div class="name-list">
99
- <a href="#M000040">rails</a>&nbsp;&nbsp;
100
- <a href="#M000041">reload!</a>&nbsp;&nbsp;
101
- <a href="#M000042">setup_rails_signals</a>&nbsp;&nbsp;
99
+ <a href="#M000041">rails</a>&nbsp;&nbsp;
100
+ <a href="#M000042">reload!</a>&nbsp;&nbsp;
101
+ <a href="#M000043">setup_rails_signals</a>&nbsp;&nbsp;
102
102
  </div>
103
103
  </div>
104
104
 
@@ -120,12 +120,12 @@ href="../Configurator.html">Configurator</a>.
120
120
  <div id="methods">
121
121
  <h3 class="section-bar">Public Instance methods</h3>
122
122
 
123
- <div id="method-M000040" class="method-detail">
124
- <a name="M000040"></a>
123
+ <div id="method-M000041" class="method-detail">
124
+ <a name="M000041"></a>
125
125
 
126
126
  <div class="method-heading">
127
- <a href="RailsConfigurator.src/M000040.html" target="Code" class="method-signature"
128
- onclick="popupCode('RailsConfigurator.src/M000040.html');return false;">
127
+ <a href="RailsConfigurator.src/M000041.html" target="Code" class="method-signature"
128
+ onclick="popupCode('RailsConfigurator.src/M000041.html');return false;">
129
129
  <span class="method-name">rails</span><span class="method-args">(options={})</span>
130
130
  </a>
131
131
  </div>
@@ -170,12 +170,12 @@ still protects you from threads destroying your handler.
170
170
  </div>
171
171
  </div>
172
172
 
173
- <div id="method-M000041" class="method-detail">
174
- <a name="M000041"></a>
173
+ <div id="method-M000042" class="method-detail">
174
+ <a name="M000042"></a>
175
175
 
176
176
  <div class="method-heading">
177
- <a href="RailsConfigurator.src/M000041.html" target="Code" class="method-signature"
178
- onclick="popupCode('RailsConfigurator.src/M000041.html');return false;">
177
+ <a href="RailsConfigurator.src/M000042.html" target="Code" class="method-signature"
178
+ onclick="popupCode('RailsConfigurator.src/M000042.html');return false;">
179
179
  <span class="method-name">reload!</span><span class="method-args">()</span>
180
180
  </a>
181
181
  </div>
@@ -189,12 +189,12 @@ process.
189
189
  </div>
190
190
  </div>
191
191
 
192
- <div id="method-M000042" class="method-detail">
193
- <a name="M000042"></a>
192
+ <div id="method-M000043" class="method-detail">
193
+ <a name="M000043"></a>
194
194
 
195
195
  <div class="method-heading">
196
- <a href="RailsConfigurator.src/M000042.html" target="Code" class="method-signature"
197
- onclick="popupCode('RailsConfigurator.src/M000042.html');return false;">
196
+ <a href="RailsConfigurator.src/M000043.html" target="Code" class="method-signature"
197
+ onclick="popupCode('RailsConfigurator.src/M000043.html');return false;">
198
198
  <span class="method-name">setup_rails_signals</span><span class="method-args">(options={})</span>
199
199
  </a>
200
200
  </div>
@@ -5,21 +5,35 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>reload! (Mongrel::Rails::RailsConfigurator)</title>
8
+ <title>rails (Mongrel::Rails::RailsConfigurator)</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/rails.rb, line 170</span>
14
- 170: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload!</span>
15
- 171: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@rails_handler</span>
16
- 172: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Rails was not configured. Read the docs for RailsConfigurator.&quot;</span>
17
- 173: <span class="ruby-keyword kw">end</span>
18
- 174:
19
- 175: <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;Reloading rails...&quot;</span>
20
- 176: <span class="ruby-ivar">@rails_handler</span>.<span class="ruby-identifier">reload!</span>
21
- 177: <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;Done reloading rails.&quot;</span>
22
- 178:
23
- 179: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel/rails.rb, line 141</span>
14
+ 141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rails</span>(<span class="ruby-identifier">options</span>={})
15
+ 142:
16
+ 143: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@rails_handler</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@rails_handler</span>
17
+ 144:
18
+ 145: <span class="ruby-identifier">ops</span> = <span class="ruby-identifier">resolve_defaults</span>(<span class="ruby-identifier">options</span>)
19
+ 146:
20
+ 147: <span class="ruby-comment cmt"># fix up some defaults</span>
21
+ 148: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:environment</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;development&quot;</span>
22
+ 149: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:docroot</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;public&quot;</span>
23
+ 150: <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:mime</span>] <span class="ruby-operator">||=</span> {}
24
+ 151:
25
+ 152:
26
+ 153: <span class="ruby-identifier">$orig_dollar_quote</span> = <span class="ruby-identifier">$&quot;</span>.<span class="ruby-identifier">clone</span>
27
+ 154: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'RAILS_ENV'</span>] = <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:environment</span>]
28
+ 155: <span class="ruby-identifier">env_location</span> = <span class="ruby-node">&quot;#{ops[:cwd]}/config/environment&quot;</span>
29
+ 156: <span class="ruby-identifier">require</span> <span class="ruby-identifier">env_location</span>
30
+ 157: <span class="ruby-identifier">require</span> <span class="ruby-value str">'dispatcher'</span>
31
+ 158: <span class="ruby-identifier">require</span> <span class="ruby-value str">'mongrel/rails'</span>
32
+ 159:
33
+ 160: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">allow_concurrency</span>
34
+ 161: <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;[RAILS] ActionController::Base.allow_concurrency is true. Wow, you're very brave.&quot;</span>
35
+ 162: <span class="ruby-keyword kw">end</span>
36
+ 163: <span class="ruby-ivar">@rails_handler</span> = <span class="ruby-constant">RailsHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:docroot</span>], <span class="ruby-identifier">ops</span>[<span class="ruby-identifier">:mime</span>])
37
+ 164: <span class="ruby-keyword kw">end</span></pre>
24
38
  </body>
25
39
  </html>
@@ -5,22 +5,21 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>setup_rails_signals (Mongrel::Rails::RailsConfigurator)</title>
8
+ <title>reload! (Mongrel::Rails::RailsConfigurator)</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/rails.rb, line 183</span>
14
- 183: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup_rails_signals</span>(<span class="ruby-identifier">options</span>={})
15
- 184: <span class="ruby-identifier">ops</span> = <span class="ruby-identifier">resolve_defaults</span>(<span class="ruby-identifier">options</span>)
16
- 185: <span class="ruby-identifier">setup_signals</span>(<span class="ruby-identifier">options</span>)
17
- 186:
18
- 187: <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>
19
- 188: <span class="ruby-comment cmt"># rails reload</span>
20
- 189: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">&quot;HUP&quot;</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;HUP signal received.&quot;</span>; <span class="ruby-identifier">reload!</span> }
21
- 190:
22
- 191: <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;Rails signals registered. HUP =&gt; reload (without restart). It might not work well.&quot;</span>
23
- 192: <span class="ruby-keyword kw">end</span>
24
- 193: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel/rails.rb, line 170</span>
14
+ 170: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload!</span>
15
+ 171: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@rails_handler</span>
16
+ 172: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Rails was not configured. Read the docs for RailsConfigurator.&quot;</span>
17
+ 173: <span class="ruby-keyword kw">end</span>
18
+ 174:
19
+ 175: <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;Reloading rails...&quot;</span>
20
+ 176: <span class="ruby-ivar">@rails_handler</span>.<span class="ruby-identifier">reload!</span>
21
+ 177: <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;Done reloading rails.&quot;</span>
22
+ 178:
23
+ 179: <span class="ruby-keyword kw">end</span></pre>
25
24
  </body>
26
25
  </html>
@@ -0,0 +1,26 @@
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_rails_signals (Mongrel::Rails::RailsConfigurator)</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/rails.rb, line 183</span>
14
+ 183: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup_rails_signals</span>(<span class="ruby-identifier">options</span>={})
15
+ 184: <span class="ruby-identifier">ops</span> = <span class="ruby-identifier">resolve_defaults</span>(<span class="ruby-identifier">options</span>)
16
+ 185: <span class="ruby-identifier">setup_signals</span>(<span class="ruby-identifier">options</span>)
17
+ 186:
18
+ 187: <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>
19
+ 188: <span class="ruby-comment cmt"># rails reload</span>
20
+ 189: <span class="ruby-identifier">trap</span>(<span class="ruby-value str">&quot;HUP&quot;</span>) { <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;HUP signal received.&quot;</span>; <span class="ruby-identifier">reload!</span> }
21
+ 190:
22
+ 191: <span class="ruby-identifier">log</span> <span class="ruby-value str">&quot;Rails signals registered. HUP =&gt; reload (without restart). It might not work well.&quot;</span>
23
+ 192: <span class="ruby-keyword kw">end</span>
24
+ 193: <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </html>
@@ -129,9 +129,9 @@ An additional feature you can use is
129
129
  <h3 class="section-bar">Methods</h3>
130
130
 
131
131
  <div class="name-list">
132
- <a href="#M000043">new</a>&nbsp;&nbsp;
133
- <a href="#M000044">process</a>&nbsp;&nbsp;
134
- <a href="#M000045">reload!</a>&nbsp;&nbsp;
132
+ <a href="#M000044">new</a>&nbsp;&nbsp;
133
+ <a href="#M000045">process</a>&nbsp;&nbsp;
134
+ <a href="#M000046">reload!</a>&nbsp;&nbsp;
135
135
  </div>
136
136
  </div>
137
137
 
@@ -171,12 +171,12 @@ An additional feature you can use is
171
171
  <div id="methods">
172
172
  <h3 class="section-bar">Public Class methods</h3>
173
173
 
174
- <div id="method-M000043" class="method-detail">
175
- <a name="M000043"></a>
174
+ <div id="method-M000044" class="method-detail">
175
+ <a name="M000044"></a>
176
176
 
177
177
  <div class="method-heading">
178
- <a href="RailsHandler.src/M000043.html" target="Code" class="method-signature"
179
- onclick="popupCode('RailsHandler.src/M000043.html');return false;">
178
+ <a href="RailsHandler.src/M000044.html" target="Code" class="method-signature"
179
+ onclick="popupCode('RailsHandler.src/M000044.html');return false;">
180
180
  <span class="method-name">new</span><span class="method-args">(dir, mime_map = {})</span>
181
181
  </a>
182
182
  </div>
@@ -187,12 +187,12 @@ An additional feature you can use is
187
187
 
188
188
  <h3 class="section-bar">Public Instance methods</h3>
189
189
 
190
- <div id="method-M000044" class="method-detail">
191
- <a name="M000044"></a>
190
+ <div id="method-M000045" class="method-detail">
191
+ <a name="M000045"></a>
192
192
 
193
193
  <div class="method-heading">
194
- <a href="RailsHandler.src/M000044.html" target="Code" class="method-signature"
195
- onclick="popupCode('RailsHandler.src/M000044.html');return false;">
194
+ <a href="RailsHandler.src/M000045.html" target="Code" class="method-signature"
195
+ onclick="popupCode('RailsHandler.src/M000045.html');return false;">
196
196
  <span class="method-name">process</span><span class="method-args">(request, response)</span>
197
197
  </a>
198
198
  </div>
@@ -216,12 +216,12 @@ and run Dispatcher.dispatch to have <a href="../Rails.html">Rails</a> go.
216
216
  </div>
217
217
  </div>
218
218
 
219
- <div id="method-M000045" class="method-detail">
220
- <a name="M000045"></a>
219
+ <div id="method-M000046" class="method-detail">
220
+ <a name="M000046"></a>
221
221
 
222
222
  <div class="method-heading">
223
- <a href="RailsHandler.src/M000045.html" target="Code" class="method-signature"
224
- onclick="popupCode('RailsHandler.src/M000045.html');return false;">
223
+ <a href="RailsHandler.src/M000046.html" target="Code" class="method-signature"
224
+ onclick="popupCode('RailsHandler.src/M000046.html');return false;">
225
225
  <span class="method-name">reload!</span><span class="method-args">()</span>
226
226
  </a>
227
227
  </div>