mongrel 0.3.12.4 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. data/Rakefile +44 -33
  2. data/bin/mongrel_rails +67 -34
  3. data/doc/rdoc/classes/IO.html +10 -10
  4. data/doc/rdoc/classes/IO.src/{M000005.html → M000001.html} +5 -5
  5. data/doc/rdoc/classes/IO.src/{M000006.html → M000002.html} +5 -5
  6. data/doc/rdoc/classes/Kernel.html +10 -10
  7. data/doc/rdoc/classes/Kernel.src/{M000025.html → M000020.html} +5 -5
  8. data/doc/rdoc/classes/Kernel.src/M000021.html +23 -0
  9. data/doc/rdoc/classes/Mongrel.html +25 -4
  10. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +383 -0
  11. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000096.html +11 -5
  12. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000097.html +34 -5
  13. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +21 -6
  14. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000093.html → M000099.html} +13 -13
  15. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000094.html → M000100.html} +11 -11
  16. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000095.html → M000101.html} +4 -4
  17. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000102.html +18 -0
  18. data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000084.html → CGIWrapper.src/M000103.html} +5 -5
  19. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +19 -0
  20. data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
  21. data/doc/rdoc/classes/Mongrel/Camping.src/M000046.html +22 -0
  22. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
  23. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/{M000049.html → M000047.html} +4 -4
  24. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000048.html +51 -0
  25. data/doc/rdoc/classes/Mongrel/Command.html +13 -0
  26. data/doc/rdoc/classes/Mongrel/Command/Base.html +95 -50
  27. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +24 -0
  28. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +42 -0
  29. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +18 -0
  30. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +18 -0
  31. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +18 -0
  32. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +5 -11
  33. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +9 -28
  34. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +5 -5
  35. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +5 -5
  36. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +5 -5
  37. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +11 -9
  38. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +11 -5
  39. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +5 -5
  40. data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
  41. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000037.html +20 -0
  42. data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000040.html → M000038.html} +11 -11
  43. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +37 -7
  44. data/doc/rdoc/classes/Mongrel/Configurator.html +651 -0
  45. data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +16 -20
  46. data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +18 -5
  47. data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +7 -11
  48. data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +7 -6
  49. data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +10 -9
  50. data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +5 -8
  51. data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +21 -5
  52. data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +6 -15
  53. data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +17 -5
  54. data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +20 -33
  55. data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +5 -5
  56. data/doc/rdoc/classes/Mongrel/Configurator.src/M000116.html +24 -0
  57. data/doc/rdoc/classes/Mongrel/Configurator.src/M000117.html +19 -0
  58. data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +22 -0
  59. data/doc/rdoc/classes/Mongrel/Configurator.src/M000119.html +25 -0
  60. data/doc/rdoc/classes/Mongrel/Configurator.src/M000120.html +18 -0
  61. data/doc/rdoc/classes/Mongrel/Configurator.src/M000121.html +35 -0
  62. data/doc/rdoc/classes/Mongrel/Configurator.src/M000122.html +18 -0
  63. data/doc/rdoc/classes/Mongrel/Configurator.src/M000123.html +33 -0
  64. data/doc/rdoc/classes/Mongrel/Configurator.src/M000124.html +18 -0
  65. data/doc/rdoc/classes/Mongrel/Const.html +39 -7
  66. data/doc/rdoc/classes/Mongrel/DeflateFilter.html +181 -0
  67. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000094.html +19 -0
  68. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000095.html +28 -0
  69. data/doc/rdoc/classes/Mongrel/DirHandler.html +48 -33
  70. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +21 -0
  71. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000057.html +43 -0
  72. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +29 -7
  73. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +50 -29
  74. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +26 -27
  75. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +5 -38
  76. data/doc/rdoc/classes/Mongrel/Error404Handler.html +171 -0
  77. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000116.html → M000125.html} +4 -4
  78. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000117.html → M000126.html} +4 -4
  79. data/doc/rdoc/classes/Mongrel/HeaderOut.html +185 -0
  80. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000072.html → M000069.html} +4 -4
  81. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000073.html → M000070.html} +4 -4
  82. data/doc/rdoc/classes/Mongrel/HttpHandler.html +170 -0
  83. data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000074.html → M000075.html} +3 -3
  84. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +20 -10
  85. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000027.html → M000022.html} +5 -4
  86. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000028.html → M000023.html} +3 -3
  87. data/doc/rdoc/classes/Mongrel/HttpParser.html +41 -36
  88. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000056.html → M000049.html} +6 -5
  89. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000057.html → M000050.html} +7 -6
  90. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +7 -6
  91. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +37 -7
  92. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +5 -7
  93. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +6 -22
  94. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +6 -5
  95. data/doc/rdoc/classes/Mongrel/HttpRequest.html +239 -0
  96. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000130.html +52 -0
  97. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000119.html → M000131.html} +6 -6
  98. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000120.html → M000132.html} +6 -6
  99. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000121.html → M000133.html} +18 -18
  100. data/doc/rdoc/classes/Mongrel/HttpResponse.html +439 -0
  101. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +12 -7
  102. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +7 -12
  103. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +12 -9
  104. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +9 -9
  105. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +9 -10
  106. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +9 -5
  107. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +18 -7
  108. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +8 -5
  109. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +20 -0
  110. data/doc/rdoc/classes/Mongrel/{HttpServer.src/M000069.html → HttpResponse.src/M000085.html} +7 -5
  111. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +20 -0
  112. data/doc/rdoc/classes/Mongrel/{Configurator.src/M000101.html → HttpResponse.src/M000087.html} +5 -5
  113. data/doc/rdoc/classes/Mongrel/HttpServer.html +68 -59
  114. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +25 -0
  115. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +83 -0
  116. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +13 -11
  117. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +50 -53
  118. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +21 -11
  119. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +5 -47
  120. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +9 -15
  121. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +16 -16
  122. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000040.html +39 -0
  123. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/{M000043.html → M000041.html} +11 -11
  124. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +13 -22
  125. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +17 -17
  126. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000043.html +22 -0
  127. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000044.html +51 -0
  128. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +10 -9
  129. data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +211 -0
  130. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000127.html +24 -0
  131. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000128.html +24 -0
  132. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000129.html +18 -0
  133. data/doc/rdoc/classes/{Class.html → Mongrel/StatusHandler.html} +42 -45
  134. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +18 -0
  135. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000072.html +24 -0
  136. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000073.html +42 -0
  137. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000074.html +20 -0
  138. data/doc/rdoc/classes/Mongrel/StopServer.html +117 -0
  139. data/doc/rdoc/classes/Mongrel/URIClassifier.html +314 -0
  140. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +5 -23
  141. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +5 -70
  142. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000086.html → M000090.html} +0 -0
  143. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000087.html → M000091.html} +0 -0
  144. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +36 -0
  145. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000093.html +83 -0
  146. data/doc/rdoc/classes/MongrelDbg.html +25 -25
  147. data/doc/rdoc/classes/MongrelDbg.src/{M000020.html → M000015.html} +5 -5
  148. data/doc/rdoc/classes/MongrelDbg.src/{M000021.html → M000016.html} +6 -6
  149. data/doc/rdoc/classes/MongrelDbg.src/{M000022.html → M000017.html} +8 -8
  150. data/doc/rdoc/classes/MongrelDbg.src/{M000023.html → M000018.html} +7 -7
  151. data/doc/rdoc/classes/MongrelDbg.src/{M000024.html → M000019.html} +4 -4
  152. data/doc/rdoc/classes/ObjectTracker.html +10 -40
  153. data/doc/rdoc/classes/ObjectTracker.src/M000013.html +27 -0
  154. data/doc/rdoc/classes/ObjectTracker.src/M000014.html +44 -0
  155. data/doc/rdoc/classes/RequestLog.html +115 -0
  156. data/doc/rdoc/classes/RequestLog/Access.html +151 -0
  157. data/doc/rdoc/classes/RequestLog/Access.src/{M000122.html → M000134.html} +5 -5
  158. data/doc/rdoc/classes/RequestLog/Files.html +144 -0
  159. data/doc/rdoc/classes/RequestLog/Files.src/{M000123.html → M000135.html} +5 -5
  160. data/doc/rdoc/classes/RequestLog/Objects.html +144 -0
  161. data/doc/rdoc/classes/RequestLog/Objects.src/{M000124.html → M000137.html} +5 -5
  162. data/doc/rdoc/classes/RequestLog/Params.html +144 -0
  163. data/doc/rdoc/classes/RequestLog/Params.src/{M000125.html → M000138.html} +5 -5
  164. data/doc/rdoc/classes/RequestLog/Threads.html +144 -0
  165. data/doc/rdoc/classes/RequestLog/Threads.src/M000136.html +34 -0
  166. data/doc/rdoc/classes/Stats.html +54 -36
  167. data/doc/rdoc/classes/Stats.src/{M000013.html → M000005.html} +6 -5
  168. data/doc/rdoc/classes/Stats.src/M000006.html +23 -0
  169. data/doc/rdoc/classes/Stats.src/M000007.html +26 -0
  170. data/doc/rdoc/classes/Stats.src/M000008.html +18 -0
  171. data/doc/rdoc/classes/Stats.src/M000009.html +5 -6
  172. data/doc/rdoc/classes/Stats.src/M000010.html +5 -10
  173. data/doc/rdoc/classes/Stats.src/M000011.html +10 -13
  174. data/doc/rdoc/classes/Stats.src/M000012.html +7 -5
  175. data/doc/rdoc/classes/TCPServer.html +9 -9
  176. data/doc/rdoc/classes/TCPServer.src/M000003.html +19 -0
  177. data/doc/rdoc/created.rid +1 -1
  178. data/doc/rdoc/files/COPYING.html +1 -1
  179. data/doc/rdoc/files/LICENSE.html +1 -1
  180. data/doc/rdoc/files/README.html +1 -1
  181. data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
  182. data/doc/rdoc/files/lib/mongrel/camping_rb.html +28 -1
  183. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +28 -1
  184. data/doc/rdoc/files/lib/mongrel/command_rb.html +28 -1
  185. data/doc/rdoc/files/lib/mongrel/debug_rb.html +28 -1
  186. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +3 -3
  187. data/doc/rdoc/files/lib/mongrel/init_rb.html +28 -1
  188. data/doc/rdoc/files/lib/mongrel/rails_rb.html +28 -1
  189. data/doc/rdoc/files/lib/mongrel/stats_rb.html +21 -10
  190. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +23 -4
  191. data/doc/rdoc/files/lib/mongrel_rb.html +33 -1
  192. data/doc/rdoc/fr_class_index.html +65 -0
  193. data/doc/rdoc/fr_file_index.html +40 -0
  194. data/doc/rdoc/fr_method_index.html +164 -0
  195. data/doc/rdoc/index.html +24 -0
  196. data/examples/camping/blog.rb +1 -1
  197. data/examples/camping/tepee.rb +4 -3
  198. data/examples/simpletest.rb +15 -14
  199. data/ext/http11/http11.c +52 -18
  200. data/ext/http11/http11_parser.c +194 -177
  201. data/ext/http11/http11_parser.h +23 -5
  202. data/lib/mongrel.rb +295 -134
  203. data/lib/mongrel/camping.rb +48 -6
  204. data/lib/mongrel/cgi.rb +20 -2
  205. data/lib/mongrel/command.rb +76 -27
  206. data/lib/mongrel/debug.rb +42 -13
  207. data/lib/mongrel/handlers.rb +218 -59
  208. data/lib/mongrel/init.rb +18 -0
  209. data/lib/mongrel/rails.rb +61 -44
  210. data/lib/mongrel/stats.rb +30 -2
  211. data/lib/mongrel/tcphack.rb +18 -0
  212. data/setup.rb +799 -574
  213. data/test/mime.yaml +3 -0
  214. data/test/mongrel.conf +1 -0
  215. data/test/test_command.rb +101 -0
  216. data/test/test_conditional.rb +124 -0
  217. data/test/test_configurator.rb +56 -22
  218. data/test/test_debug.rb +18 -2
  219. data/test/test_handlers.rb +105 -0
  220. data/test/test_http11.rb +27 -9
  221. data/test/test_response.rb +38 -0
  222. data/test/test_stats.rb +21 -2
  223. data/test/test_uriclassifier.rb +18 -0
  224. data/test/test_ws.rb +105 -19
  225. data/test/testhelp.rb +36 -0
  226. data/tools/rakehelp.rb +52 -46
  227. data/tools/trickletest.rb +37 -0
  228. metadata +127 -76
  229. data/doc/rdoc/classes/Class.src/M000001.html +0 -24
  230. data/doc/rdoc/classes/Class.src/M000002.html +0 -62
  231. data/doc/rdoc/classes/Class.src/M000003.html +0 -21
  232. data/doc/rdoc/classes/Class.src/M000004.html +0 -20
  233. data/doc/rdoc/classes/Kernel.src/M000026.html +0 -25
  234. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000090.html +0 -24
  235. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000091.html +0 -47
  236. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000092.html +0 -34
  237. data/doc/rdoc/classes/Mongrel/Camping.src/M000048.html +0 -22
  238. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000050.html +0 -27
  239. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +0 -18
  240. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000038.html +0 -18
  241. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000041.html +0 -46
  242. data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +0 -24
  243. data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +0 -23
  244. data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +0 -32
  245. data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +0 -19
  246. data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +0 -31
  247. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +0 -40
  248. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000063.html +0 -18
  249. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000118.html +0 -28
  250. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +0 -26
  251. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000070.html +0 -22
  252. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000071.html +0 -18
  253. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000044.html +0 -32
  254. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +0 -48
  255. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000047.html +0 -23
  256. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000085.html +0 -18
  257. data/doc/rdoc/classes/ObjectTracker.src/M000016.html +0 -22
  258. data/doc/rdoc/classes/ObjectTracker.src/M000017.html +0 -18
  259. data/doc/rdoc/classes/ObjectTracker.src/M000018.html +0 -18
  260. data/doc/rdoc/classes/ObjectTracker.src/M000019.html +0 -44
  261. data/doc/rdoc/classes/Stats.src/M000014.html +0 -19
  262. data/doc/rdoc/classes/Stats.src/M000015.html +0 -20
  263. data/doc/rdoc/classes/TCPServer.src/M000007.html +0 -19
  264. data/lib/mongrel/#rails.rb# +0 -178
