mongrel 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/Rakefile +38 -15
  2. data/bin/mongrel_rails +13 -11
  3. data/doc/rdoc/classes/Mongrel.html +6 -1
  4. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +49 -49
  5. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000057.html +11 -5
  6. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000058.html +34 -5
  7. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000059.html +21 -6
  8. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000054.html → M000060.html} +0 -0
  9. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000055.html → M000061.html} +0 -0
  10. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000056.html → M000062.html} +0 -0
  11. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000063.html +18 -0
  12. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000064.html +18 -0
  13. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000065.html +19 -0
  14. data/doc/rdoc/classes/Mongrel/Camping.html +177 -0
  15. data/doc/rdoc/classes/Mongrel/Camping.src/M000019.html +22 -0
  16. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +165 -0
  17. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000020.html +18 -0
  18. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000021.html +27 -0
  19. data/doc/rdoc/classes/Mongrel/Command/Base.html +50 -50
  20. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000006.html +11 -5
  21. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000007.html +28 -5
  22. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000008.html +5 -9
  23. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000009.html +5 -5
  24. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000010.html +5 -5
  25. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000011.html +9 -5
  26. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000012.html +5 -5
  27. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000013.html +18 -0
  28. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000014.html +18 -0
  29. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000015.html +18 -0
  30. data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
  31. data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000013.html → M000016.html} +6 -6
  32. data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000014.html → M000017.html} +11 -11
  33. data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000015.html → M000018.html} +32 -32
  34. data/doc/rdoc/classes/Mongrel/Const.html +3 -3
  35. data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
  36. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000023.html → M000029.html} +0 -0
  37. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000024.html → M000030.html} +0 -0
  38. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000025.html → M000031.html} +0 -0
  39. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000026.html → M000032.html} +0 -0
  40. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000027.html → M000033.html} +0 -0
  41. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000028.html → M000034.html} +0 -0
  42. data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
  43. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000060.html → M000066.html} +0 -0
  44. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000061.html → M000067.html} +0 -0
  45. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  46. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000035.html → M000041.html} +4 -4
  47. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000036.html → M000042.html} +7 -7
  48. data/doc/rdoc/classes/Mongrel/HttpHandler.html +5 -5
  49. data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000037.html → M000043.html} +0 -0
  50. data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
  51. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000022.html +6 -6
  52. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000017.html → M000023.html} +0 -0
  53. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000018.html → M000024.html} +0 -0
  54. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000019.html → M000025.html} +0 -0
  55. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000020.html → M000026.html} +0 -0
  56. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000021.html → M000027.html} +0 -0
  57. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000016.html → M000028.html} +6 -6
  58. data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
  59. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000062.html → M000068.html} +24 -24
  60. data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
  61. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000044.html +8 -7
  62. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000039.html → M000045.html} +6 -6
  63. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000040.html → M000046.html} +5 -5
  64. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000041.html → M000047.html} +5 -5
  65. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000042.html → M000048.html} +6 -6
  66. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000043.html → M000049.html} +6 -6
  67. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000050.html +20 -0
  68. data/doc/rdoc/classes/Mongrel/HttpServer.html +33 -33
  69. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000029.html → M000035.html} +22 -22
  70. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000030.html → M000036.html} +43 -43
  71. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000031.html → M000037.html} +34 -34
  72. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000032.html → M000038.html} +4 -4
  73. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000033.html → M000039.html} +4 -4
  74. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000034.html → M000040.html} +9 -9
  75. data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
  76. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000045.html → M000051.html} +4 -4
  77. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000046.html → M000052.html} +4 -4
  78. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000047.html → M000053.html} +0 -0
  79. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000048.html → M000054.html} +0 -0
  80. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000049.html → M000055.html} +0 -0
  81. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000050.html → M000056.html} +0 -0
  82. data/doc/rdoc/classes/RailsHandler.html +30 -10
  83. data/doc/rdoc/classes/RailsHandler.src/{M000001.html → M000003.html} +8 -8
  84. data/doc/rdoc/classes/RailsHandler.src/{M000002.html → M000004.html} +34 -34
  85. data/doc/rdoc/classes/RailsHandler.src/M000005.html +23 -0
  86. data/doc/rdoc/classes/TCPServer.html +173 -0
  87. data/doc/rdoc/classes/TCPServer.src/M000001.html +19 -0
  88. data/doc/rdoc/created.rid +1 -1
  89. data/doc/rdoc/files/lib/mongrel/camping_rb.html +108 -0
  90. data/doc/rdoc/files/lib/mongrel/command_rb.html +3 -2
  91. data/doc/rdoc/files/lib/mongrel/{plugins_rb.html → init_rb.html} +5 -4
  92. data/doc/rdoc/files/lib/mongrel/rails_rb.html +2 -1
  93. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +109 -0
  94. data/doc/rdoc/files/lib/mongrel_rb.html +2 -2
  95. data/doc/rdoc/fr_class_index.html +3 -0
  96. data/doc/rdoc/fr_file_index.html +3 -1
  97. data/doc/rdoc/fr_method_index.html +68 -62
  98. data/examples/camping/blog.rb +22 -37
  99. data/examples/camping/tepee.rb +3 -23
  100. data/lib/mongrel.rb +3 -4
  101. data/lib/mongrel/camping.rb +64 -0
  102. data/lib/mongrel/command.rb +3 -2
  103. data/lib/mongrel/{plugins.rb → init.rb} +1 -1
  104. data/lib/mongrel/rails.rb +16 -6
  105. data/lib/mongrel/tcphack.rb +12 -0
  106. data/tools/rakehelp.rb +10 -12
  107. metadata +74 -58
  108. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000051.html +0 -24
  109. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000052.html +0 -47
  110. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000053.html +0 -34
  111. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000003.html +0 -24
  112. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000004.html +0 -41
  113. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000005.html +0 -18
  114. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000038.html +0 -21
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>failure (Mongrel::Command::Base)</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/command.rb, line 105</span>
14
+ 105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failure</span>(<span class="ruby-identifier">message</span>)
15
+ 106: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;!!! #{message}&quot;</span>
16
+ 107: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -93,9 +93,9 @@ running them.
93
93
  <h3 class="section-bar">Methods</h3>
