mongrel 0.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. data/README +24 -28
  2. data/Rakefile +11 -4
  3. data/bin/mongrel_rails +82 -25
  4. data/doc/rdoc/classes/FactoryError.html +144 -0
  5. data/doc/rdoc/classes/FactoryError.src/M000001.html +23 -0
  6. data/doc/rdoc/classes/Mongrel.html +5 -5
  7. data/doc/rdoc/classes/Mongrel.src/{M000001.html → M000015.html} +4 -4
  8. data/doc/rdoc/classes/Mongrel/Const.html +2 -2
  9. data/doc/rdoc/classes/Mongrel/DirHandler.html +26 -26
  10. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000009.html → M000023.html} +0 -0
  11. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000010.html → M000024.html} +5 -2
  12. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000011.html → M000025.html} +26 -26
  13. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000012.html → M000026.html} +17 -17
  14. data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000013.html → M000027.html} +24 -24
  15. data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
  16. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000033.html → M000047.html} +0 -0
  17. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000034.html → M000048.html} +0 -0
  18. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  19. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000019.html → M000033.html} +0 -0
  20. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000020.html → M000034.html} +0 -0
  21. data/doc/rdoc/classes/Mongrel/HttpHandler.html +5 -5
  22. data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000025.html → M000039.html} +0 -0
  23. data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
  24. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000002.html → M000016.html} +0 -0
  25. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000003.html → M000017.html} +0 -0
  26. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000004.html → M000018.html} +0 -0
  27. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000005.html → M000019.html} +0 -0
  28. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000006.html → M000020.html} +0 -0
  29. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000007.html → M000021.html} +0 -0
  30. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000008.html → M000022.html} +0 -0
  31. data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
  32. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000035.html → M000049.html} +0 -0
  33. data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
  34. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000026.html → M000040.html} +0 -0
  35. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000027.html → M000041.html} +1 -1
  36. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000028.html → M000042.html} +0 -0
  37. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000029.html → M000043.html} +1 -1
  38. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000030.html → M000044.html} +0 -0
  39. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000031.html → M000045.html} +0 -0
  40. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000032.html → M000046.html} +0 -0
  41. data/doc/rdoc/classes/Mongrel/HttpServer.html +28 -28
  42. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000014.html → M000028.html} +0 -0
  43. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000015.html → M000029.html} +0 -0
  44. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000016.html → M000030.html} +0 -0
  45. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000017.html → M000031.html} +0 -0
  46. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000018.html → M000032.html} +0 -0
  47. data/doc/rdoc/classes/Mongrel/URIClassifier.html +20 -20
  48. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000021.html → M000035.html} +0 -0
  49. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000022.html → M000036.html} +0 -0
  50. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000023.html → M000037.html} +0 -0
  51. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000024.html → M000038.html} +0 -0
  52. data/doc/rdoc/classes/PluginFactory.html +409 -0
  53. data/doc/rdoc/classes/PluginFactory.src/M000002.html +18 -0
  54. data/doc/rdoc/classes/PluginFactory.src/M000003.html +18 -0
  55. data/doc/rdoc/classes/PluginFactory.src/M000004.html +22 -0
  56. data/doc/rdoc/classes/PluginFactory.src/M000005.html +22 -0
  57. data/doc/rdoc/classes/PluginFactory.src/M000006.html +33 -0
  58. data/doc/rdoc/classes/PluginFactory.src/M000007.html +32 -0
  59. data/doc/rdoc/classes/PluginFactory.src/M000008.html +18 -0
  60. data/doc/rdoc/classes/PluginFactory.src/M000009.html +24 -0
  61. data/doc/rdoc/classes/PluginFactory.src/M000010.html +40 -0
  62. data/doc/rdoc/classes/PluginFactory.src/M000011.html +39 -0
  63. data/doc/rdoc/classes/PluginFactory.src/M000012.html +24 -0
  64. data/doc/rdoc/classes/PluginFactory.src/M000013.html +70 -0
  65. data/doc/rdoc/classes/PluginFactory.src/M000014.html +34 -0
  66. data/doc/rdoc/created.rid +1 -1
  67. data/doc/rdoc/files/README.html +29 -37
  68. data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
  69. data/doc/rdoc/files/lib/pluginfactory_rb.html +132 -0
  70. data/doc/rdoc/fr_class_index.html +2 -0
  71. data/doc/rdoc/fr_file_index.html +1 -0
  72. data/doc/rdoc/fr_method_index.html +49 -35
  73. data/examples/simpletest.rb +10 -3
  74. data/lib/mongrel.rb +6 -3
  75. data/lib/mongrel/command.rb +192 -0
  76. data/lib/pluginfactory.rb +384 -0
  77. data/tools/rakehelp.rb +33 -29
  78. metadata +71 -41
@@ -103,7 +103,7 @@ efficiently handling large file uploads.
103
103
  <h3 class="section-bar">Methods</h3>
104
104
 