data/Rakefile CHANGED
@@ -16,84 +16,95 @@ desc "Does a full compile, test run"
16
16
  task :default => [:compile, :test]
17
17
 
18
18
  desc "Compiles all extensions"
19
- task :compile => [:http11]
20
- task :package => [:clean,:compile,:test]
19
+ task :compile => [:http11] do
20
+ if Dir.glob(File.join("lib","http11.*")).length == 0
21
+ STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
22
+ STDERR.puts "Gem actually failed to build. Your system is"
23
+ STDERR.puts "NOT configured properly to build Mongrel."
24
+ STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
25
+ exit(1)
26
+ end
27
+ end
28
+
29
+ task :package => [:clean,:compile,:test,:rerdoc]
21
30
 
22
31
  task :ragel do
23
32
  sh %{/usr/local/bin/ragel ext/http11/http11_parser.rl | /usr/local/bin/rlcodegen -G2 -o ext/http11/http11_parser.c}
24
33
  end
25
34
 
26
- task :site do
35
+ task :site_webgen do
27
36
  sh %{pushd doc/site; webgen; scp -r output/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
37
+ end
38
+
39
+ task :site_rdoc do
28
40
  sh %{ scp -r doc/rdoc/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/ }
41
+ end
42
+
43
+ task :site_coverage => [:rcov] do
44
+ sh %{ scp -r test/coverage/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/coverage/ }
45
+ end
46
+
47
+ task :site_projects_rdoc do
29
48
  sh %{ cd projects/gem_plugin; rake site }
30
49
  end
31
50
 
51
+ task :site => [:site_webgen, :site_rdoc, :site_coverage, :site_projects_rdoc]
52
+
32
53
  setup_extension("http11", "http11")
33
54
 
34
55
  name="mongrel"
35
- version="0.3.12.4"
56
+ version="0.3.13"
36
57
 
37
58
  setup_gem(name, version) do |spec|
38
59
  spec.summary = "A small fast HTTP library and server that runs Rails, Camping, and Nitro apps."
39
60
  spec.description = spec.summary
40
- spec.test_file = "test/test_ws.rb"
61
+ spec.test_files = Dir.glob('test/test_*.rb')
41
62
  spec.author="Zed A. Shaw"
42
63
  spec.executables=['mongrel_rails']
43
64
  spec.files += %w(ext/http11/MANIFEST README Rakefile setup.rb)
44
65
 
45
- spec.add_dependency('daemons', '>= 0.4.2')
46
- spec.add_dependency('gem_plugin', '>= 0.2.1')
47
66
  spec.required_ruby_version = '>= 1.8.4'
48
- end
49
67
 
50
- desc "Build a binary gem for Win32"
51
- task :win32_gem => [:clean, :compile, :test, :rerdoc, :package_win32]
52
-
53
- task :package_win32 do
54
- setup_win32_gem(name, version) do |spec|
55
- spec.summary = "A small fast HTTP library and server that runs Rails, Camping, and Nitro apps."
56
- spec.description = spec.summary
57
- spec.test_files = Dir.glob('test/test_*.rb')
58
- spec.author="Zed A. Shaw"
59
- spec.executables=['mongrel_rails', 'mongrel_rails_service']
60
- spec.homepage="http://mongrel.rubyforge.org"
61
- spec.rubyforge_project="mongrel"
62
- spec.files += %w(ext/http11/MANIFEST README Rakefile setup.rb)
68
+ if RUBY_PLATFORM =~ /mswin/
69
+ Dir.chdir "projects/mongrel_service" do
70
+ sh %{rake install }
71
+ end
63
72
  spec.files << 'ext/http11/http11.so'
64
-
65
- spec.required_ruby_version = '>= 1.8.4'
66
-
67
73
  spec.add_dependency('win32-service', '>= 0.5.0')
68
- spec.add_dependency('gem_plugin', ">= 0.2.1")
69
-
70
- spec.extensions = []
74
+ spec.extensions.clear
71
75
  spec.platform = Gem::Platform::WIN32
76
+ else
77
+ spec.add_dependency('daemons', '>= 0.4.2')
72
78
  end
79
+
80
+ spec.add_dependency('gem_plugin', '>= 0.2.1')
73
81
  end
74
82
 
75
-
76
83
  task :install do
77
84
  sub_project("gem_plugin", :install)
78
85
  sh %{rake package}
79
- sh %{sudo gem install pkg/mongrel-#{version}}
86
+ sh %{gem install pkg/mongrel-#{version}}
80
87
  sub_project("mongrel_status", :install)
81
- sub_project("mongrel_config", :install)
82
88
  sub_project("mongrel_console", :install)
89
+ if RUBY_PLATFORM =~ /mswin/
90
+ sub_project("mongrel_service", :install)
91
+ end
83
92
  end
84
93
 
85
94
  task :uninstall => [:clean] do
86
95
  sub_project("mongrel_status", :uninstall)
87
- sub_project("mongrel_config", :uninstall)
88
96
  sub_project("mongrel_console", :uninstall)
89
- sh %{sudo gem uninstall mongrel}
97
+ sh %{gem uninstall mongrel}
90
98
  sub_project("gem_plugin", :uninstall)
99
+ if RUBY_PLATFORM =~ /mswin/
100
+ sub_project("mongrel_service", :install)
101
+ end
91
102
  end
92
103
 
93
104
 
94
105
  task :gem_source do
95
106
  mkdir_p "pkg/gems"
96
-
107
+
97
108
  FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
98
109
  FileList["pkg/*.tgz"].each {|tgz| rm tgz }
99
110
  rm_rf "pkg/#{name}-#{version}"
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'yaml'
4
4
  require 'mongrel'
5
5
  require 'mongrel/rails'
6
-
6
+ require 'etc'
7
7
 
8
8
 
9
9
  class Start < GemPlugin::Plugin "/commands"
@@ -17,17 +17,20 @@ class Start < GemPlugin::Plugin "/commands"
17
17
  ['-a', '--address ADDR', "Address to bind to", :@address, "0.0.0.0"],
18
18
  ['-l', '--log FILE', "Where to write log messages", :@log_file, "log/mongrel.log"],
19
19
  ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"],
20
- ['-n', '--num-procs INT', "Number of processor threads to use", :@num_procs, 1024],
21
- ['-t', '--timeout SECONDS', "Timeout all requests after SECONDS time", :@timeout, 0],
20
+ ['-n', '--num-procs INT', "Number of processors active before clients denied", :@num_procs, 1024],
21
+ ['-t', '--timeout TIME', "Timeout all requests after 100th seconds time", :@timeout, 0],
22
22
  ['-m', '--mime PATH', "A YAML file that lists additional MIME types", :@mime_map, nil],
23
23
  ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd],
24
24
  ['-r', '--root PATH', "Set the document root (default 'public')", :@docroot, "public"],
25
25
  ['-B', '--debug', "Enable debugging mode", :@debug, false],
26
26
  ['-C', '--config PATH', "Use a config file", :@config_file, nil],
27
- ['-S', '--script PATH', "Load the given file as an extra config script.", :@config_script, nil]
27
+ ['-S', '--script PATH', "Load the given file as an extra config script.", :@config_script, nil],
28
+ ['-G', '--generate CONFIG', "Generate a config file for -C", :@generate, nil],
29
+ ['', '--user USER', "User to run as", :@user, nil],
30
+ ['', '--group GROUP', "Group to run as", :@group, nil]
28
31
  ]
29
32
  end
30
-
33
+
31
34
  def validate
32
35
  @cwd = File.expand_path(@cwd)
33
36
  valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
@@ -40,46 +43,65 @@ class Start < GemPlugin::Plugin "/commands"
40
43
  valid_dir? @docroot, "Path to docroot not valid: #@docroot"
41
44
  valid_exists? @mime_map, "MIME mapping file does not exist: #@mime_map" if @mime_map
42
45
  valid_exists? @config_file, "Config file not there: #@config_file" if @config_file
46
+ valid_dir? File.dirname(@generate), "Problem accessing directory to #@generate" if @generate
47
+ valid_user? @user if @user
48
+ valid_group? @group if @group
49
+
43
50
  return @valid
44
51
  end
45
-
52
+
53
+
46
54
  def run
47
55
 
48
56
  # command line setting override config file settings
49
57
  settings = { :host => @address, :port => @port, :cwd => @cwd,
50
58
  :log_file => @log_file, :pid_file => @pid_file, :environment => @environment,
51
59
  :docroot => @docroot, :mime_map => @mime_map, :daemon => @daemon,
52
- :debug => @debug, :includes => ["mongrel"], :config_script => @config_script
60
+ :debug => @debug, :includes => ["mongrel"], :config_script => @config_script,
61
+ :num_processors => @num_procs, :timeout => @timeout,
62
+ :user => @user, :group => @group
53
63
  }
54
64
 
65
+ if @generate
66
+ STDERR.puts "** Writing config to #@generate"
67
+ open(@generate, "w") {|f| f.write(settings.to_yaml) }
68
+ STDERR.puts "## Exiting. Re-run without -G and WITH -C using your new config file."
69
+ exit 0
70
+ end
71
+
55
72
  if @config_file
56
- STDERR.puts "** Loading settings from #{@config_file} (command line options override)."
73
+ STDERR.puts "** Loading settings from #{@config_file} (they override command line)." unless defaults[:daemon]
57
74
  conf = YAML.load_file(@config_file)
58
- settings = conf.merge(settings)
75
+ settings = settings.merge! conf
59
76
  end
60
-
77
+
61
78
  config = Mongrel::Rails::RailsConfigurator.new(settings) do
62
- log "Starting Mongrel in #{defaults[:environment]} mode at #{defaults[:host]}:#{defaults[:port]}"
63
-
64
79
  if defaults[:daemon]
65
- log "Daemonizing, any open files are closed. Look at #{defaults[:pid_file]} and #{defaults[:log_file]} for info."
80
+ if File.exist? defaults[:pid_file]
81
+ log "!!! PID file #{defaults[:pid_file]} already exists. Mongrel could be running already. Check your #{defaults[:log_file]} for errors."
82
+ end
83
+
66
84
  daemonize
85
+ log "Daemonized, any open files are closed. Look at #{defaults[:pid_file]} and #{defaults[:log_file]} for info."
86
+ log "Settings loaded from #{@config_file} (they override command line)." if @config_file
67
87
  end
68
-
88
+
89
+ log "Starting Mongrel listening at #{defaults[:host]}:#{defaults[:port]}"
90
+
69
91
  listener do
70
92
  mime = {}
71
93
  if defaults[:mime_map]
72
94
  log "Loading additional MIME types from #{defaults[:mime_map]}"
73
95
  mime = load_mime_map(defaults[:mime_map], mime)
74
96
  end
75
-
97
+
76
98
  if defaults[:debug]
77
99
  log "Installing debugging prefixed filters. Look in log/mongrel_debug for the files."
78
100
  debug "/"
79
101
  end
80
102
 
81
- log "Starting Rails in environment #{defaults[:environment]} ..."
82
- uri "/", :handler => rails
103
+ log "Starting Rails with #{defaults[:environment]} environment ..."
104
+ uri "/", :handler => rails(:mime => mime)
83
105
  log "Rails loaded."
84
106
 
85
107
  log "Loading any Rails specific GemPlugins"
@@ -96,6 +118,13 @@ class Start < GemPlugin::Plugin "/commands"
96
118
 
97
119
  config.run
98
120
  config.log "Mongrel available at #{settings[:host]}:#{settings[:port]}"
121
+
122
+ if not @daemon
123
+ config.log "Use CTRL-C to stop."
124
+ else
125
+ config.write_pid_file
126
+ end
127
+
99
128
  config.join
100
129
 
101
130
  if config.needs_restart
@@ -118,7 +147,7 @@ def send_signal(signal, pid_file)
118
147
  rescue Errno::ESRCH
119
148
  puts "Process does not exist. Not running."
120
149
  end
121
-
150
+
122
151
  puts "Done."
123
152
  end
124
153
 
@@ -128,23 +157,25 @@ class Stop < GemPlugin::Plugin "/commands"
128
157
 
129
158
  def configure
130
159
  options [
131
- ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd],
132
- ['-f', '--force', "Force the shutdown.", :@force, false],
133
- ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"]
160
+ ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, nil],
161
+ ['-f', '--force', "Force the shutdown.", :@force, false],
162
+ ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"]
134
163
  ]