94
94
 
95
95
  <div class="name-list">
96
- <a href="#M000013">commands</a>&nbsp;&nbsp;
97
- <a href="#M000014">print_command_list</a>&nbsp;&nbsp;
98
- <a href="#M000015">run</a>&nbsp;&nbsp;
96
+ <a href="#M000016">commands</a>&nbsp;&nbsp;
97
+ <a href="#M000017">print_command_list</a>&nbsp;&nbsp;
98
+ <a href="#M000018">run</a>&nbsp;&nbsp;
99
99
  </div>
100
100
  </div>
101
101
 
@@ -124,12 +124,12 @@ running them.
124
124
  <div id="methods">
125
125
  <h3 class="section-bar">Public Instance methods</h3>
126
126
 
127
- <div id="method-M000013" class="method-detail">
128
- <a name="M000013"></a>
127
+ <div id="method-M000016" class="method-detail">
128
+ <a name="M000016"></a>
129
129
 
130
130
  <div class="method-heading">
131
- <a href="Registry.src/M000013.html" target="Code" class="method-signature"
132
- onclick="popupCode('Registry.src/M000013.html');return false;">
131
+ <a href="Registry.src/M000016.html" target="Code" class="method-signature"
132
+ onclick="popupCode('Registry.src/M000016.html');return false;">
133
133
  <span class="method-name">commands</span><span class="method-args">()</span>
134
134
  </a>
135
135
  </div>
@@ -142,12 +142,12 @@ href="../Command.html">Command</a> derivates list
142
142
  </div>
143
143
  </div>
144
144
 
145
- <div id="method-M000014" class="method-detail">
146
- <a name="M000014"></a>
145
+ <div id="method-M000017" class="method-detail">
146
+ <a name="M000017"></a>
147
147
 
148
148
  <div class="method-heading">
149
- <a href="Registry.src/M000014.html" target="Code" class="method-signature"
150
- onclick="popupCode('Registry.src/M000014.html');return false;">
149
+ <a href="Registry.src/M000017.html" target="Code" class="method-signature"
150
+ onclick="popupCode('Registry.src/M000017.html');return false;">
151
151
  <span class="method-name">print_command_list</span><span class="method-args">()</span>
