mongrel 0.3.10.1 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/Rakefile +14 -2
  2. data/bin/mongrel_rails +7 -1
  3. data/bin/mongrel_rails_service +4 -4
  4. data/lib/mongrel.rb +5 -6
  5. data/tools/rakehelp.rb +4 -2
  6. metadata +3 -134
  7. data/doc/rdoc/classes/Mongrel.html +0 -175
  8. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -381
  9. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000057.html +0 -24
  10. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000058.html +0 -47
  11. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000059.html +0 -34
  12. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000060.html +0 -27
  13. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000061.html +0 -25
  14. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000062.html +0 -18
  15. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000063.html +0 -18
  16. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000064.html +0 -18
  17. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000065.html +0 -19
  18. data/doc/rdoc/classes/Mongrel/Camping.html +0 -177
  19. data/doc/rdoc/classes/Mongrel/Camping.src/M000019.html +0 -22
  20. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +0 -165
  21. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000020.html +0 -18
  22. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000021.html +0 -27
  23. data/doc/rdoc/classes/Mongrel/Command.html +0 -119
  24. data/doc/rdoc/classes/Mongrel/Command/Base.html +0 -332
  25. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000006.html +0 -24
  26. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000007.html +0 -41
  27. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000008.html +0 -18
  28. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000009.html +0 -18
  29. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000010.html +0 -18
  30. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000011.html +0 -22
  31. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000012.html +0 -18
  32. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000013.html +0 -18
  33. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000014.html +0 -18
  34. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000015.html +0 -18
  35. data/doc/rdoc/classes/Mongrel/Command/Registry.html +0 -192
  36. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000016.html +0 -20
  37. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000017.html +0 -25
  38. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000018.html +0 -46
  39. data/doc/rdoc/classes/Mongrel/Const.html +0 -352
  40. data/doc/rdoc/classes/Mongrel/DirHandler.html +0 -283
  41. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000029.html +0 -20
  42. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000030.html +0 -42
  43. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000031.html +0 -40
  44. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000032.html +0 -31
  45. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000033.html +0 -38
  46. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000034.html +0 -18
  47. data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
  48. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000066.html +0 -18
  49. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000067.html +0 -18
  50. data/doc/rdoc/classes/Mongrel/HeaderOut.html +0 -185
  51. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000041.html +0 -18
  52. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000042.html +0 -21
  53. data/doc/rdoc/classes/Mongrel/HttpHandler.html +0 -146
  54. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000043.html +0 -17
  55. data/doc/rdoc/classes/Mongrel/HttpParser.html +0 -271
  56. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000022.html +0 -28
  57. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000023.html +0 -29
  58. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000024.html +0 -29
  59. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000025.html +0 -41
  60. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000026.html +0 -27
  61. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000027.html +0 -27
  62. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000028.html +0 -28
  63. data/doc/rdoc/classes/Mongrel/HttpRequest.html +0 -177
  64. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000068.html +0 -39
  65. data/doc/rdoc/classes/Mongrel/HttpResponse.html +0 -321
  66. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000044.html +0 -21
  67. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000045.html +0 -20
  68. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000046.html +0 -19
  69. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000047.html +0 -19
  70. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000048.html +0 -20
  71. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000049.html +0 -20
  72. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000050.html +0 -20
  73. data/doc/rdoc/classes/Mongrel/HttpServer.html +0 -310
  74. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000035.html +0 -36
  75. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000036.html +0 -57
  76. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000037.html +0 -48
  77. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000038.html +0 -18
  78. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000039.html +0 -18
  79. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000040.html +0 -23
  80. data/doc/rdoc/classes/Mongrel/StopServer.html +0 -117
  81. data/doc/rdoc/classes/Mongrel/TimeoutWorker.html +0 -117
  82. data/doc/rdoc/classes/Mongrel/URIClassifier.html +0 -301
  83. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000051.html +0 -18
  84. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000052.html +0 -18
  85. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000053.html +0 -39
  86. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000054.html +0 -51
  87. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000055.html +0 -36
  88. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000056.html +0 -83
  89. data/doc/rdoc/classes/RailsHandler.html +0 -245
  90. data/doc/rdoc/classes/RailsHandler.src/M000003.html +0 -22
  91. data/doc/rdoc/classes/RailsHandler.src/M000004.html +0 -48
  92. data/doc/rdoc/classes/RailsHandler.src/M000005.html +0 -23
  93. data/doc/rdoc/classes/TCPServer.html +0 -173
  94. data/doc/rdoc/classes/TCPServer.src/M000001.html +0 -19
  95. data/doc/rdoc/created.rid +0 -1
  96. data/doc/rdoc/files/COPYING.html +0 -756
  97. data/doc/rdoc/files/LICENSE.html +0 -756
  98. data/doc/rdoc/files/README.html +0 -302
  99. data/doc/rdoc/files/ext/http11/http11_c.html +0 -101
  100. data/doc/rdoc/files/lib/mongrel/camping_rb.html +0 -108
  101. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +0 -108
  102. data/doc/rdoc/files/lib/mongrel/command_rb.html +0 -111
  103. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +0 -101
  104. data/doc/rdoc/files/lib/mongrel/init_rb.html +0 -109
  105. data/doc/rdoc/files/lib/mongrel/rails_rb.html +0 -109
  106. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +0 -109
  107. data/doc/rdoc/files/lib/mongrel_rb.html +0 -116
  108. data/doc/rdoc/fr_class_index.html +0 -47
  109. data/doc/rdoc/fr_file_index.html +0 -38
  110. data/doc/rdoc/fr_method_index.html +0 -94
  111. data/doc/rdoc/index.html +0 -24
  112. data/doc/rdoc/rdoc-style.css +0 -208