135
164
  end
136
-
165
+
137
166
  def validate
138
- @cwd = File.expand_path(@cwd)
139
- valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
167
+ if @cwd
168
+ @cwd = File.expand_path(@cwd)
169
+ valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
170
+ @pid_file = File.join(@cwd,@pid_file)
171
+ end
140
172
 
141
- @pid_file = File.join(@cwd,@pid_file)
142
173
  valid_exists? @pid_file, "PID file #@pid_file does not exist. Not running?"
143
174
 
144
175
  return @valid
145
176
  end
146
177
 
147
-
178
+
148
179
  def run
149
180
  if @force
150
181
  send_signal("KILL", @pid_file)
@@ -161,17 +192,19 @@ class Restart < GemPlugin::Plugin "/commands"
161
192
 
162
193
  def configure
163
194
  options [
164
- ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd],
165
- ['-s', '--soft', "Do a soft restart rather than a process exit restart", :@soft, false],
166
- ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"]
195
+ ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, nil],
196
+ ['-s', '--soft', "Do a soft restart rather than a process exit restart", :@soft, false],
197
+ ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"]
167
198
  ]
168
199
  end
169
-
200
+
170
201
  def validate
171
- @cwd = File.expand_path(@cwd)
172
- valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
202
+ if @cwd
203
+ @cwd = File.expand_path(@cwd)
204
+ valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
205
+ @pid_file = File.join(@cwd,@pid_file)
206
+ end
173
207
 
