mongrel 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/README +30 -24
  2. data/Rakefile +12 -2
  3. data/bin/mongrel_rails +12 -8
  4. data/doc/rdoc/classes/Mongrel.html +18 -1
  5. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +381 -0
  6. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000051.html +24 -0
  7. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000052.html +47 -0
  8. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000053.html +34 -0
  9. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000054.html +27 -0
  10. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000055.html +25 -0
  11. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000056.html +18 -0
  12. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000057.html +18 -0
  13. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000058.html +18 -0
  14. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000059.html +19 -0
  15. data/doc/rdoc/classes/Mongrel/Command.html +119 -0
  16. data/doc/rdoc/classes/Mongrel/Command/Base.html +332 -0
  17. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000003.html +24 -0
  18. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000004.html +41 -0
  19. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000005.html +18 -0
  20. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000006.html +18 -0
  21. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000007.html +18 -0
  22. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000008.html +22 -0
  23. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000009.html +18 -0
  24. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000010.html +18 -0
  25. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000011.html +18 -0
  26. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000012.html +18 -0
  27. data/doc/rdoc/classes/Mongrel/Command/Registry.html +192 -0
  28. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000013.html +20 -0
  29. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000014.html +25 -0
  30. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000015.html +46 -0
  31. data/doc/rdoc/classes/Mongrel/Const.html +2 -2
  32. data/doc/rdoc/classes/Mongrel/DirHandler.html +283 -0
  33. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000023.html +20 -0
  34. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000024.html +42 -0
  35. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000025.html +40 -0
  36. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000026.html +31 -0
  37. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000027.html +38 -0
  38. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000028.html +18 -0
  39. data/doc/rdoc/classes/Mongrel/Error404Handler.html +171 -0
  40. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000060.html +18 -0
  41. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000061.html +18 -0
  42. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  43. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000014.html → M000035.html} +0 -0
  44. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000015.html → M000036.html} +0 -0
  45. data/doc/rdoc/classes/Mongrel/HttpHandler.html +146 -0
  46. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000037.html +17 -0
  47. data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
  48. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000001.html → M000016.html} +0 -0
  49. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000002.html → M000017.html} +0 -0
  50. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000003.html → M000018.html} +0 -0
  51. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000004.html → M000019.html} +0 -0
  52. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000005.html → M000020.html} +0 -0
  53. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000006.html → M000021.html} +0 -0
  54. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000007.html → M000022.html} +0 -0
  55. data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
  56. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000029.html → M000062.html} +0 -0
  57. data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
  58. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000016.html → M000038.html} +0 -0
  59. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000017.html → M000039.html} +0 -0
  60. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000018.html → M000040.html} +0 -0
  61. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000019.html → M000041.html} +0 -0
  62. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000020.html → M000042.html} +0 -0
  63. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000021.html → M000043.html} +0 -0
  64. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000022.html → M000044.html} +0 -0
  65. data/doc/rdoc/classes/Mongrel/HttpServer.html +33 -33
  66. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000008.html → M000029.html} +0 -0
  67. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000009.html → M000030.html} +0 -0
  68. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000010.html → M000031.html} +0 -0
  69. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000011.html → M000032.html} +0 -0
  70. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000012.html → M000033.html} +0 -0
  71. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000013.html → M000034.html} +0 -0
  72. data/doc/rdoc/classes/Mongrel/URIClassifier.html +33 -32
  73. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000023.html → M000045.html} +0 -0
  74. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000024.html → M000046.html} +0 -0
  75. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000025.html → M000047.html} +0 -0
  76. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000026.html → M000048.html} +0 -0
  77. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000027.html → M000049.html} +0 -0
  78. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000028.html → M000050.html} +0 -0
  79. data/doc/rdoc/classes/RailsHandler.html +225 -0
  80. data/doc/rdoc/classes/RailsHandler.src/M000001.html +22 -0
  81. data/doc/rdoc/classes/RailsHandler.src/M000002.html +48 -0
  82. data/doc/rdoc/created.rid +1 -1
  83. data/doc/rdoc/files/README.html +45 -50
  84. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +108 -0
  85. data/doc/rdoc/files/lib/mongrel/command_rb.html +110 -0
  86. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +101 -0
  87. data/doc/rdoc/files/lib/mongrel/plugins_rb.html +108 -0
  88. data/doc/rdoc/files/lib/mongrel/rails_rb.html +108 -0
  89. data/doc/rdoc/fr_class_index.html +8 -0
  90. data/doc/rdoc/fr_file_index.html +5 -0
  91. data/doc/rdoc/fr_method_index.html +62 -29
  92. data/lib/mongrel/command.rb +5 -5
  93. data/lib/mongrel/plugins.rb +3 -152
  94. data/lib/mongrel/rails.rb +1 -1
  95. metadata +95 -35
  96. data/test/plugins/commands/test1.rb +0 -19
  97. data/test/test_plugins.rb +0 -45