152
152
  </a>
153
153
  </div>
@@ -159,12 +159,12 @@ Prints a list of available commands.
159
159
  </div>
160
160
  </div>
161
161
 
162
- <div id="method-M000015" class="method-detail">
163
- <a name="M000015"></a>
162
+ <div id="method-M000018" class="method-detail">
163
+ <a name="M000018"></a>
164
164
 
165
165
  <div class="method-heading">
166
- <a href="Registry.src/M000015.html" target="Code" class="method-signature"
167
- onclick="popupCode('Registry.src/M000015.html');return false;">
166
+ <a href="Registry.src/M000018.html" target="Code" class="method-signature"
167
+ onclick="popupCode('Registry.src/M000018.html');return false;">
168
168
  <span class="method-name">run</span><span class="method-args">(args)</span>
169
169
  </a>
170
170
  </div>
@@ -10,11 +10,11 @@
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/command.rb, line 115</span>
14
- 115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">commands</span>
15
- 116: <span class="ruby-identifier">pmgr</span> = <span class="ruby-constant">GemPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Manager</span>.<span class="ruby-identifier">instance</span>
16
- 117: <span class="ruby-identifier">list</span> = <span class="ruby-identifier">pmgr</span>.<span class="ruby-identifier">available</span>[<span class="ruby-value str">&quot;/commands&quot;</span>].<span class="ruby-identifier">keys</span>
17
- 118: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">sort</span>
18
- 119: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel/command.rb, line 116</span>
14
+ 116: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">commands</span>
15
+ 117: <span class="ruby-identifier">pmgr</span> = <span class="ruby-constant">GemPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Manager</span>.<span class="ruby-identifier">instance</span>
16
+ 118: <span class="ruby-identifier">list</span> = <span class="ruby-identifier">pmgr</span>.<span class="ruby-identifier">plugins</span>[<span class="ruby-value str">&quot;/commands&quot;</span>].<span class="ruby-identifier">keys</span>
17
+ 119: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">sort</span>
18
+ 120: <span class="ruby-keyword kw">end</span></pre>
19
19
  </body>
20
20
  </html>
@@ -10,16 +10,16 @@
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/command.rb, line 122</span>
14
- 122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_command_list</span>
15
- 123: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Available commands are:\n\n&quot;</span>
16
- 124:
17
- 125: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
18
- 126: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; - #{name[1 .. -1]}\n&quot;</span>
19
- 127: <span class="ruby-keyword kw">end</span>
20
- 128:
21
- 129: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\nEach command takes -h as an option to get help.&quot;</span>
22
- 130:
23
- 131: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel/command.rb, line 123</span>
14
+ 123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_command_list</span>
15
+ 124: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Available commands are:\n\n&quot;</span>
16
+ 125:
17
+ 126: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
18
+ 127: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; - #{name[1 .. -1]}\n&quot;</span>
19
+ 128: <span class="ruby-keyword kw">end</span>
20
+ 129:
21
+ 130: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\nEach command takes -h as an option to get help.&quot;</span>
22
+ 131:
23
+ 132: <span class="ruby-keyword kw">end</span></pre>
24
24
  </body>
25
25
  </html>