174
- @pid_file = File.join(@cwd,@pid_file)
175
208
  valid_exists? @pid_file, "PID file #@pid_file does not exist. Not running?"
176
209
 
177
210
  return @valid
@@ -192,7 +225,7 @@ GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE, "rails" => Gem
192
225
 
193
226
 
194
227
  if not Mongrel::Command::Registry.instance.run ARGV
195
- exit 1
228
+ exit 1
196
229
  end
197
230
 
198
231
 
@@ -86,8 +86,8 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000006">close</a>&nbsp;&nbsp;
90
- <a href="#M000005">open</a>&nbsp;&nbsp;
89
+ <a href="#M000002">close</a>&nbsp;&nbsp;
90
+ <a href="#M000001">open</a>&nbsp;&nbsp;
91
91
  </div>
92
92
  </div>
93
93
 
@@ -127,12 +127,12 @@
127
127
  <div id="methods">
128
128
  <h3 class="section-bar">Public Instance methods</h3>
129
129
 
130
- <div id="method-M000006" class="method-detail">
131
- <a name="M000006"></a>
130
+ <div id="method-M000002" class="method-detail">
131
+ <a name="M000002"></a>
132
132
 
133
133
  <div class="method-heading">
134
- <a href="IO.src/M000006.html" target="Code" class="method-signature"
135
- onclick="popupCode('IO.src/M000006.html');return false;">
134
+ <a href="IO.src/M000002.html" target="Code" class="method-signature"
135
+ onclick="popupCode('IO.src/M000002.html');return false;">
136
136
  <span class="method-name">close</span><span class="method-args">(*arg,&amp;blk)</span>