@@ -0,0 +1,108 @@
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: plugins.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>plugins.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/mongrel/plugins.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Mar 05 17:56:06 EST 2006</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ rubygems&nbsp;&nbsp;
77
+ </div>
78
+ </div>
79
+
80
+ </div>
81
+
82
+
83
+ </div>
84
+
85
+
86
+ <!-- if includes -->
87
+
88
+ <div id="section">
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <!-- if method_list -->
98
+
99
+
100
+ </div>
101
+
102
+
103
+ <div id="validator-badges">
104
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
105
+ </div>
106
+
107
+ </body>
108
+ </html>
@@ -0,0 +1,108 @@
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: rails.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>rails.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/mongrel/rails.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Mar 05 23:29:44 EST 2006</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ mongrel&nbsp;&nbsp;
77
+ </div>
78
+ </div>
79
+
80
+ </div>
81
+
82
+
83
+ </div>
84
+
85
+
86
+ <!-- if includes -->
87
+
88
+ <div id="section">
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <!-- if method_list -->
98
+
99
+
100
+ </div>
101
+
102
+
103
+ <div id="validator-badges">
104
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
105
+ </div>
106
+
107
+ </body>
108
+ </html>
@@ -21,8 +21,15 @@
21
21
  <h1 class="section-bar">Classes</h1>
22
22
  <div id="index-entries">
23
23
  <a href="classes/Mongrel.html">Mongrel</a><br />
24
+ <a href="classes/Mongrel/CGIWrapper.html">Mongrel::CGIWrapper</a><br />
25
+ <a href="classes/Mongrel/Command.html">Mongrel::Command</a><br />
26
+ <a href="classes/Mongrel/Command/Base.html">Mongrel::Command::Base</a><br />
27
+ <a href="classes/Mongrel/Command/Registry.html">Mongrel::Command::Registry</a><br />
24
28
  <a href="classes/Mongrel/Const.html">Mongrel::Const</a><br />
29
+ <a href="classes/Mongrel/DirHandler.html">Mongrel::DirHandler</a><br />
30
+ <a href="classes/Mongrel/Error404Handler.html">Mongrel::Error404Handler</a><br />
25
31
  <a href="classes/Mongrel/HeaderOut.html">Mongrel::HeaderOut</a><br />
32
+ <a href="classes/Mongrel/HttpHandler.html">Mongrel::HttpHandler</a><br />
26
33
  <a href="classes/Mongrel/HttpParser.html">Mongrel::HttpParser</a><br />
27
34
  <a href="classes/Mongrel/HttpRequest.html">Mongrel::HttpRequest</a><br />
28
35
  <a href="classes/Mongrel/HttpResponse.html">Mongrel::HttpResponse</a><br />
@@ -30,6 +37,7 @@
30
37
  <a href="classes/Mongrel/StopServer.html">Mongrel::StopServer</a><br />
31
38
  <a href="classes/Mongrel/TimeoutWorker.html">Mongrel::TimeoutWorker</a><br />
32
39
  <a href="classes/Mongrel/URIClassifier.html">Mongrel::URIClassifier</a><br />