105
105
  <div class="name-list">
106
- <a href="#M000035">new</a>&nbsp;&nbsp;
106
+ <a href="#M000049">new</a>&nbsp;&nbsp;
107
107
  </div>
108
108
  </div>
109
109
 
@@ -143,12 +143,12 @@ efficiently handling large file uploads.
143
143
  <div id="methods">
144
144
  <h3 class="section-bar">Public Class methods</h3>
145
145
 
146
- <div id="method-M000035" class="method-detail">
147
- <a name="M000035"></a>
146
+ <div id="method-M000049" class="method-detail">
147
+ <a name="M000049"></a>
148
148
 
149
149
  <div class="method-heading">
150
- <a href="HttpRequest.src/M000035.html" target="Code" class="method-signature"
151
- onclick="popupCode('HttpRequest.src/M000035.html');return false;">
150
+ <a href="HttpRequest.src/M000049.html" target="Code" class="method-signature"
151
+ onclick="popupCode('HttpRequest.src/M000049.html');return false;">
152
152
  <span class="method-name">new</span><span class="method-args">(params, initial_body, socket)</span>
153
153
  </a>
154
154
  </div>
@@ -94,7 +94,7 @@ The parameter to start is the response code&#8212;which <a
94
94
  href="../Mongrel.html">Mongrel</a> will translate for you based on
95
95
  HTTP_STATUS_CODES. The head parameter is how you write custom headers. The
96
96
  out parameter is where you write your body. The default status code for <a
97
- href="HttpResponse.html#M000027">HttpResponse.start</a> is 200 so the above
97
+ href="HttpResponse.html#M000041">HttpResponse.start</a> is 200 so the above
98
98
  example is redundant.
99
99
  </p>
100
100
  <p>
@@ -131,13 +131,13 @@ will write this for you based on the out length.
131
131
  <h3 class="section-bar">Methods</h3>
132
132
 
133
133
  <div class="name-list">
134
- <a href="#M000032">finished</a>&nbsp;&nbsp;
135
- <a href="#M000026">new</a>&nbsp;&nbsp;
136
- <a href="#M000028">reset</a>&nbsp;&nbsp;
137
- <a href="#M000031">send_body</a>&nbsp;&nbsp;
138
- <a href="#M000030">send_header</a>&nbsp;&nbsp;
139
- <a href="#M000029">send_status</a>&nbsp;&nbsp;
140
- <a href="#M000027">start</a>&nbsp;&nbsp;
134
+ <a href="#M000046">finished</a>&nbsp;&nbsp;
135
+ <a href="#M000040">new</a>&nbsp;&nbsp;
136
+ <a href="#M000042">reset</a>&nbsp;&nbsp;
137
+ <a href="#M000045">send_body</a>&nbsp;&nbsp;
138
+ <a href="#M000044">send_header</a>&nbsp;&nbsp;
139
+ <a href="#M000043">send_status</a>&nbsp;&nbsp;
140
+ <a href="#M000041">start</a>&nbsp;&nbsp;
141
141
  </div>
142
142
  </div>
143
143
 
@@ -192,12 +192,12 @@ will write this for you based on the out length.
192
192
  <div id="methods">
193
193
  <h3 class="section-bar">Public Class methods</h3>
194
194
 
195
- <div id="method-M000026" class="method-detail">
196
- <a name="M000026"></a>
195
+ <div id="method-M000040" class="method-detail">
196
+ <a name="M000040"></a>
197
197
 
198
198
  <div class="method-heading">
199
- <a href="HttpResponse.src/M000026.html" target="Code" class="method-signature"
200
- onclick="popupCode('HttpResponse.src/M000026.html');return false;">
199
+ <a href="HttpResponse.src/M000040.html" target="Code" class="method-signature"
200
+ onclick="popupCode('HttpResponse.src/M000040.html');return false;">
201
201
  <span class="method-name">new</span><span class="method-args">(socket)</span>
202
202
  </a>
203
203
  </div>
@@ -208,12 +208,12 @@ will write this for you based on the out length.
208
208
 
209
209
  <h3 class="section-bar">Public Instance methods</h3>
210
210
 
211
- <div id="method-M000032" class="method-detail">
212
- <a name="M000032"></a>
211
+ <div id="method-M000046" class="method-detail">
212
+ <a name="M000046"></a>
213
213
 
214
214
  <div class="method-heading">
215
- <a href="HttpResponse.src/M000032.html" target="Code" class="method-signature"
216
- onclick="popupCode('HttpResponse.src/M000032.html');return false;">
215
+ <a href="HttpResponse.src/M000046.html" target="Code" class="method-signature"
216
+ onclick="popupCode('HttpResponse.src/M000046.html');return false;">
217
217
  <span class="method-name">finished</span><span class="method-args">()</span>
218
218
  </a>
219
219
  </div>
@@ -226,12 +226,12 @@ the proper format to make an HTTP/1.1 response.
226
226
  </div>