137
137
  </a>
138
138
  </div>
@@ -141,12 +141,12 @@
141
141
  </div>
142
142
  </div>
143
143
 
144
- <div id="method-M000005" class="method-detail">
145
- <a name="M000005"></a>
144
+ <div id="method-M000001" class="method-detail">
145
+ <a name="M000001"></a>
146
146
 
147
147
  <div class="method-heading">
148
- <a href="IO.src/M000005.html" target="Code" class="method-signature"
149
- onclick="popupCode('IO.src/M000005.html');return false;">
148
+ <a href="IO.src/M000001.html" target="Code" class="method-signature"
149
+ onclick="popupCode('IO.src/M000001.html');return false;">
150
150
  <span class="method-name">open</span><span class="method-args">(*arg, &amp;blk)</span>
151
151
  </a>
152
152
  </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/debug.rb, line 103</span>
14
- 103: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
15
- 104: <span class="ruby-identifier">$open_files</span>[<span class="ruby-keyword kw">self</span>] = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">inspect</span>
16
- 105: <span class="ruby-identifier">orig_open</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
17
- 106: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel/debug.rb, line 116</span>
14
+ 116: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
15
+ 117: <span class="ruby-identifier">$open_files</span>[<span class="ruby-keyword kw">self</span>] = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">inspect</span>
16
+ 118: <span class="ruby-identifier">orig_open</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
17
+ 119: <span class="ruby-keyword kw">end</span></pre>
18
18
  </body>