40
+ <a href="classes/RailsHandler.html">RailsHandler</a><br />
33
41
  </div>
34
42
  </div>
35
43
  </body>
@@ -25,6 +25,11 @@
25
25
  <a href="files/README.html">README</a><br />
26
26
  <a href="files/ext/http11/http11_c.html">ext/http11/http11.c</a><br />
27
27
  <a href="files/lib/mongrel_rb.html">lib/mongrel.rb</a><br />
28
+ <a href="files/lib/mongrel/cgi_rb.html">lib/mongrel/cgi.rb</a><br />
29
+ <a href="files/lib/mongrel/command_rb.html">lib/mongrel/command.rb</a><br />
30
+ <a href="files/lib/mongrel/handlers_rb.html">lib/mongrel/handlers.rb</a><br />
31
+ <a href="files/lib/mongrel/plugins_rb.html">lib/mongrel/plugins.rb</a><br />
32
+ <a href="files/lib/mongrel/rails_rb.html">lib/mongrel/rails.rb</a><br />
28
33
  </div>
29
34
  </div>
30
35
  </body>
@@ -20,35 +20,68 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/Mongrel/HeaderOut.html#M000015">[]= (Mongrel::HeaderOut)</a><br />
24
- <a href="classes/Mongrel/HttpParser.html#M000005">error? (Mongrel::HttpParser)</a><br />
25
- <a href="classes/Mongrel/HttpParser.html#M000004">execute (Mongrel::HttpParser)</a><br />
26
- <a href="classes/Mongrel/HttpParser.html#M000003">finish (Mongrel::HttpParser)</a><br />
27
- <a href="classes/Mongrel/HttpResponse.html#M000022">finished (Mongrel::HttpResponse)</a><br />
28
- <a href="classes/Mongrel/HttpParser.html#M000006">finished? (Mongrel::HttpParser)</a><br />
29
- <a href="classes/Mongrel/URIClassifier.html#M000024">inspect (Mongrel::URIClassifier)</a><br />
30
- <a href="classes/Mongrel/HttpParser.html#M000001">new (Mongrel::HttpParser)</a><br />
31
- <a href="classes/Mongrel/HttpRequest.html#M000029">new (Mongrel::HttpRequest)</a><br />
32
- <a href="classes/Mongrel/URIClassifier.html#M000025">new (Mongrel::URIClassifier)</a><br />
33
- <a href="classes/Mongrel/HeaderOut.html#M000014">new (Mongrel::HeaderOut)</a><br />
34
- <a href="classes/Mongrel/HttpResponse.html#M000016">new (Mongrel::HttpResponse)</a><br />
35
- <a href="classes/Mongrel/HttpServer.html#M000008">new (Mongrel::HttpServer)</a><br />
36
- <a href="classes/Mongrel/HttpParser.html#M000007">nread (Mongrel::HttpParser)</a><br />
37
- <a href="classes/Mongrel/HttpServer.html#M000009">process_client (Mongrel::HttpServer)</a><br />
38
- <a href="classes/Mongrel/HttpServer.html#M000011">register (Mongrel::HttpServer)</a><br />
39
- <a href="classes/Mongrel/URIClassifier.html#M000026">register (Mongrel::URIClassifier)</a><br />
40
- <a href="classes/Mongrel/HttpParser.html#M000002">reset (Mongrel::HttpParser)</a><br />
41
- <a href="classes/Mongrel/HttpResponse.html#M000018">reset (Mongrel::HttpResponse)</a><br />
42
- <a href="classes/Mongrel/URIClassifier.html#M000028">resolve (Mongrel::URIClassifier)</a><br />
43
- <a href="classes/Mongrel/HttpServer.html#M000010">run (Mongrel::HttpServer)</a><br />
44
- <a href="classes/Mongrel/HttpResponse.html#M000021">send_body (Mongrel::HttpResponse)</a><br />
45
- <a href="classes/Mongrel/HttpResponse.html#M000020">send_header (Mongrel::HttpResponse)</a><br />
46
- <a href="classes/Mongrel/HttpResponse.html#M000019">send_status (Mongrel::HttpResponse)</a><br />
47
- <a href="classes/Mongrel/HttpResponse.html#M000017">start (Mongrel::HttpResponse)</a><br />
48
- <a href="classes/Mongrel/HttpServer.html#M000013">stop (Mongrel::HttpServer)</a><br />
49
- <a href="classes/Mongrel/URIClassifier.html#M000027">unregister (Mongrel::URIClassifier)</a><br />
50
- <a href="classes/Mongrel/HttpServer.html#M000012">unregister (Mongrel::HttpServer)</a><br />
51
- <a href="classes/Mongrel/URIClassifier.html#M000023">uris (Mongrel::URIClassifier)</a><br />
23
+ <a href="classes/Mongrel/HeaderOut.html#M000036">[]= (Mongrel::HeaderOut)</a><br />
24
+ <a href="classes/Mongrel/DirHandler.html#M000028">add_mime_type (Mongrel::DirHandler)</a><br />
25
+ <a href="classes/Mongrel/CGIWrapper.html#M000056">args (Mongrel::CGIWrapper)</a><br />
26
+ <a href="classes/Mongrel/DirHandler.html#M000024">can_serve (Mongrel::DirHandler)</a><br />
27
+ <a href="classes/Mongrel/Command/Registry.html#M000013">commands (Mongrel::Command::Registry)</a><br />
28
+ <a href="classes/Mongrel/CGIWrapper.html#M000057">env_table (Mongrel::CGIWrapper)</a><br />
29
+ <a href="classes/Mongrel/HttpParser.html#M000020">error? (Mongrel::HttpParser)</a><br />
30
+ <a href="classes/Mongrel/HttpParser.html#M000019">execute (Mongrel::HttpParser)</a><br />
31
+ <a href="classes/Mongrel/Command/Base.html#M000012">failure (Mongrel::Command::Base)</a><br />
32
+ <a href="classes/Mongrel/HttpParser.html#M000018">finish (Mongrel::HttpParser)</a><br />
33
+ <a href="classes/Mongrel/HttpResponse.html#M000044">finished (Mongrel::HttpResponse)</a><br />
34
+ <a href="classes/Mongrel/HttpParser.html#M000021">finished? (Mongrel::HttpParser)</a><br />
35
+ <a href="classes/Mongrel/CGIWrapper.html#M000052">header (Mongrel::CGIWrapper)</a><br />
36
+ <a href="classes/Mongrel/Command/Base.html#M000006">help (Mongrel::Command::Base)</a><br />
37
+ <a href="classes/Mongrel/URIClassifier.html#M000046">inspect (Mongrel::URIClassifier)</a><br />
38
+ <a href="classes/RailsHandler.html#M000001">new (RailsHandler)</a><br />
39
+ <a href="classes/Mongrel/HttpResponse.html#M000038">new (Mongrel::HttpResponse)</a><br />
40
+ <a href="classes/Mongrel/URIClassifier.html#M000047">new (Mongrel::URIClassifier)</a><br />
41
+ <a href="classes/Mongrel/CGIWrapper.html#M000051">new (Mongrel::CGIWrapper)</a><br />
42
+ <a href="classes/Mongrel/Command/Base.html#M000004">new (Mongrel::Command::Base)</a><br />
43
+ <a href="classes/Mongrel/Error404Handler.html#M000060">new (Mongrel::Error404Handler)</a><br />
44
+ <a href="classes/Mongrel/HeaderOut.html#M000035">new (Mongrel::HeaderOut)</a><br />
45
+ <a href="classes/Mongrel/DirHandler.html#M000023">new (Mongrel::DirHandler)</a><br />
46
+ <a href="classes/Mongrel/HttpRequest.html#M000062">new (Mongrel::HttpRequest)</a><br />
47
+ <a href="classes/Mongrel/HttpServer.html#M000029">new (Mongrel::HttpServer)</a><br />
48
+ <a href="classes/Mongrel/HttpParser.html#M000016">new (Mongrel::HttpParser)</a><br />
49
+ <a href="classes/Mongrel/HttpParser.html#M000022">nread (Mongrel::HttpParser)</a><br />
50
+ <a href="classes/Mongrel/Command/Base.html#M000003">options (Mongrel::Command::Base)</a><br />
51
+ <a href="classes/Mongrel/CGIWrapper.html#M000054">out (Mongrel::CGIWrapper)</a><br />
52
+ <a href="classes/Mongrel/Command/Registry.html#M000014">print_command_list (Mongrel::Command::Registry)</a><br />
53
+ <a href="classes/Mongrel/DirHandler.html#M000027">process (Mongrel::DirHandler)</a><br />
54
+ <a href="classes/Mongrel/Error404Handler.html#M000061">process (Mongrel::Error404Handler)</a><br />
55
+ <a href="classes/Mongrel/HttpHandler.html#M000037">process (Mongrel::HttpHandler)</a><br />
56
+ <a href="classes/RailsHandler.html#M000002">process (RailsHandler)</a><br />
57
+ <a href="classes/Mongrel/HttpServer.html#M000030">process_client (Mongrel::HttpServer)</a><br />
58
+ <a href="classes/Mongrel/HttpServer.html#M000032">register (Mongrel::HttpServer)</a><br />
59
+ <a href="classes/Mongrel/URIClassifier.html#M000048">register (Mongrel::URIClassifier)</a><br />
60
+ <a href="classes/Mongrel/HttpParser.html#M000017">reset (Mongrel::HttpParser)</a><br />
61
+ <a href="classes/Mongrel/HttpResponse.html#M000040">reset (Mongrel::HttpResponse)</a><br />
62
+ <a href="classes/Mongrel/URIClassifier.html#M000050">resolve (Mongrel::URIClassifier)</a><br />
63
+ <a href="classes/Mongrel/Command/Registry.html#M000015">run (Mongrel::Command::Registry)</a><br />
64
+ <a href="classes/Mongrel/Command/Base.html#M000007">run (Mongrel::Command::Base)</a><br />
65
+ <a href="classes/Mongrel/HttpServer.html#M000031">run (Mongrel::HttpServer)</a><br />
66
+ <a href="classes/Mongrel/HttpResponse.html#M000043">send_body (Mongrel::HttpResponse)</a><br />
67
+ <a href="classes/Mongrel/CGIWrapper.html#M000053">send_cookies (Mongrel::CGIWrapper)</a><br />
68
+ <a href="classes/Mongrel/DirHandler.html#M000025">send_dir_listing (Mongrel::DirHandler)</a><br />
69
+ <a href="classes/Mongrel/DirHandler.html#M000026">send_file (Mongrel::DirHandler)</a><br />
70
+ <a href="classes/Mongrel/HttpResponse.html#M000042">send_header (Mongrel::HttpResponse)</a><br />
71
+ <a href="classes/Mongrel/HttpResponse.html#M000041">send_status (Mongrel::HttpResponse)</a><br />
72
+ <a href="classes/Mongrel/HttpResponse.html#M000039">start (Mongrel::HttpResponse)</a><br />
73
+ <a href="classes/Mongrel/CGIWrapper.html#M000055">status (Mongrel::CGIWrapper)</a><br />
74
+ <a href="classes/Mongrel/CGIWrapper.html#M000058">stdinput (Mongrel::CGIWrapper)</a><br />
75
+ <a href="classes/Mongrel/CGIWrapper.html#M000059">stdoutput (Mongrel::CGIWrapper)</a><br />
76
+ <a href="classes/Mongrel/HttpServer.html#M000034">stop (Mongrel::HttpServer)</a><br />
77
+ <a href="classes/Mongrel/HttpServer.html#M000033">unregister (Mongrel::HttpServer)</a><br />
78
+ <a href="classes/Mongrel/URIClassifier.html#M000049">unregister (Mongrel::URIClassifier)</a><br />
79
+ <a href="classes/Mongrel/URIClassifier.html#M000045">uris (Mongrel::URIClassifier)</a><br />
80
+ <a href="classes/Mongrel/Command/Base.html#M000008">valid? (Mongrel::Command::Base)</a><br />
81
+ <a href="classes/Mongrel/Command/Base.html#M000011">valid_dir? (Mongrel::Command::Base)</a><br />
82
+ <a href="classes/Mongrel/Command/Base.html#M000009">valid_exists? (Mongrel::Command::Base)</a><br />
83
+ <a href="classes/Mongrel/Command/Base.html#M000010">valid_file? (Mongrel::Command::Base)</a><br />
84
+ <a href="classes/Mongrel/Command/Base.html#M000005">validate (Mongrel::Command::Base)</a><br />
52
85
  </div>