@@ -10,37 +10,37 @@
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/command.rb, line 136</span>
14
- 136: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">args</span>)
15
- 137: <span class="ruby-comment cmt"># find the command</span>
16
- 138: <span class="ruby-identifier">cmd_name</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
17
- 139:
18
- 140: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cmd_name</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">cmd_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;?&quot;</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">cmd_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;help&quot;</span>
19
- 141: <span class="ruby-identifier">print_command_list</span>
20
- 142: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
21
- 143: <span class="ruby-keyword kw">end</span>
22
- 144:
23
- 145: <span class="ruby-comment cmt"># command exists, set it up and validate it</span>
24
- 146: <span class="ruby-keyword kw">begin</span>
25
- 147: <span class="ruby-identifier">command</span> = <span class="ruby-constant">GemPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Manager</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">create</span>(<span class="ruby-node">&quot;/commands/#{cmd_name}&quot;</span>, <span class="ruby-identifier">:argv</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>)
26
- 148: <span class="ruby-keyword kw">rescue</span>
27
- 149: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;INVALID COMMAND: #$!&quot;</span>
28
- 150: <span class="ruby-identifier">print_command_list</span>
29
- 151: <span class="ruby-keyword kw">return</span>
30
- 152: <span class="ruby-keyword kw">end</span>
31
- 153:
32
- 154: <span class="ruby-comment cmt"># Normally the command is NOT valid right after being created</span>
33
- 155: <span class="ruby-comment cmt"># but sometimes (like with -h or -v) there's no further processing</span>
34
- 156: <span class="ruby-comment cmt"># needed so the command is already valid so we can skip it.</span>
35
- 157: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">done_validating</span>
36
- 158: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">validate</span>
37
- 159: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{cmd_name} reported an error. Use -h to get help.&quot;</span>
38
- 160: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
39
- 161: <span class="ruby-keyword kw">else</span>
40
- 162: <span class="ruby-identifier">command</span>.<span class="ruby-identifier">run</span>
41
- 163: <span class="ruby-keyword kw">end</span>
42
- 164: <span class="ruby-keyword kw">end</span>
43
- 165: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
44
- 166: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel/command.rb, line 137</span>
14
+ 137: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">args</span>)
15
+ 138: <span class="ruby-comment cmt"># find the command</span>
16
+ 139: <span class="ruby-identifier">cmd_name</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
17
+ 140:
18
+ 141: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cmd_name</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">cmd_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;?&quot;</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">cmd_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;help&quot;</span>
19
+ 142: <span class="ruby-identifier">print_command_list</span>
20
+ 143: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
21
+ 144: <span class="ruby-keyword kw">end</span>
22
+ 145:
23
+ 146: <span class="ruby-comment cmt"># command exists, set it up and validate it</span>
24
+ 147: <span class="ruby-keyword kw">begin</span>
25
+ 148: <span class="ruby-identifier">command</span> = <span class="ruby-constant">GemPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Manager</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">create</span>(<span class="ruby-node">&quot;/commands/#{cmd_name}&quot;</span>, <span class="ruby-identifier">:argv</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>)
26
+ 149: <span class="ruby-keyword kw">rescue</span>
27
+ 150: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;INVALID COMMAND: #$!&quot;</span>
28
+ 151: <span class="ruby-identifier">print_command_list</span>
29
+ 152: <span class="ruby-keyword kw">return</span>
30
+ 153: <span class="ruby-keyword kw">end</span>
31
+ 154:
32
+ 155: <span class="ruby-comment cmt"># Normally the command is NOT valid right after being created</span>
33
+ 156: <span class="ruby-comment cmt"># but sometimes (like with -h or -v) there's no further processing</span>
34
+ 157: <span class="ruby-comment cmt"># needed so the command is already valid so we can skip it.</span>
35
+ 158: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">done_validating</span>
36
+ 159: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">validate</span>
37
+ 160: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{cmd_name} reported an error. Use -h to get help.&quot;</span>
38
+ 161: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
39
+ 162: <span class="ruby-keyword kw">else</span>
40
+ 163: <span class="ruby-identifier">command</span>.<span class="ruby-identifier">run</span>
41
+ 164: <span class="ruby-keyword kw">end</span>
42
+ 165: <span class="ruby-keyword kw">end</span>
43
+ 166: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
44
+ 167: <span class="ruby-keyword kw">end</span></pre>
45
45
  </body>
46
46
  </html>
@@ -230,7 +230,7 @@ DNS resolves. It is only here for completeness for the CGI standard.
230
230
  <td width="3em">&nbsp;</td>
231
231
  <td class="context-item-desc">
232
232
  The name/host of our server as given by the <a
233
- href="HttpServer.html#M000029">HttpServer.new</a>(host,port) call.
233
+ href="HttpServer.html#M000035">HttpServer.new</a>(host,port) call.
234
234
 
235
235
  </td>
236
236
  </tr>
@@ -241,7 +241,7 @@ href="HttpServer.html#M000029">HttpServer.new</a>(host,port) call.
241
241
  <td width="3em">&nbsp;</td>