227
227
  </div>
228
228
 
229
- <div id="method-M000028" class="method-detail">
230
- <a name="M000028"></a>
229
+ <div id="method-M000042" class="method-detail">
230
+ <a name="M000042"></a>
231
231
 
232
232
  <div class="method-heading">
233
- <a href="HttpResponse.src/M000028.html" target="Code" class="method-signature"
234
- onclick="popupCode('HttpResponse.src/M000028.html');return false;">
233
+ <a href="HttpResponse.src/M000042.html" target="Code" class="method-signature"
234
+ onclick="popupCode('HttpResponse.src/M000042.html');return false;">
235
235
  <span class="method-name">reset</span><span class="method-args">()</span>
236
236
  </a>
237
237
  </div>
@@ -244,12 +244,12 @@ to write an alternative response.
244
244
  </div>
245
245
  </div>
246
246
 
247
- <div id="method-M000031" class="method-detail">
248
- <a name="M000031"></a>
247
+ <div id="method-M000045" class="method-detail">
248
+ <a name="M000045"></a>
249
249
 
250
250
  <div class="method-heading">
251
- <a href="HttpResponse.src/M000031.html" target="Code" class="method-signature"
252
- onclick="popupCode('HttpResponse.src/M000031.html');return false;">
251
+ <a href="HttpResponse.src/M000045.html" target="Code" class="method-signature"
252
+ onclick="popupCode('HttpResponse.src/M000045.html');return false;">
253
253
  <span class="method-name">send_body</span><span class="method-args">()</span>
254
254
  </a>
255
255
  </div>
@@ -258,12 +258,12 @@ to write an alternative response.
258
258
  </div>
259
259
  </div>
260
260
 
261
- <div id="method-M000030" class="method-detail">
262
- <a name="M000030"></a>
261
+ <div id="method-M000044" class="method-detail">
262
+ <a name="M000044"></a>
263
263
 
264
264
  <div class="method-heading">
265
- <a href="HttpResponse.src/M000030.html" target="Code" class="method-signature"
266
- onclick="popupCode('HttpResponse.src/M000030.html');return false;">
265
+ <a href="HttpResponse.src/M000044.html" target="Code" class="method-signature"
266
+ onclick="popupCode('HttpResponse.src/M000044.html');return false;">
267
267
  <span class="method-name">send_header</span><span class="method-args">()</span>
268
268
  </a>
269
269
  </div>
@@ -272,12 +272,12 @@ to write an alternative response.
272
272
  </div>
273
273
  </div>
274
274
 
275
- <div id="method-M000029" class="method-detail">
276
- <a name="M000029"></a>
275
+ <div id="method-M000043" class="method-detail">
276
+ <a name="M000043"></a>
277
277
 
278
278
  <div class="method-heading">
279
- <a href="HttpResponse.src/M000029.html" target="Code" class="method-signature"
280
- onclick="popupCode('HttpResponse.src/M000029.html');return false;">
279
+ <a href="HttpResponse.src/M000043.html" target="Code" class="method-signature"
280
+ onclick="popupCode('HttpResponse.src/M000043.html');return false;">
281
281
  <span class="method-name">send_status</span><span class="method-args">()</span>
282
282
  </a>
283
283
  </div>
@@ -286,12 +286,12 @@ to write an alternative response.
286
286
  </div>
287
287
  </div>
288
288
 
289
- <div id="method-M000027" class="method-detail">
290
- <a name="M000027"></a>
289
+ <div id="method-M000041" class="method-detail">
290
+ <a name="M000041"></a>
291
291
 
292
292
  <div class="method-heading">
293
- <a href="HttpResponse.src/M000027.html" target="Code" class="method-signature"
294
- onclick="popupCode('HttpResponse.src/M000027.html');return false;">
293
+ <a href="HttpResponse.src/M000041.html" target="Code" class="method-signature"
294
+ onclick="popupCode('HttpResponse.src/M000041.html');return false;">
295
295
  <span class="method-name">start</span><span class="method-args">(status=200) {|@header, @body| ...}</span>
296
296
  </a>
297
297
  </div>
@@ -12,7 +12,7 @@
12
12
  <body class="standalone-code">
13
13
  <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 231</span>
14
14
  231: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">status</span>=<span class="ruby-value">200</span>)
15
- 232: <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">status</span>
15
+ 232: <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">status</span>.<span class="ruby-identifier">to_i</span>
16
16
  233: <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@header</span>, <span class="ruby-ivar">@body</span>
17
17
  234: <span class="ruby-identifier">finished</span>
18
18
  235: <span class="ruby-keyword kw">end</span></pre>
@@ -12,7 +12,7 @@
12
12
  <body class="standalone-code">
13
13
  <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 244</span>
14
14
  244: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_status</span>