53
86
  </div>
54
87
  </body>
@@ -32,7 +32,7 @@ module Mongrel
32
32
  # Called by the subclass to setup the command and parse the argv arguments.
33
33
  # The call is destructive on argv since it uses the OptionParser#parse! function.
34
34
  def initialize(options={})
35
- argv = options[:argv]
35
+ argv = options[:argv] || []
36
36
  @opt = OptionParser.new
37
37
  @valid = true
38
38
  # this is retarded, but it has to be done this way because -h and -v exit
@@ -55,7 +55,7 @@ module Mongrel
55
55
  end
56
56
  end
57
57
 
58
- @opt.parse! options[:argv]
58
+ @opt.parse! argv
59
59
  end
60
60
 
61
61
  # Returns true/false depending on whether the command is configured properly.
@@ -113,8 +113,8 @@ module Mongrel
113
113
 
114
114
  # Builds a list of possible commands from the Command derivates list
115
115
  def commands
116
- pmgr = PluginManager.instance
117
- list = pmgr.available["/commands"]
116
+ pmgr = GemPlugin::Manager.instance
117
+ list = pmgr.available["/commands"].keys
118
118
  return list.sort
119
119
  end
120
120
 
@@ -144,7 +144,7 @@ module Mongrel
144
144
 
145
145
  # command exists, set it up and validate it