242
242
  <td class="context-item-desc">
243
243
  The port of our server as given by the <a
244
- href="HttpServer.html#M000029">HttpServer.new</a>(host,port) call.
244
+ href="HttpServer.html#M000035">HttpServer.new</a>(host,port) call.
245
245
 
246
246
  </td>
247
247
  </tr>
@@ -290,7 +290,7 @@ href="../Mongrel.html">Mongrel</a> man).
290
290
  <tr class="top-aligned-row context-row">
291
291
  <td class="context-item-name">MONGREL_VERSION</td>
292
292
  <td>=</td>
293
- <td class="context-item-value">'Mongrel 0.3.8'</td>
293
+ <td class="context-item-value">'Mongrel 0.3.10'</td>
294
294
  <td width="3em">&nbsp;</td>
295
295
  <td class="context-item-desc">
296
296
  Current <a href="../Mongrel.html">Mongrel</a> version (used for
@@ -103,12 +103,12 @@ than it simply gives a 404.
103
103
  <h3 class="section-bar">Methods</h3>
104
104
 
105
105
  <div class="name-list">
106
- <a href="#M000028">add_mime_type</a>&nbsp;&nbsp;
107
- <a href="#M000024">can_serve</a>&nbsp;&nbsp;
108
- <a href="#M000023">new</a>&nbsp;&nbsp;
109
- <a href="#M000027">process</a>&nbsp;&nbsp;
110
- <a href="#M000025">send_dir_listing</a>&nbsp;&nbsp;
111
- <a href="#M000026">send_file</a>&nbsp;&nbsp;
106
+ <a href="#M000034">add_mime_type</a>&nbsp;&nbsp;
107
+ <a href="#M000030">can_serve</a>&nbsp;&nbsp;
108
+ <a href="#M000029">new</a>&nbsp;&nbsp;
109
+ <a href="#M000033">process</a>&nbsp;&nbsp;
110
+ <a href="#M000031">send_dir_listing</a>&nbsp;&nbsp;
111
+ <a href="#M000032">send_file</a>&nbsp;&nbsp;
112
112
  </div>
113
113
  </div>
114
114
 
@@ -156,12 +156,12 @@ than it simply gives a 404.
156
156
  <div id="methods">
157
157
  <h3 class="section-bar">Public Class methods</h3>
158
158
 
159
- <div id="method-M000028" class="method-detail">
160
- <a name="M000028"></a>
159
+ <div id="method-M000034" class="method-detail">
160
+ <a name="M000034"></a>
161
161
 
162
162
  <div class="method-heading">
163
- <a href="DirHandler.src/M000028.html" target="Code" class="method-signature"
164
- onclick="popupCode('DirHandler.src/M000028.html');return false;">
163
+ <a href="DirHandler.src/M000034.html" target="Code" class="method-signature"
164
+ onclick="popupCode('DirHandler.src/M000034.html');return false;">
165
165
  <span class="method-name">add_mime_type</span><span class="method-args">(extension, type)</span>
166
166
  </a>
167
167
  </div>
@@ -174,12 +174,12 @@ you add any others you&#8217;ll need when serving content.
174
174
  </div>
175
175
  </div>
176
176
 
177
- <div id="method-M000023" class="method-detail">
178
- <a name="M000023"></a>
177
+ <div id="method-M000029" class="method-detail">
178
+ <a name="M000029"></a>
179
179
 
180
180
  <div class="method-heading">
181
- <a href="DirHandler.src/M000023.html" target="Code" class="method-signature"
182
- onclick="popupCode('DirHandler.src/M000023.html');return false;">
181
+ <a href="DirHandler.src/M000029.html" target="Code" class="method-signature"
182
+ onclick="popupCode('DirHandler.src/M000029.html');return false;">
183
183
  <span class="method-name">new</span><span class="method-args">(path, listing_allowed=true, index_html=&quot;index.html&quot;)</span>
184
184
  </a>
185
185
  </div>
@@ -193,12 +193,12 @@ You give it the path to the directory root and an (optional)
193
193
 
194
194
  <h3 class="section-bar">Public Instance methods</h3>
195
195
 
196
- <div id="method-M000024" class="method-detail">
197
- <a name="M000024"></a>
196
+ <div id="method-M000030" class="method-detail">
197
+ <a name="M000030"></a>
198
198
 
199
199
  <div class="method-heading">
200
- <a href="DirHandler.src/M000024.html" target="Code" class="method-signature"
201
- onclick="popupCode('DirHandler.src/M000024.html');return false;">
200
+ <a href="DirHandler.src/M000030.html" target="Code" class="method-signature"
201
+ onclick="popupCode('DirHandler.src/M000030.html');return false;">
202
202
  <span class="method-name">can_serve</span><span class="method-args">(path_info)</span>
203
203
  </a>
204
204
  </div>
@@ -211,12 +211,12 @@ not).
211
211
  </div>