15
- 245: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;HTTP/1.1 #{@status} #{HTTP_STATUS_CODES[@status]}\r\nContent-Length: #{@body.length}\r\nConnection: close\r\n&quot;</span>)
15
+ 245: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;HTTP/1.1 #{@status.to_i} #{HTTP_STATUS_CODES[@status.to_i]}\r\nContent-Length:#{body.length}\r\nConnection: close\r\n&quot;</span>)
16
16
  246: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -85,7 +85,7 @@ Mognrel::HttpParser and <a
85
85
  href="URIClassifier.html">Mongrel::URIClassifier</a> make up the majority
86
86
  of how the server functions. It&#8217;s a very simple class that just has a
87
87
  thread accepting connections and a simple <a
88
- href="HttpServer.html#M000015">HttpServer.process_client</a> function to do
88
+ href="HttpServer.html#M000029">HttpServer.process_client</a> function to do
89
89
  the heavy lifting with the IO and Ruby.
90
90
  </p>
91
91
  <p>
@@ -119,11 +119,11 @@ finally useful.
119
119
  <h3 class="section-bar">Methods</h3>
120
120
 
121
121
  <div class="name-list">
122
- <a href="#M000014">new</a>&nbsp;&nbsp;
123
- <a href="#M000015">process_client</a>&nbsp;&nbsp;
124
- <a href="#M000017">register</a>&nbsp;&nbsp;
125
- <a href="#M000016">run</a>&nbsp;&nbsp;
126
- <a href="#M000018">unregister</a>&nbsp;&nbsp;
122
+ <a href="#M000028">new</a>&nbsp;&nbsp;
123
+ <a href="#M000029">process_client</a>&nbsp;&nbsp;
124
+ <a href="#M000031">register</a>&nbsp;&nbsp;
125
+ <a href="#M000030">run</a>&nbsp;&nbsp;
126
+ <a href="#M000032">unregister</a>&nbsp;&nbsp;
127
127
  </div>
128
128
  </div>
129
129
 
@@ -158,12 +158,12 @@ finally useful.
158
158
  <div id="methods">
159
159
  <h3 class="section-bar">Public Class methods</h3>
160
160
 
161
- <div id="method-M000014" class="method-detail">
162
- <a name="M000014"></a>
161
+ <div id="method-M000028" class="method-detail">
162
+ <a name="M000028"></a>
163
163
 
164
164
  <div class="method-heading">
165
- <a href="HttpServer.src/M000014.html" target="Code" class="method-signature"
166
- onclick="popupCode('HttpServer.src/M000014.html');return false;">
165
+ <a href="HttpServer.src/M000028.html" target="Code" class="method-signature"
166
+ onclick="popupCode('HttpServer.src/M000028.html');return false;">
167
167
  <span class="method-name">new</span><span class="method-args">(host, port, num_processors=20)</span>
168
168
  </a>
169
169
  </div>
@@ -195,12 +195,12 @@ href="../Mongrel.html">Mongrel</a> will make this more dynamic (hopefully).
195
195
 
196
196
  <h3 class="section-bar">Public Instance methods</h3>
197
197
 
198
- <div id="method-M000015" class="method-detail">
199
- <a name="M000015"></a>
198
+ <div id="method-M000029" class="method-detail">
199
+ <a name="M000029"></a>
200
200
 
201
201
  <div class="method-heading">
202
- <a href="HttpServer.src/M000015.html" target="Code" class="method-signature"
203
- onclick="popupCode('HttpServer.src/M000015.html');return false;">
202
+ <a href="HttpServer.src/M000029.html" target="Code" class="method-signature"
203
+ onclick="popupCode('HttpServer.src/M000029.html');return false;">
204
204
  <span class="method-name">process_client</span><span class="method-args">(client)</span>
205
205
  </a>
206
206
  </div>
@@ -217,12 +217,12 @@ crack at it.
217
217
  </div>
218
218
  </div>
219
219
 
220
- <div id="method-M000017" class="method-detail">
221
- <a name="M000017"></a>
220
+ <div id="method-M000031" class="method-detail">
221
+ <a name="M000031"></a>
222
222
 
223
223
  <div class="method-heading">
224
- <a href="HttpServer.src/M000017.html" target="Code" class="method-signature"
225
- onclick="popupCode('HttpServer.src/M000017.html');return false;">
224
+ <a href="HttpServer.src/M000031.html" target="Code" class="method-signature"
225
+ onclick="popupCode('HttpServer.src/M000031.html');return false;">
226
226
  <span class="method-name">register</span><span class="method-args">(uri, handler)</span>
227
227
  </a>
228
228
  </div>
@@ -233,18 +233,18 @@ Simply registers a handler with the internal <a
233
233
  href="URIClassifier.html">URIClassifier</a>. When the URI is found in the
234
234
  prefix of a request then your handler&#8217;s HttpHandler::process method
235
235
  is called. See <a
236
- href="URIClassifier.html#M000022">Mongrel::URIClassifier#register</a> for
236
+ href="URIClassifier.html#M000036">Mongrel::URIClassifier#register</a> for
237
237
  more information.