19
19
  </html>
@@ -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/debug.rb, line 108</span>
14
- 108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
15
- 109: <span class="ruby-identifier">$open_files</span>.<span class="ruby-identifier">delete</span> <span class="ruby-keyword kw">self</span>
16
- 110: <span class="ruby-identifier">orig_close</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
17
- 111: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel/debug.rb, line 121</span>
14
+ 121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
15
+ 122: <span class="ruby-identifier">$open_files</span>.<span class="ruby-identifier">delete</span> <span class="ruby-keyword kw">self</span>
16
+ 123: <span class="ruby-identifier">orig_close</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arg</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
17
+ 124: <span class="ruby-keyword kw">end</span></pre>
18
18
  </body>
19
19
  </html>
@@ -80,8 +80,8 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000026">log_open_files</a>&nbsp;&nbsp;
84
- <a href="#M000025">open</a>&nbsp;&nbsp;
83
+ <a href="#M000021">log_open_files</a>&nbsp;&nbsp;
84
+ <a href="#M000020">open</a>&nbsp;&nbsp;
85
85
  </div>
86
86
  </div>
87
87
 
@@ -116,12 +116,12 @@
116
116
  <div id="methods">
117
117
  <h3 class="section-bar">Public Instance methods</h3>
118
118
 
119
- <div id="method-M000026" class="method-detail">
120
- <a name="M000026"></a>
119
+ <div id="method-M000021" class="method-detail">
120
+ <a name="M000021"></a>
121
121
 