212
212
  </div>
213
213
 
214
- <div id="method-M000027" class="method-detail">
215
- <a name="M000027"></a>
214
+ <div id="method-M000033" class="method-detail">
215
+ <a name="M000033"></a>
216
216
 
217
217
  <div class="method-heading">
218
- <a href="DirHandler.src/M000027.html" target="Code" class="method-signature"
219
- onclick="popupCode('DirHandler.src/M000027.html');return false;">
218
+ <a href="DirHandler.src/M000033.html" target="Code" class="method-signature"
219
+ onclick="popupCode('DirHandler.src/M000033.html');return false;">
220
220
  <span class="method-name">process</span><span class="method-args">(request, response)</span>
221
221
  </a>
222
222
  </div>
@@ -229,12 +229,12 @@ allowed (based on the listing_allowed paramter to the constructor).
229
229
  </div>
230
230
  </div>
231
231
 
232
- <div id="method-M000025" class="method-detail">
233
- <a name="M000025"></a>
232
+ <div id="method-M000031" class="method-detail">
233
+ <a name="M000031"></a>
234
234
 
235
235
  <div class="method-heading">
236
- <a href="DirHandler.src/M000025.html" target="Code" class="method-signature"
237
- onclick="popupCode('DirHandler.src/M000025.html');return false;">
236
+ <a href="DirHandler.src/M000031.html" target="Code" class="method-signature"
237
+ onclick="popupCode('DirHandler.src/M000031.html');return false;">
238
238
  <span class="method-name">send_dir_listing</span><span class="method-args">(base, dir, response)</span>
239
239
  </a>
240
240
  </div>
@@ -244,18 +244,18 @@ allowed (based on the listing_allowed paramter to the constructor).
244
244
  Returns a simplistic directory listing if they&#8217;re enabled, otherwise
245
245
  a 403. Base is the base URI from the REQUEST_URI, dir is the directory to
246
246
  serve on the file system (comes from <a
247
- href="DirHandler.html#M000024">can_serve</a>()), and response is the <a
247
+ href="DirHandler.html#M000030">can_serve</a>()), and response is the <a
248
248
  href="HttpResponse.html">HttpResponse</a> object to send the results on.
249
249
  </p>
250
250
  </div>
251
251
  </div>
252
252
 
253
- <div id="method-M000026" class="method-detail">
254
- <a name="M000026"></a>
253
+ <div id="method-M000032" class="method-detail">
254
+ <a name="M000032"></a>
255
255
 
256
256
  <div class="method-heading">
257
- <a href="DirHandler.src/M000026.html" target="Code" class="method-signature"
258
- onclick="popupCode('DirHandler.src/M000026.html');return false;">
257
+ <a href="DirHandler.src/M000032.html" target="Code" class="method-signature"
258
+ onclick="popupCode('DirHandler.src/M000032.html');return false;">
259
259
  <span class="method-name">send_file</span><span class="method-args">(req, response)</span>
260
260
  </a>
261
261
  </div>
@@ -96,8 +96,8 @@ with a custom message for special URIs.
96
96
  <h3 class="section-bar">Methods</h3>
97
97
 
98
98
  <div class="name-list">
99
- <a href="#M000060">new</a>&nbsp;&nbsp;
100
- <a href="#M000061">process</a>&nbsp;&nbsp;
99
+ <a href="#M000066">new</a>&nbsp;&nbsp;
100
+ <a href="#M000067">process</a>&nbsp;&nbsp;
101
101
  </div>