238
238
  </p>
239
239
  </div>
240
240
  </div>
241
241
 
242
- <div id="method-M000016" class="method-detail">
243
- <a name="M000016"></a>
242
+ <div id="method-M000030" class="method-detail">
243
+ <a name="M000030"></a>
244
244
 
245
245
  <div class="method-heading">
246
- <a href="HttpServer.src/M000016.html" target="Code" class="method-signature"
247
- onclick="popupCode('HttpServer.src/M000016.html');return false;">
246
+ <a href="HttpServer.src/M000030.html" target="Code" class="method-signature"
247
+ onclick="popupCode('HttpServer.src/M000030.html');return false;">
248
248
  <span class="method-name">run</span><span class="method-args">()</span>
249
249
  </a>
250
250
  </div>
@@ -258,12 +258,12 @@ later.
258
258
  </div>
259
259
  </div>
260
260
 
261
- <div id="method-M000018" class="method-detail">
262
- <a name="M000018"></a>
261
+ <div id="method-M000032" class="method-detail">
262
+ <a name="M000032"></a>
263
263
 
264
264
  <div class="method-heading">
265
- <a href="HttpServer.src/M000018.html" target="Code" class="method-signature"
266
- onclick="popupCode('HttpServer.src/M000018.html');return false;">
265
+ <a href="HttpServer.src/M000032.html" target="Code" class="method-signature"
266
+ onclick="popupCode('HttpServer.src/M000032.html');return false;">
267
267
  <span class="method-name">unregister</span><span class="method-args">(uri)</span>
268
268
  </a>
269
269
  </div>
@@ -271,7 +271,7 @@ later.
271
271
  <div class="method-description">
272
272
  <p>
273
273
  Removes any handler registered at the given URI. See <a
274
- href="URIClassifier.html#M000023">Mongrel::URIClassifier#unregister</a> for
274
+ href="URIClassifier.html#M000037">Mongrel::URIClassifier#unregister</a> for
275
275
  more information.
276
276
  </p>
277
277
  </div>
@@ -86,10 +86,10 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000021">new</a>&nbsp;&nbsp;
90
- <a href="#M000022">register</a>&nbsp;&nbsp;
91
- <a href="#M000024">resolve</a>&nbsp;&nbsp;
92
- <a href="#M000023">unregister</a>&nbsp;&nbsp;
89
+ <a href="#M000035">new</a>&nbsp;&nbsp;
90
+ <a href="#M000036">register</a>&nbsp;&nbsp;
91
+ <a href="#M000038">resolve</a>&nbsp;&nbsp;
92
+ <a href="#M000037">unregister</a>&nbsp;&nbsp;
93
93
  </div>
94
94
  </div>
95
95
 
@@ -111,12 +111,12 @@
111
111
  <div id="methods">
112
112
  <h3 class="section-bar">Public Class methods</h3>
113
113
 
114
- <div id="method-M000021" class="method-detail">
115
- <a name="M000021"></a>
114
+ <div id="method-M000035" class="method-detail">
115
+ <a name="M000035"></a>
116
116
 
117
117
  <div class="method-heading">
118
- <a href="URIClassifier.src/M000021.html" target="Code" class="method-signature"
119
- onclick="popupCode('URIClassifier.src/M000021.html');return false;">
118
+ <a href="URIClassifier.src/M000035.html" target="Code" class="method-signature"
119
+ onclick="popupCode('URIClassifier.src/M000035.html');return false;">
120
120
  <span class="method-name">URIClassifier.new &rarr; URIClassifier<br />
121
121
  </span>
122
122
  </a>
@@ -143,12 +143,12 @@ portion.
143
143
 
144
144
  <h3 class="section-bar">Public Instance methods</h3>
145
145
 
146
- <div id="method-M000022" class="method-detail">
147
- <a name="M000022"></a>
146
+ <div id="method-M000036" class="method-detail">
147
+ <a name="M000036"></a>
148
148
 
149
149
  <div class="method-heading">
150
- <a href="URIClassifier.src/M000022.html" target="Code" class="method-signature"
151
- onclick="popupCode('URIClassifier.src/M000022.html');return false;">
150
+ <a href="URIClassifier.src/M000036.html" target="Code" class="method-signature"
151
+ onclick="popupCode('URIClassifier.src/M000036.html');return false;">
152
152
  <span class="method-name">uc.register("/someuri", SampleHandler.new) &rarr; nil<br />
153
153
  </span>
154
154
  </a>
@@ -173,12 +173,12 @@ to get right with a Hash.
173
173
  </div>
174
174
  </div>
175
175
 
176
- <div id="method-M000024" class="method-detail">
177
- <a name="M000024"></a>
176
+ <div id="method-M000038" class="method-detail">
177
+ <a name="M000038"></a>
178
178
 
179
179
  <div class="method-heading">