146
146
  begin
147
- command = PluginManager.instance.create("/commands/#{cmd_name}", :argv => args)
147
+ command = GemPlugin::Manager.instance.create("/commands/#{cmd_name}", :argv => args)
148
148
  rescue
149
149
  STDERR.puts "INVALID COMMAND: #$!"
150
150
  print_command_list
@@ -1,156 +1,7 @@
1
- require 'singleton'
2
-
3
- module Mongrel
4
-
5
- # Implements the main method of managing plugins for Mongrel.
6
- # "Plugins" in this sense are any classes which get registered
7
- # with Mongrel for possible use when it's operating. These can
8
- # be Handlers, Commands, or other classes. When you create a
9
- # Plugin you register it into a URI-like namespace that makes
10
- # it easy for you (and others) to reference it later during
11
- # configuration.
12
- #
13
- # PluginManager is used as nothing more than a holder of all the
14
- # plugins that have registered themselves. Let's say you have:
15
- #
16
- # class StopNow < Plugin "/commands"
17
- # ...
18
- # end
19
- #
20
- # Then you can get at this plugin with:
21
- #
22
- # cmd = PluginManager.create("/commands/stopnow")
23
- #
24
- # The funky syntax for StopNow is a weird trick borrowed from
25
- # the Camping framework. See the Mongrel::Plugin *function* (yes,
26
- # function). What this basically does is register it
27
- # into the namespace for plugins at /commands. You could go
28
- # as arbitrarily nested as you like.
29
- #
30
- # Why this strange almost second namespace? Why not just use
31
- # the ObjectSpace and/or Modules? The main reason is speed and
32
- # to avoid cluttering the Ruby namespace with what is really a
33
- # configuration statement. This lets implementors put code
34
- # into the Ruby structuring they need, and still have Plugins
35
- # available to Mongrel via simple URI-like names.
36
- #
37
- # The alternative (as pluginfactory does it) is to troll through
38
- # ObjectSpace looking for stuff that *might* be plugins every time
39
- # one is needed. This alternative also means that you are stuck
40
- # naming your commands in specific ways and putting them in specific
41
- # modules in order to configure how Mongrel should use them.
42
- #
43
- # One downside to this is that you need to subclass plugin to
44
- # make it work. In this case use mixins to add other functionality.
45
- class PluginManager
46
- include Singleton
47
-
48
- def initialize
49
- @plugins = URIClassifier.new
50
- end
51
-
52
- # Tell the PluginManager to scan the given path (recursively)
53
- # and load the *.rb files found there. This is how you'd
54
- # setup your own plugin directory.
55
- def load(path)
56
- Dir.chdir(path) do
57
- Dir["**/*.rb"].each do |rbfile|
58
- STDERR.puts "Loading plugins from #{rbfile}"
59
- require rbfile
60
- end
61
- end
62
- end
63
-
64
- # Not necessary for you to call directly, but this is
65
- # how Mongrel::PluginBase.inherited actually adds a
66
- # plugin to a category.
67
- def register(category, name, klass)
68
- cat, ignored, map = @plugins.resolve(category)
69
-
70
- if not cat or ignored.length > 0
71
- map = {name => klass}
72
- @plugins.register(category, map)
73
- elsif not map
74
- raise "Unknown category #{category}"
75
- else
76
- map[name] = klass
77
- end
78
- end
79
-
80
- # Resolves the given name (should include /category/name) to
81
- # find the plugin class and create an instance. It uses
82
- # the same URIClassifier that the rest of Mongrel does so it
83
- # is fast.
84
- def create(name, options = {})
85
- category, plugin, map = @plugins.resolve(name)
86
-
87
- if category and plugin and plugin.length > 0
88
- map[plugin].new(options)
89
- else
90
- raise "Plugin #{name} does not exist"
91
- end
92
- end
93
-
94
- # Returns a map of URIs->[handlers] that you can
95
- # use to investigate available handlers.
96
- def available
97
- map = {}
98
- @plugins.uris.each do |u|
99
- cat, name, plugins = @plugins.resolve(u)
100
- map[cat] ||= []
101
- map[cat] += plugins.keys
102
- end
103
-
104
- return map
105
- end
106
-
107
- end
108
-
109
- # This base class for plugins reallys does nothing
110
- # more than wire up the new class into the right category.
111
- # It is not thread-safe yet but will be soon.
112
- class PluginBase
113
-
114
- attr_reader :options
115
-
116
-
117
- # See Mongrel::Plugin for an explanation.
118
- def PluginBase.inherited(klass)
119
- name = "/" + klass.to_s.downcase
120
- PluginManager.instance.register(@@category, name, klass)
121
- @@category = nil
122
- end
123
-
124
- # See Mongrel::Plugin for an explanation.
125
- def PluginBase.category=(category)
126
- @@category = category
127
- end
128
-
129
- def initialize(options = {})
130
- @options = options
131
- end
132
-
133
- end
134
-
135
- # This nifty function works with the PluginBase to give you
136
- # the syntax:
137
- #
138
- # class MyThing < Plugin "/things"
139
- # ...
140
- # end
141
- #
142
- # What it does is temporarily sets the PluginBase.category, and then
143
- # returns PluginBase. Since the next immediate thing Ruby does is
144
- # use this returned class to create the new class, PluginBase.inherited
145
- # gets called. PluginBase.inherited then uses the set category, class name,
146
- # and class to register the plugin in the right way.
147
- def Mongrel::Plugin(c)
148
- PluginBase.category = c
149
- PluginBase
150
- end
151
-
152
- end
1
+ require 'rubygems'
2
+ require_gem 'mongrel_plugin'
153
3
 
4
+ # file is just a stub that makes sure the mongrel_plugins gem is loaded and ready
154
5
 
155
6
 
156
7