102
102
  </div>
103
103
 
@@ -119,12 +119,12 @@ with a custom message for special URIs.
119
119
  <div id="methods">
120
120
  <h3 class="section-bar">Public Class methods</h3>
121
121
 
122
- <div id="method-M000060" class="method-detail">
123
- <a name="M000060"></a>
122
+ <div id="method-M000066" class="method-detail">
123
+ <a name="M000066"></a>
124
124
 
125
125
  <div class="method-heading">
126
- <a href="Error404Handler.src/M000060.html" target="Code" class="method-signature"
127
- onclick="popupCode('Error404Handler.src/M000060.html');return false;">
126
+ <a href="Error404Handler.src/M000066.html" target="Code" class="method-signature"
127
+ onclick="popupCode('Error404Handler.src/M000066.html');return false;">
128
128
  <span class="method-name">new</span><span class="method-args">(msg)</span>
129
129
  </a>
130
130
  </div>
@@ -139,12 +139,12 @@ it&#8217;s pretty efficient.
139
139
 
140
140
  <h3 class="section-bar">Public Instance methods</h3>
141
141
 
142
- <div id="method-M000061" class="method-detail">
143
- <a name="M000061"></a>
142
+ <div id="method-M000067" class="method-detail">
143
+ <a name="M000067"></a>
144
144
 
145
145
  <div class="method-heading">
146
- <a href="Error404Handler.src/M000061.html" target="Code" class="method-signature"
147
- onclick="popupCode('Error404Handler.src/M000061.html');return false;">
146
+ <a href="Error404Handler.src/M000067.html" target="Code" class="method-signature"
147
+ onclick="popupCode('Error404Handler.src/M000067.html');return false;">
148
148
  <span class="method-name">process</span><span class="method-args">(request, response)</span>
149
149
  </a>
150
150
  </div>
@@ -101,8 +101,8 @@ there.
101
101
  <h3 class="section-bar">Methods</h3>
102
102
 
103
103
  <div class="name-list">
104
- <a href="#M000036">[]=</a>&nbsp;&nbsp;
105
- <a href="#M000035">new</a>&nbsp;&nbsp;
104
+ <a href="#M000042">[]=</a>&nbsp;&nbsp;
105
+ <a href="#M000041">new</a>&nbsp;&nbsp;
106
106
  </div>
107
107
  </div>
108
108
 
@@ -137,12 +137,12 @@ there.
137
137
  <div id="methods">
138
138
  <h3 class="section-bar">Public Class methods</h3>
139
139
 
140
- <div id="method-M000035" class="method-detail">
141
- <a name="M000035"></a>
140
+ <div id="method-M000041" class="method-detail">
141
+ <a name="M000041"></a>
142
142
 
143
143
  <div class="method-heading">
144
- <a href="HeaderOut.src/M000035.html" target="Code" class="method-signature"
145
- onclick="popupCode('HeaderOut.src/M000035.html');return false;">
144
+ <a href="HeaderOut.src/M000041.html" target="Code" class="method-signature"
145
+ onclick="popupCode('HeaderOut.src/M000041.html');return false;">
146
146
  <span class="method-name">new</span><span class="method-args">(out)</span>
147
147
  </a>
148
148
  </div>
@@ -153,12 +153,12 @@ there.
153
153
 
154
154
  <h3 class="section-bar">Public Instance methods</h3>
155
155
 
156
- <div id="method-M000036" class="method-detail">
157
- <a name="M000036"></a>
156
+ <div id="method-M000042" class="method-detail">
157
+ <a name="M000042"></a>
158
158
 
159
159
  <div class="method-heading">
160
- <a href="HeaderOut.src/M000036.html" target="Code" class="method-signature"
161
- onclick="popupCode('HeaderOut.src/M000036.html');return false;">
160
+ <a href="HeaderOut.src/M000042.html" target="Code" class="method-signature"
161
+ onclick="popupCode('HeaderOut.src/M000042.html');return false;">
162
162
  <span class="method-name">[]=</span><span class="method-args">(key,value)</span>
163
163
  </a>
164
164
  </div>