180
- <a href="URIClassifier.src/M000024.html" target="Code" class="method-signature"
181
- onclick="popupCode('URIClassifier.src/M000024.html');return false;">
180
+ <a href="URIClassifier.src/M000038.html" target="Code" class="method-signature"
181
+ onclick="popupCode('URIClassifier.src/M000038.html');return false;">
182
182
  <span class="method-name">uc.resolve("/someuri") &rarr; "/someuri", "", handler<br />
183
183
  uc.resolve("/someuri/pathinfo") &rarr; "/someuri", "/pathinfo", handler<br />
184
184
  uc.resolve("/notfound/orhere") &rarr; nil, nil, nil<br />
@@ -225,12 +225,12 @@ Don&#8216;t try other string-like stuff yet.
225
225
  </div>
226
226
  </div>
227
227
 
228
- <div id="method-M000023" class="method-detail">
229
- <a name="M000023"></a>
228
+ <div id="method-M000037" class="method-detail">
229
+ <a name="M000037"></a>
230
230
 
231
231
  <div class="method-heading">
232
- <a href="URIClassifier.src/M000023.html" target="Code" class="method-signature"
233
- onclick="popupCode('URIClassifier.src/M000023.html');return false;">
232
+ <a href="URIClassifier.src/M000037.html" target="Code" class="method-signature"
233
+ onclick="popupCode('URIClassifier.src/M000037.html');return false;">
234
234
  <span class="method-name">uc.unregister("/someuri")<br />
235
235
  </span>
236
236
  </a>