122
122
  <div class="method-heading">
123
- <a href="Kernel.src/M000026.html" target="Code" class="method-signature"
124
- onclick="popupCode('Kernel.src/M000026.html');return false;">
123
+ <a href="Kernel.src/M000021.html" target="Code" class="method-signature"
124
+ onclick="popupCode('Kernel.src/M000021.html');return false;">
125
125
  <span class="method-name">log_open_files</span><span class="method-args">()</span>
126
126
  </a>
127
127
  </div>
@@ -130,12 +130,12 @@
130
130
  </div>
131
131
  </div>
132
132
 
133
- <div id="method-M000025" class="method-detail">
134
- <a name="M000025"></a>
133
+ <div id="method-M000020" class="method-detail">
134
+ <a name="M000020"></a>
135
135
 
136
136
  <div class="method-heading">
137
- <a href="Kernel.src/M000025.html" target="Code" class="method-signature"
138
- onclick="popupCode('Kernel.src/M000025.html');return false;">
137
+ <a href="Kernel.src/M000020.html" target="Code" class="method-signature"
138
+ onclick="popupCode('Kernel.src/M000020.html');return false;">
139
139
  <span class="method-name">open</span><span class="method-args">(*arg, &amp;blk)</span>
140
140
  </a>
141
141
  </div>