@@ -1,381 +0,0 @@
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>Class: Mongrel::CGIWrapper</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>Class</strong></td>
53
- <td class="class-name-in-header">Mongrel::CGIWrapper</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/mongrel/cgi_rb.html">
59
- lib/mongrel/cgi.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- ::CGI
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- The beginning of a complete wrapper around <a
84
- href="../Mongrel.html">Mongrel</a>&#8217;s internal HTTP processing system
85
- but maintaining the original Ruby CGI module. Use this only as a crutch to
86
- get existing CGI based systems working. It should handle everything, but
87
- please notify me if you see special warnings. This work is still very alpha
88
- so I need testers to help work out the various corner cases.
89
- </p>
90
- <p>
91
- The CGIWrapper.handler attribute is normally not set and is available for
92
- frameworks that need to get back to the handler. Rails uses this to give
93
- people access to the RailsHandler#files (<a
94
- href="DirHandler.html">DirHandler</a> really) so they can look-up paths and
95
- do other things withthe files managed there.
96
- </p>
97
- <p>
98
- In Rails you can get the real file for a request with:
99
- </p>
100
- <pre>
101
- path = @request.cgi.handler.files.can_serve(@request['PATH_INFO'])
102
- </pre>
103
- <p>
104
- Which is ugly but does the job. Feel free to write a Rails helper for that.
105
- Refer to <a href="DirHandler.html#M000030">DirHandler#can_serve</a> for
106
- more information on this.
107
- </p>
108
-
109
- </div>
110
-
111
-
112
- </div>
113
-
114
- <div id="method-list">
115
- <h3 class="section-bar">Methods</h3>
116
-
117
- <div class="name-list">
118
- <a href="#M000062">args</a>&nbsp;&nbsp;
119
- <a href="#M000063">env_table</a>&nbsp;&nbsp;
120
- <a href="#M000058">header</a>&nbsp;&nbsp;
121
- <a href="#M000057">new</a>&nbsp;&nbsp;
122
- <a href="#M000060">out</a>&nbsp;&nbsp;
123
- <a href="#M000059">send_cookies</a>&nbsp;&nbsp;
124
- <a href="#M000061">status</a>&nbsp;&nbsp;
125
- <a href="#M000064">stdinput</a>&nbsp;&nbsp;
126
- <a href="#M000065">stdoutput</a>&nbsp;&nbsp;
127
- </div>
128
- </div>
129
-
130
- </div>
131
-
132
-
133
- <!-- if includes -->
134
-
135
- <div id="section">
136
-
137
-
138
- <div id="constants-list">
139
- <h3 class="section-bar">Constants</h3>
140
-
141
- <div class="name-list">
142
- <table summary="Constants">
143
- <tr class="top-aligned-row context-row">
144
- <td class="context-item-name">REMOVED_KEYS</td>
145
- <td>=</td>
146
- <td class="context-item-value">[ &quot;nph&quot;,&quot;status&quot;,&quot;server&quot;,&quot;connection&quot;,&quot;type&quot;, &quot;charset&quot;,&quot;length&quot;,&quot;language&quot;,&quot;expires&quot;]</td>
147
- <td width="3em">&nbsp;</td>
148
- <td class="context-item-desc">
149
- these are stripped out of any keys passed to <a
150
- href="CGIWrapper.html#M000058">CGIWrapper.header</a> function
151
-
152
- </td>
153
- </tr>
154
- </table>
155
- </div>
156
- </div>
157
-
158
-
159
-
160
- <div id="attribute-list">
161
- <h3 class="section-bar">Attributes</h3>
162
-
163
- <div class="name-list">
164
- <table>
165
- <tr class="top-aligned-row context-row">
166
- <td class="context-item-name">handler</td>
167
- <td class="context-item-value">&nbsp;[W]&nbsp;</td>
168
- <td class="context-item-desc"></td>
169
- </tr>
170
- <tr class="top-aligned-row context-row">
171
- <td class="context-item-name">handler</td>
172
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
173
- <td class="context-item-desc"></td>
174
- </tr>
175
- <tr class="top-aligned-row context-row">
176
- <td class="context-item-name">options</td>
177
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
178
- <td class="context-item-desc"></td>
179
- </tr>
180
- </table>
181
- </div>
182
- </div>
183
-
184
-
185
-
186
- <!-- if method_list -->
187
- <div id="methods">
188
- <h3 class="section-bar">Public Class methods</h3>
189
-
190
- <div id="method-M000057" class="method-detail">
191
- <a name="M000057"></a>
192
-
193
- <div class="method-heading">
194
- <a href="CGIWrapper.src/M000057.html" target="Code" class="method-signature"
195
- onclick="popupCode('CGIWrapper.src/M000057.html');return false;">
196
- <span class="method-name">new</span><span class="method-args">(request, response, *args)</span>
197
- </a>
198
- </div>
199
-
200
- <div class="method-description">
201
- <p>
202
- Takes an <a href="HttpRequest.html">HttpRequest</a> and <a
203
- href="HttpResponse.html">HttpResponse</a> object, plus any additional
204
- arguments normally passed to CGI. These are used internally to create a
205
- wrapper around the real CGI while maintaining <a
206
- href="../Mongrel.html">Mongrel</a>&#8217;s view of the world.
207
- </p>
208
- </div>
209
- </div>
210
-
211
- <h3 class="section-bar">Public Instance methods</h3>
212
-
213
- <div id="method-M000062" class="method-detail">
214
- <a name="M000062"></a>
215
-
216
- <div class="method-heading">
217
- <a href="CGIWrapper.src/M000062.html" target="Code" class="method-signature"
218
- onclick="popupCode('CGIWrapper.src/M000062.html');return false;">
219
- <span class="method-name">args</span><span class="method-args">()</span>
220
- </a>
221
- </div>
222
-
223
- <div class="method-description">
224
- <p>
225
- Used to wrap the normal args variable used inside CGI.
226
- </p>
227
- </div>
228
- </div>
229
-
230
- <div id="method-M000063" class="method-detail">
231
- <a name="M000063"></a>
232
-
233
- <div class="method-heading">
234
- <a href="CGIWrapper.src/M000063.html" target="Code" class="method-signature"
235
- onclick="popupCode('CGIWrapper.src/M000063.html');return false;">
236
- <span class="method-name">env_table</span><span class="method-args">()</span>
237
- </a>
238
- </div>
239
-
240
- <div class="method-description">
241
- <p>
242
- Used to wrap the normal <a href="CGIWrapper.html#M000063">env_table</a>
243
- variable used inside CGI.
244
- </p>
245
- </div>
246
- </div>
247
-
248
- <div id="method-M000058" class="method-detail">
249
- <a name="M000058"></a>
250
-
251
- <div class="method-heading">
252
- <a href="CGIWrapper.src/M000058.html" target="Code" class="method-signature"
253
- onclick="popupCode('CGIWrapper.src/M000058.html');return false;">
254
- <span class="method-name">header</span><span class="method-args">(options = &quot;text/html&quot;)</span>
255
- </a>
256
- </div>
257
-
258
- <div class="method-description">
259
- <p>
260
- The header is typically called to send back the header. In our case we
261
- collect it into a hash for later usage.
262
- </p>
263
- <p>
264
- nph &#8212; Mostly ignored. It&#8216;ll output the date. connection &#8212;
265
- Completely ignored. Why is CGI doing this? length &#8212; Ignored since <a
266
- href="../Mongrel.html">Mongrel</a> figures this out from what you write to
267
- output.
268
- </p>
269
- </div>
270
- </div>
271
-
272
- <div id="method-M000060" class="method-detail">
273
- <a name="M000060"></a>
274
-
275
- <div class="method-heading">
276
- <a href="CGIWrapper.src/M000060.html" target="Code" class="method-signature"
277
- onclick="popupCode('CGIWrapper.src/M000060.html');return false;">
278
- <span class="method-name">out</span><span class="method-args">(options = &quot;text/html&quot;) {||| &quot;&quot;)| ...}</span>
279
- </a>
280
- </div>
281
-
282
- <div class="method-description">
283
- <p>
284
- The dumb thing is people can call header or this or both and in any order.
285
- So, we just reuse header and then finalize the <a
286
- href="HttpResponse.html">HttpResponse</a> the right way. Status is taken
287
- from the various options and converted to what <a
288
- href="../Mongrel.html">Mongrel</a> needs via the <a
289
- href="CGIWrapper.html#M000061">CGIWrapper.status</a> function.
290
- </p>
291
- </div>
292
- </div>
293
-
294
- <div id="method-M000059" class="method-detail">
295
- <a name="M000059"></a>
296
-
297
- <div class="method-heading">
298
- <a href="CGIWrapper.src/M000059.html" target="Code" class="method-signature"
299
- onclick="popupCode('CGIWrapper.src/M000059.html');return false;">
300
- <span class="method-name">send_cookies</span><span class="method-args">(to)</span>
301
- </a>
302
- </div>
303
-
304
- <div class="method-description">
305
- <p>
306
- Takes any &#8216;cookie&#8217; setting and sends it over the <a
307
- href="../Mongrel.html">Mongrel</a> header, then removes the setting from
308
- the options. If cookie is an Array or Hash then it sends those on with
309
- .to_s, otherwise it just calls .to_s on it and hopefully your
310
- &quot;cookie&quot; can write itself correctly.
311
- </p>
312
- </div>
313
- </div>
314
-
315
- <div id="method-M000061" class="method-detail">
316
- <a name="M000061"></a>
317
-
318
- <div class="method-heading">
319
- <a href="CGIWrapper.src/M000061.html" target="Code" class="method-signature"
320
- onclick="popupCode('CGIWrapper.src/M000061.html');return false;">
321
- <span class="method-name">status</span><span class="method-args">()</span>
322
- </a>
323
- </div>
324
-
325
- <div class="method-description">
326
- <p>
327
- Computes the status once, but lazily so that people who call header twice
328
- don&#8217;t get penalized. Because CGI insists on including the options
329
- status message in the status we have to do a bit of parsing.
330
- </p>
331
- </div>
332
- </div>
333
-
334
- <div id="method-M000064" class="method-detail">
335
- <a name="M000064"></a>
336
-
337
- <div class="method-heading">
338
- <a href="CGIWrapper.src/M000064.html" target="Code" class="method-signature"
339
- onclick="popupCode('CGIWrapper.src/M000064.html');return false;">
340
- <span class="method-name">stdinput</span><span class="method-args">()</span>
341
- </a>
342
- </div>
343
-
344
- <div class="method-description">
345
- <p>
346
- Used to wrap the normal stdinput variable used inside CGI.
347
- </p>
348
- </div>
349
- </div>
350
-
351
- <div id="method-M000065" class="method-detail">
352
- <a name="M000065"></a>
353
-
354
- <div class="method-heading">
355
- <a href="CGIWrapper.src/M000065.html" target="Code" class="method-signature"
356
- onclick="popupCode('CGIWrapper.src/M000065.html');return false;">
357
- <span class="method-name">stdoutput</span><span class="method-args">()</span>
358
- </a>
359
- </div>
360
-
361
- <div class="method-description">
362
- <p>
363
- The stdoutput should be completely bypassed but we&#8217;ll drop a warning
364
- just in case
365
- </p>
366
- </div>
367
- </div>
368
-
369
-
370
- </div>
371
-
372
-
373
- </div>
374
-
375
-
376
- <div id="validator-badges">
377
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
378
- </div>
379
-
380
- </body>
381
- </html>
@@ -1,24 +0,0 @@
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>new (Mongrel::CGIWrapper)</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/cgi.rb, line 34</span>
14
- 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
15
- 35: <span class="ruby-ivar">@request</span> = <span class="ruby-identifier">request</span>
16
- 36: <span class="ruby-ivar">@response</span> = <span class="ruby-identifier">response</span>
17
- 37: <span class="ruby-ivar">@args</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
18
- 38: <span class="ruby-ivar">@input</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>)
19
- 39: <span class="ruby-ivar">@head</span> = {}
20
- 40: <span class="ruby-ivar">@out_called</span> = <span class="ruby-keyword kw">false</span>
21
- 41: <span class="ruby-keyword kw">super</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
22
- 42: <span class="ruby-keyword kw">end</span></pre>
23
- </body>
24
- </html>
@@ -1,47 +0,0 @@
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>header (Mongrel::CGIWrapper)</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/cgi.rb, line 51</span>
14
- 51: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">header</span>(<span class="ruby-identifier">options</span> = <span class="ruby-value str">&quot;text/html&quot;</span>)
15
- 52: <span class="ruby-comment cmt"># if they pass in a string then just write the Content-Type</span>
16
- 53: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
17
- 54: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-identifier">options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Content-Type'</span>]
18
- 55: <span class="ruby-keyword kw">else</span>
19
- 56: <span class="ruby-comment cmt"># convert the given options into what Mongrel wants</span>
20
- 57: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">'type'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;text/html&quot;</span>
21
- 58: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Content-Type'</span>] <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;; charset=&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'charset'</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-value str">&quot;charset&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'charset'</span>]
22
- 59:
23
- 60: <span class="ruby-comment cmt"># setup date only if they use nph</span>
24
- 61: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Date'</span>] = <span class="ruby-constant">CGI</span><span class="ruby-operator">::</span><span class="ruby-identifier">rfc1123_date</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'nph'</span>]
25
- 62:
26
- 63: <span class="ruby-comment cmt"># setup the server to use the default or what they set</span>
27
- 64: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Server'</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">'server'</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">env_table</span>[<span class="ruby-value str">'SERVER_SOFTWARE'</span>]
28
- 65:
29
- 66: <span class="ruby-comment cmt"># remaining possible options they can give</span>
30
- 67: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Status'</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">'status'</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'status'</span>]
31
- 68: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Content-Language'</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">'language'</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'language'</span>]
32
- 69: <span class="ruby-ivar">@head</span>[<span class="ruby-value str">'Expires'</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">'expires'</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'expires'</span>]
33
- 70:
34
- 71: <span class="ruby-comment cmt"># drop the keys we don't want anymore</span>
35
- 72: <span class="ruby-constant">REMOVED_KEYS</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">k</span>) }
36
- 73:
37
- 74: <span class="ruby-comment cmt"># finally just convert the rest raw (which puts 'cookie' directly)</span>
38
- 75: <span class="ruby-comment cmt"># 'cookie' is translated later as we write the header out</span>
39
- 76: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@head</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>}
40
- 77: <span class="ruby-keyword kw">end</span>
41
- 78:
42
- 79: <span class="ruby-comment cmt"># doing this fakes out the cgi library to think the headers are empty</span>
43
- 80: <span class="ruby-comment cmt"># we then do the real headers in the out function call later</span>
44
- 81: <span class="ruby-value str">&quot;&quot;</span>
45
- 82: <span class="ruby-keyword kw">end</span></pre>
46
- </body>
47
- </html>