@@ -0,0 +1,409 @@
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>Module: PluginFactory</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="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">PluginFactory</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/pluginfactory_rb.html">
59
+ lib/pluginfactory.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ A mixin that adds <a href="PluginFactory.html">PluginFactory</a> class
78
+ methods to a base class, so that subclasses may be instantiated by name.
79
+ </p>
80
+
81
+ </div>
82
+
83
+
84
+ </div>
85
+
86
+ <div id="method-list">
87
+ <h3 class="section-bar">Methods</h3>
88
+
89
+ <div class="name-list">
90
+ <a href="#M000009">create</a>&nbsp;&nbsp;
91
+ <a href="#M000008">derivativeClasses</a>&nbsp;&nbsp;
92
+ <a href="#M000005">derivatives</a>&nbsp;&nbsp;
93
+ <a href="#M000004">extend_object</a>&nbsp;&nbsp;
94
+ <a href="#M000006">factoryType</a>&nbsp;&nbsp;
95
+ <a href="#M000012">getModuleName</a>&nbsp;&nbsp;
96
+ <a href="#M000010">getSubclass</a>&nbsp;&nbsp;
97
+ <a href="#M000003">included</a>&nbsp;&nbsp;
98
+ <a href="#M000007">inherited</a>&nbsp;&nbsp;
99
+ <a href="#M000011">loadDerivative</a>&nbsp;&nbsp;
100
+ <a href="#M000002">log</a>&nbsp;&nbsp;
101
+ <a href="#M000014">makeRequirePath</a>&nbsp;&nbsp;
102
+ <a href="#M000013">requireDerivative</a>&nbsp;&nbsp;
103
+ </div>
104
+ </div>
105
+
106
+ </div>
107
+
108
+
109
+ <!-- if includes -->
110
+
111
+ <div id="section">
112
+
113
+
114
+
115
+
116
+
117
+ <div id="attribute-list">
118
+ <h3 class="section-bar">Attributes</h3>
119
+
120
+ <div class="name-list">
121
+ <table>
122
+ <tr class="top-aligned-row context-row">
123
+ <td class="context-item-name">logger_callback</td>
124
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
125
+ <td class="context-item-desc"></td>
126
+ </tr>
127
+ </table>
128
+ </div>
129
+ </div>
130
+
131
+
132
+
133
+ <!-- if method_list -->
134
+ <div id="methods">
135
+ <h3 class="section-bar">Public Class methods</h3>
136
+
137
+ <div id="method-M000004" class="method-detail">
138
+ <a name="M000004"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="PluginFactory.src/M000004.html" target="Code" class="method-signature"
142
+ onclick="popupCode('PluginFactory.src/M000004.html');return false;">
143
+ <span class="method-name">extend_object</span><span class="method-args">( obj )</span>
144
+ </a>
145
+ </div>
146
+
147
+ <div class="method-description">
148
+ <p>
149
+ Raise an exception if the object being extended is anything but a class.
150
+ </p>
151
+ </div>
152
+ </div>
153
+
154
+ <div id="method-M000003" class="method-detail">
155
+ <a name="M000003"></a>
156
+
157
+ <div class="method-heading">
158
+ <a href="PluginFactory.src/M000003.html" target="Code" class="method-signature"
159
+ onclick="popupCode('PluginFactory.src/M000003.html');return false;">
160
+ <span class="method-name">included</span><span class="method-args">( klass )</span>
161
+ </a>
162
+ </div>
163
+
164
+ <div class="method-description">
165
+ <p>
166
+ Inclusion callback &#8212; extends the including class.
167
+ </p>
168
+ </div>
169
+ </div>
170
+
171
+ <div id="method-M000002" class="method-detail">
172
+ <a name="M000002"></a>
173
+
174
+ <div class="method-heading">
175
+ <a href="PluginFactory.src/M000002.html" target="Code" class="method-signature"
176
+ onclick="popupCode('PluginFactory.src/M000002.html');return false;">
177
+ <span class="method-name">log</span><span class="method-args">(level, *msg)</span>
178
+ </a>
179
+ </div>
180
+
181
+ <div class="method-description">
182
+ <p>
183
+ If the logger callback is set, use it to pass on a log entry. First
184
+ argument is
185
+ </p>
186
+ </div>
187
+ </div>
188
+
189
+ <h3 class="section-bar">Public Instance methods</h3>
190
+
191
+ <div id="method-M000009" class="method-detail">
192
+ <a name="M000009"></a>
193
+
194
+ <div class="method-heading">
195
+ <a href="PluginFactory.src/M000009.html" target="Code" class="method-signature"
196
+ onclick="popupCode('PluginFactory.src/M000009.html');return false;">
197
+ <span class="method-name">create</span><span class="method-args">( subType, *args, &amp;block )</span>
198
+ </a>
199
+ </div>
200
+
201
+ <div class="method-description">
202
+ <p>
203
+ Given the <tt>className</tt> of the class to instantiate, and other
204
+ arguments bound for the constructor of the new object, this method loads
205
+ the derivative class if it is not loaded already (raising a LoadError if an
206
+ appropriately-named file cannot be found), and instantiates it with the
207
+ given <tt>args</tt>. The <tt>className</tt> may be the the fully qualified
208
+ name of the class, the class object itself, or the unique part of the class
209
+ name. The following examples would all try to load and instantiate a class
210
+ called &quot;FooListener&quot; if Listener included Factory
211
+ </p>
212
+ <pre>
213
+ obj = Listener::create( 'FooListener' )
214
+ obj = Listener::create( FooListener )
215
+ obj = Listener::create( 'Foo' )
216
+ </pre>
217
+ </div>
218
+ </div>
219
+
220
+ <div id="method-M000008" class="method-detail">
221
+ <a name="M000008"></a>
222
+
223
+ <div class="method-heading">
224
+ <a href="PluginFactory.src/M000008.html" target="Code" class="method-signature"
225
+ onclick="popupCode('PluginFactory.src/M000008.html');return false;">
226
+ <span class="method-name">derivativeClasses</span><span class="method-args">()</span>
227
+ </a>
228
+ </div>
229
+
230
+ <div class="method-description">
231
+ <p>
232
+ Returns an Array of registered derivatives
233
+ </p>
234
+ </div>
235
+ </div>
236
+
237
+ <div id="method-M000005" class="method-detail">
238
+ <a name="M000005"></a>
239
+
240
+ <div class="method-heading">
241
+ <a href="PluginFactory.src/M000005.html" target="Code" class="method-signature"
242
+ onclick="popupCode('PluginFactory.src/M000005.html');return false;">
243
+ <span class="method-name">derivatives</span><span class="method-args">()</span>
244
+ </a>
245
+ </div>
246
+
247
+ <div class="method-description">
248
+ <p>
249
+ Return the Hash of derivative classes, keyed by various versions of the
250
+ class name.
251
+ </p>
252
+ </div>
253
+ </div>
254
+
255
+ <div id="method-M000006" class="method-detail">
256
+ <a name="M000006"></a>
257
+
258
+ <div class="method-heading">
259
+ <a href="PluginFactory.src/M000006.html" target="Code" class="method-signature"
260
+ onclick="popupCode('PluginFactory.src/M000006.html');return false;">
261
+ <span class="method-name">factoryType</span><span class="method-args">()</span>
262
+ </a>
263
+ </div>
264
+
265
+ <div class="method-description">
266
+ <p>
267
+ Returns the type name used when searching for a derivative.
268
+ </p>
269
+ </div>
270
+ </div>
271
+
272
+ <div id="method-M000012" class="method-detail">
273
+ <a name="M000012"></a>
274
+
275
+ <div class="method-heading">
276
+ <a href="PluginFactory.src/M000012.html" target="Code" class="method-signature"
277
+ onclick="popupCode('PluginFactory.src/M000012.html');return false;">
278
+ <span class="method-name">getModuleName</span><span class="method-args">( className )</span>
279
+ </a>
280
+ </div>
281
+
282
+ <div class="method-description">
283
+ <p>
284
+ Build and return the unique part of the given <tt>className</tt> either by
285
+ stripping leading namespaces if the name already has the name of the
286
+ factory type in it (eg., &#8216;My::FooService&#8217; for Service, or by
287
+ appending the factory type if it doesn&#8217;t.
288
+ </p>
289
+ </div>
290
+ </div>
291
+
292
+ <div id="method-M000010" class="method-detail">
293
+ <a name="M000010"></a>
294
+
295
+ <div class="method-heading">
296
+ <a href="PluginFactory.src/M000010.html" target="Code" class="method-signature"
297
+ onclick="popupCode('PluginFactory.src/M000010.html');return false;">
298
+ <span class="method-name">getSubclass</span><span class="method-args">( className )</span>
299
+ </a>
300
+ </div>
301
+
302
+ <div class="method-description">
303
+ <p>
304
+ Given a <tt>className</tt> like that of the first argument to <a
305
+ href="PluginFactory.html#M000009">create</a>, attempt to load the
306
+ corresponding class if it is not already loaded and return the class
307
+ object.
308
+ </p>
309
+ </div>
310
+ </div>
311
+
312
+ <div id="method-M000007" class="method-detail">
313
+ <a name="M000007"></a>
314
+
315
+ <div class="method-heading">
316
+ <a href="PluginFactory.src/M000007.html" target="Code" class="method-signature"
317
+ onclick="popupCode('PluginFactory.src/M000007.html');return false;">
318
+ <span class="method-name">inherited</span><span class="method-args">( subclass )</span>
319
+ </a>
320
+ </div>
321
+
322
+ <div class="method-description">
323
+ <p>
324
+ Inheritance callback &#8212; Register subclasses in the derivatives hash so
325
+ that ::create knows about them.
326
+ </p>
327
+ </div>
328
+ </div>
329
+
330
+ <div id="method-M000011" class="method-detail">
331
+ <a name="M000011"></a>
332
+
333
+ <div class="method-heading">
334
+ <a href="PluginFactory.src/M000011.html" target="Code" class="method-signature"
335
+ onclick="popupCode('PluginFactory.src/M000011.html');return false;">
336
+ <span class="method-name">loadDerivative</span><span class="method-args">( className )</span>
337
+ </a>
338
+ </div>
339
+
340
+ <div class="method-description">
341
+ <p>
342
+ Calculates an appropriate filename for the derived class using the name of
343
+ the base class and tries to load it via <tt>require</tt>. If the including
344
+ class responds to a method named <tt>derivativeDirs</tt>, its return value
345
+ (either a String, or an array of Strings) is added to the list of prefix
346
+ directories to try when attempting to require a modules. Eg., if
347
+ <tt>class.derivativeDirs</tt> returns
348
+ <tt>[&#8216;foo&#8217;,&#8217;bar&#8217;]</tt> the require line is tried
349
+ with both <tt>&#8216;foo/&#8217;</tt> and <tt>&#8216;bar/&#8217;</tt>
350
+ prepended to it.
351
+ </p>
352
+ </div>
353
+ </div>
354
+
355
+ <div id="method-M000014" class="method-detail">
356
+ <a name="M000014"></a>
357
+
358
+ <div class="method-heading">
359
+ <a href="PluginFactory.src/M000014.html" target="Code" class="method-signature"
360
+ onclick="popupCode('PluginFactory.src/M000014.html');return false;">
361
+ <span class="method-name">makeRequirePath</span><span class="method-args">( modname, subdir )</span>
362
+ </a>
363
+ </div>
364
+
365
+ <div class="method-description">
366
+ <p>
367
+ Make a list of permutations of the given <tt>modname</tt> for the given
368
+ <tt>subdir</tt>. Called on a <tt>DataDriver</tt> class with the arguments
369
+ &#8216;Socket&#8217; and &#8216;drivers&#8217;, returns:
370
+ </p>
371
+ <pre>
372
+ [&quot;drivers/socketdatadriver&quot;, &quot;drivers/socketDataDriver&quot;,
373
+ &quot;drivers/SocketDataDriver&quot;, &quot;drivers/socket&quot;, &quot;drivers/Socket&quot;]
374
+ </pre>
375
+ </div>
376
+ </div>
377
+
378
+ <div id="method-M000013" class="method-detail">
379
+ <a name="M000013"></a>
380
+
381
+ <div class="method-heading">
382
+ <a href="PluginFactory.src/M000013.html" target="Code" class="method-signature"
383
+ onclick="popupCode('PluginFactory.src/M000013.html');return false;">
384
+ <span class="method-name">requireDerivative</span><span class="method-args">( modName )</span>
385
+ </a>
386
+ </div>
387
+
388
+ <div class="method-description">
389
+ <p>
390
+ If the factory responds to the derivativeDirs method, call it and use the
391
+ returned array as a list of directories to search for the module with the
392
+ specified <tt>modName</tt>.
393
+ </p>
394
+ </div>
395
+ </div>
396
+
397
+
398
+ </div>
399
+
400
+
401
+ </div>
402
+
403
+
404
+ <div id="validator-badges">
405
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
406
+ </div>
407
+
408
+ </body>
409
+ </html>