thin 0.5.3-x86-mswin32-60 → 0.5.4-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of thin might be problematic. Click here for more details.

Files changed (52) hide show
  1. data/CHANGELOG +8 -0
  2. data/benchmark/previous.rb +14 -0
  3. data/benchmark/simple.rb +3 -38
  4. data/benchmark/utils.rb +51 -0
  5. data/bin/thin +1 -1
  6. data/example/config.ru +9 -2
  7. data/lib/thin.rb +1 -1
  8. data/lib/thin/connection.rb +4 -2
  9. data/lib/thin/response.rb +22 -14
  10. data/lib/thin/version.rb +2 -2
  11. data/lib/thin_parser.so +0 -0
  12. data/spec/response_spec.rb +22 -9
  13. data/spec/server_spec.rb +8 -3
  14. metadata +5 -56
  15. data/doc/rdoc/classes/Process.html +0 -181
  16. data/doc/rdoc/classes/Rack.html +0 -156
  17. data/doc/rdoc/classes/Rack/Adapter.html +0 -155
  18. data/doc/rdoc/classes/Rack/Adapter/Rails.html +0 -289
  19. data/doc/rdoc/classes/Rack/Adapter/Rails/CGIWrapper.html +0 -359
  20. data/doc/rdoc/classes/Rack/Handler.html +0 -155
  21. data/doc/rdoc/classes/Rack/Handler/Thin.html +0 -175
  22. data/doc/rdoc/classes/Thin.html +0 -164
  23. data/doc/rdoc/classes/Thin/Cluster.html +0 -399
  24. data/doc/rdoc/classes/Thin/Connection.html +0 -223
  25. data/doc/rdoc/classes/Thin/Daemonizable.html +0 -260
  26. data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +0 -197
  27. data/doc/rdoc/classes/Thin/Headers.html +0 -238
  28. data/doc/rdoc/classes/Thin/InvalidRequest.html +0 -144
  29. data/doc/rdoc/classes/Thin/Logging.html +0 -201
  30. data/doc/rdoc/classes/Thin/Request.html +0 -231
  31. data/doc/rdoc/classes/Thin/Response.html +0 -271
  32. data/doc/rdoc/classes/Thin/Server.html +0 -295
  33. data/doc/rdoc/classes/Thin/StopServer.html +0 -143
  34. data/doc/rdoc/created.rid +0 -1
  35. data/doc/rdoc/files/README.html +0 -226
  36. data/doc/rdoc/files/bin/thin.html +0 -245
  37. data/doc/rdoc/files/lib/rack/adapter/rails_rb.html +0 -146
  38. data/doc/rdoc/files/lib/rack/handler/thin_rb.html +0 -146
  39. data/doc/rdoc/files/lib/thin/cluster_rb.html +0 -146
  40. data/doc/rdoc/files/lib/thin/connection_rb.html +0 -145
  41. data/doc/rdoc/files/lib/thin/daemonizing_rb.html +0 -146
  42. data/doc/rdoc/files/lib/thin/headers_rb.html +0 -146
  43. data/doc/rdoc/files/lib/thin/logging_rb.html +0 -146
  44. data/doc/rdoc/files/lib/thin/request_rb.html +0 -145
  45. data/doc/rdoc/files/lib/thin/response_rb.html +0 -145
  46. data/doc/rdoc/files/lib/thin/server_rb.html +0 -145
  47. data/doc/rdoc/files/lib/thin/statuses_rb.html +0 -145
  48. data/doc/rdoc/files/lib/thin/version_rb.html +0 -145
  49. data/doc/rdoc/files/lib/thin_rb.html +0 -152
  50. data/doc/rdoc/index.html +0 -10
  51. data/doc/rdoc/logo.gif +0 -0
  52. data/doc/rdoc/rdoc-style.css +0 -55
@@ -1,289 +0,0 @@
1
-
2
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
- <html>
4
- <head>
5
- <title>
6
- thin &raquo; Class: Rack::Adapter::Rails
7
- </title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
10
- <script language="JavaScript" type="text/javascript">
11
- // <![CDATA[
12
-
13
- function toggleSource( id )
14
- {
15
- var elem
16
- var link
17
-
18
- if( document.getElementById )
19
- {
20
- elem = document.getElementById( id )
21
- link = document.getElementById( "l_" + id )
22
- }
23
- else if ( document.all )
24
- {
25
- elem = eval( "document.all." + id )
26
- link = eval( "document.all.l_" + id )
27
- }
28
- else
29
- return false;
30
-
31
- if( elem.style.display == "block" )
32
- {
33
- elem.style.display = "none"
34
- link.innerHTML = "show source"
35
- }
36
- else
37
- {
38
- elem.style.display = "block"
39
- link.innerHTML = "hide source"
40
- }
41
- }
42
-
43
- function openCode( url )
44
- {
45
- window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
- }
47
- // ]]>
48
- </script>
49
- </head>
50
- <body>
51
- <ul id="menu">
52
- <li><a href="/thin/">about</a></li>
53
- <li><a href="/thin/download/">download</a></li>
54
- <li><a href="/thin/usage/">usage</a></li>
55
- <li><a href="/thin/doc/">doc</a></li>
56
- <li><a href="http://groups.google.com/group/thin-ruby/">community</a></li>
57
- </ul>
58
- <div id="sidebar">
59
- <h2>Files</h2>
60
- <ul class="list">
61
- <li><a href="../../../files/README.html" value="File: README">README</a></li>
62
- <li><a href="../../../files/lib/rack/adapter/rails_rb.html" value="File: rails.rb">lib/rack/adapter/rails.rb</a></li>
63
- <li><a href="../../../files/lib/rack/handler/thin_rb.html" value="File: thin.rb">lib/rack/handler/thin.rb</a></li>
64
- <li><a href="../../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
65
- <li><a href="../../../files/lib/thin/connection_rb.html" value="File: connection.rb">lib/thin/connection.rb</a></li>
66
- <li><a href="../../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
67
- <li><a href="../../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
68
- <li><a href="../../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
69
- <li><a href="../../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
70
- <li><a href="../../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
71
- <li><a href="../../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
72
- <li><a href="../../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
73
- <li><a href="../../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
74
- <li><a href="../../../files/lib/thin_rb.html" value="File: thin.rb">lib/thin.rb</a></li>
75
- <li><a href="../../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
76
- </ul>
77
-
78
- <h2>Classes</h2>
79
- <ul class="list">
80
- <li><a href="../../../classes/Rack.html" title="Module: Rack">Rack</a></li>
81
- <li><a href="../../../classes/Rack/Adapter.html" title="Module: Rack::Adapter">Rack::Adapter</a></li>
82
- <li><a href="../../../classes/Rack/Adapter/Rails.html" title="Class: Rack::Adapter::Rails">Rack::Adapter::Rails</a></li>
83
- <li><a href="../../../classes/Rack/Adapter/Rails/CGIWrapper.html" title="Class: Rack::Adapter::Rails::CGIWrapper">Rack::Adapter::Rails::CGIWrapper</a></li>
84
- <li><a href="../../../classes/Rack/Handler.html" title="Module: Rack::Handler">Rack::Handler</a></li>
85
- <li><a href="../../../classes/Rack/Handler/Thin.html" title="Class: Rack::Handler::Thin">Rack::Handler::Thin</a></li>
86
- <li><a href="../../../classes/Thin.html" title="Module: Thin">Thin</a></li>
87
- <li><a href="../../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
88
- <li><a href="../../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
89
- <li><a href="../../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
90
- <li><a href="../../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
91
- <li><a href="../../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
92
- <li><a href="../../../classes/Thin/StopServer.html" title="Class: Thin::StopServer">Thin::StopServer</a></li>
93
- <li><a href="../../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
94
- <li><a href="../../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
95
- <li><a href="../../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
96
- <li><a href="../../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
97
- <li><a href="../../../classes/Thin/Connection.html" title="Class: Thin::Connection">Thin::Connection</a></li>
98
- <li><a href="../../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
99
- <li><a href="../../../classes/Process.html" title="Module: Process">Process</a></li>
100
- </ul>
101
- </div>
102
- <div id="container">
103
- <div id="header">
104
- <a href="/thin/" title="Home">
105
- <img id="logo" src="../../../logo.gif" />
106
- </a>
107
- <h2 id="tag_line">A fast and very simple Ruby web server</h2>
108
- </div>
109
-
110
- <div id="content">
111
- <h2>Class: Rack::Adapter::Rails</h2>
112
-
113
-
114
- <div id="Rack::Adapter::Rails" class="page_shade">
115
- <div class="page">
116
- <h3>Class Rack::Adapter::Rails &lt; Object</h3>
117
-
118
- <span class="path">(in files
119
- <a href="../../../files/lib/rack/adapter/rails_rb.html">lib/rack/adapter/rails.rb</a>
120
- )</span>
121
-
122
- <p>
123
- <a href="Rack/Adapter.html">Adapter</a> to run a Rails app with any
124
- supported <a href="Rack.html">Rack</a> handler. By default it will try to
125
- load the Rails application in the current directory in the development
126
- environment. Options:
127
- </p>
128
- <pre>
129
- root: Root directory of the Rails app
130
- env: Rails environment to run in (development, production or test)
131
- </pre>
132
- <p>
133
- Based on <a href="http://fuzed.rubyforge.org">fuzed.rubyforge.org</a>/
134
- Rails adapter
135
- </p>
136
-
137
-
138
-
139
-
140
-
141
- <h2 class="ruled">Methods</h2>
142
- <h4 class="ruled">
143
- <span class="method-type" title="Public Class method">Public Class</span>
144
- <strong><a name="M000005" href="#M000005" title="Permalink to Public Class method: new">new(options={})</a></strong>
145
- </h4>
146
-
147
-
148
- <div class="sourcecode">
149
- <p class="source-link">[ <a href="javascript:toggleSource('M000005_source')" id="l_M000005_source">show source</a> ]</p>
150
- <div id="M000005_source" class="dyn-source">
151
- <pre>
152
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 16</span>
153
- 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>={})
154
- 17: <span class="ruby-ivar">@root</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:root</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
155
- 18: <span class="ruby-ivar">@env</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:environment</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'development'</span>
156
- 19: <span class="ruby-ivar">@prefix</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:prefix</span>]
157
- 20:
158
- 21: <span class="ruby-identifier">load_application</span>
159
- 22:
160
- 23: <span class="ruby-ivar">@file_server</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">&quot;public&quot;</span>))
161
- 24: <span class="ruby-keyword kw">end</span>
162
- </pre>
163
- </div>
164
- </div>
165
- <h4 class="ruled">
166
- <span class="method-type" title="Public Instance method">Public Instance</span>
167
- <strong><a name="M000010" href="#M000010" title="Permalink to Public Instance method: call">call(env)</a></strong>
168
- </h4>
169
-
170
-
171
- <div class="sourcecode">
172
- <p class="source-link">[ <a href="javascript:toggleSource('M000010_source')" id="l_M000010_source">show source</a> ]</p>
173
- <div id="M000010_source" class="dyn-source">
174
- <pre>
175
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 57</span>
176
- 57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
177
- 58: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">env</span>[<span class="ruby-value str">'PATH_INFO'</span>].<span class="ruby-identifier">chomp</span>(<span class="ruby-value str">'/'</span>)
178
- 59: <span class="ruby-identifier">cached_path</span> = (<span class="ruby-identifier">path</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-value str">'index'</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">path</span>) <span class="ruby-operator">+</span> <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">page_cache_extension</span>
179
- 60:
180
- 61: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">file_exist?</span>(<span class="ruby-identifier">path</span>) <span class="ruby-comment cmt"># Serve the file if it's there</span>
181
- 62: <span class="ruby-identifier">serve_file</span>(<span class="ruby-identifier">env</span>)
182
- 63: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">file_exist?</span>(<span class="ruby-identifier">cached_path</span>) <span class="ruby-comment cmt"># Serve the page cache if it's there</span>
183
- 64: <span class="ruby-identifier">env</span>[<span class="ruby-value str">'PATH_INFO'</span>] = <span class="ruby-identifier">cached_path</span>
184
- 65: <span class="ruby-identifier">serve_file</span>(<span class="ruby-identifier">env</span>)
185
- 66: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># No static file, let Rails handle it</span>
186
- 67: <span class="ruby-identifier">serve_rails</span>(<span class="ruby-identifier">env</span>)
187
- 68: <span class="ruby-keyword kw">end</span>
188
- 69: <span class="ruby-keyword kw">end</span>
189
- </pre>
190
- </div>
191
- </div>
192
- <h4 class="ruled">
193
- <span class="method-type" title="Public Instance method">Public Instance</span>
194
- <strong><a name="M000007" href="#M000007" title="Permalink to Public Instance method: file_exist?">file_exist?(path)</a></strong>
195
- </h4>
196
-
197
- <p>
198
- TODO refactor this in File#can_serve?(path) ??
199
- </p>
200
-
201
- <div class="sourcecode">
202
- <p class="source-link">[ <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show source</a> ]</p>
203
- <div id="M000007_source" class="dyn-source">
204
- <pre>
205
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 36</span>
206
- 36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_exist?</span>(<span class="ruby-identifier">path</span>)
207
- 37: <span class="ruby-identifier">full_path</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@file_server</span>.<span class="ruby-identifier">root</span>, <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">path</span>))
208
- 38: <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">full_path</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">readable?</span>(<span class="ruby-identifier">full_path</span>)
209
- 39: <span class="ruby-keyword kw">end</span>
210
- </pre>
211
- </div>
212
- </div>
213
- <h4 class="ruled">
214
- <span class="method-type" title="Public Instance method">Public Instance</span>
215
- <strong><a name="M000006" href="#M000006" title="Permalink to Public Instance method: load_application">load_application()</a></strong>
216
- </h4>
217
-
218
-
219
- <div class="sourcecode">
220
- <p class="source-link">[ <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">show source</a> ]</p>
221
- <div id="M000006_source" class="dyn-source">
222
- <pre>
223
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 26</span>
224
- 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_application</span>
225
- 27: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'RAILS_ENV'</span>] = <span class="ruby-ivar">@env</span>
226
- 28:
227
- 29: <span class="ruby-identifier">require</span> <span class="ruby-node">&quot;#{@root}/config/environment&quot;</span>
228
- 30: <span class="ruby-identifier">require</span> <span class="ruby-value str">'dispatcher'</span>
229
- 31:
230
- 32: <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">AbstractRequest</span>.<span class="ruby-identifier">relative_url_root</span> = <span class="ruby-ivar">@prefix</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@prefix</span>
231
- 33: <span class="ruby-keyword kw">end</span>
232
- </pre>
233
- </div>
234
- </div>
235
- <h4 class="ruled">
236
- <span class="method-type" title="Public Instance method">Public Instance</span>
237
- <strong><a name="M000008" href="#M000008" title="Permalink to Public Instance method: serve_file">serve_file(env)</a></strong>
238
- </h4>
239
-
240
-
241
- <div class="sourcecode">
242
- <p class="source-link">[ <a href="javascript:toggleSource('M000008_source')" id="l_M000008_source">show source</a> ]</p>
243
- <div id="M000008_source" class="dyn-source">
244
- <pre>
245
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 41</span>
246
- 41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">serve_file</span>(<span class="ruby-identifier">env</span>)
247
- 42: <span class="ruby-ivar">@file_server</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
248
- 43: <span class="ruby-keyword kw">end</span>
249
- </pre>
250
- </div>
251
- </div>
252
- <h4 class="ruled">
253
- <span class="method-type" title="Public Instance method">Public Instance</span>
254
- <strong><a name="M000009" href="#M000009" title="Permalink to Public Instance method: serve_rails">serve_rails(env)</a></strong>
255
- </h4>
256
-
257
-
258
- <div class="sourcecode">
259
- <p class="source-link">[ <a href="javascript:toggleSource('M000009_source')" id="l_M000009_source">show source</a> ]</p>
260
- <div id="M000009_source" class="dyn-source">
261
- <pre>
262
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 45</span>
263
- 45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">serve_rails</span>(<span class="ruby-identifier">env</span>)
264
- 46: <span class="ruby-identifier">request</span> = <span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
265
- 47: <span class="ruby-identifier">response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>
266
- 48:
267
- 49: <span class="ruby-identifier">session_options</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">CgiRequest</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_SESSION_OPTIONS</span>
268
- 50: <span class="ruby-identifier">cgi</span> = <span class="ruby-constant">CGIWrapper</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
269
- 51:
270
- 52: <span class="ruby-constant">Dispatcher</span>.<span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">cgi</span>, <span class="ruby-identifier">session_options</span>, <span class="ruby-identifier">response</span>)
271
- 53:
272
- 54: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">finish</span>
273
- 55: <span class="ruby-keyword kw">end</span>
274
- </pre>
275
- </div>
276
- </div>
277
-
278
- </div>
279
- </div>
280
-
281
-
282
- </div>
283
- </div>
284
- <div id="footer">
285
- <hr />
286
- &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
287
- </div>
288
- </body>
289
- </html>
@@ -1,359 +0,0 @@
1
-
2
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
- <html>
4
- <head>
5
- <title>
6
- thin &raquo; Class: Rack::Adapter::Rails::CGIWrapper
7
- </title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
10
- <script language="JavaScript" type="text/javascript">
11
- // <![CDATA[
12
-
13
- function toggleSource( id )
14
- {
15
- var elem
16
- var link
17
-
18
- if( document.getElementById )
19
- {
20
- elem = document.getElementById( id )
21
- link = document.getElementById( "l_" + id )
22
- }
23
- else if ( document.all )
24
- {
25
- elem = eval( "document.all." + id )
26
- link = eval( "document.all.l_" + id )
27
- }
28
- else
29
- return false;
30
-
31
- if( elem.style.display == "block" )
32
- {
33
- elem.style.display = "none"
34
- link.innerHTML = "show source"
35
- }
36
- else
37
- {
38
- elem.style.display = "block"
39
- link.innerHTML = "hide source"
40
- }
41
- }
42
-
43
- function openCode( url )
44
- {
45
- window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
- }
47
- // ]]>
48
- </script>
49
- </head>
50
- <body>
51
- <ul id="menu">
52
- <li><a href="/thin/">about</a></li>
53
- <li><a href="/thin/download/">download</a></li>
54
- <li><a href="/thin/usage/">usage</a></li>
55
- <li><a href="/thin/doc/">doc</a></li>
56
- <li><a href="http://groups.google.com/group/thin-ruby/">community</a></li>
57
- </ul>
58
- <div id="sidebar">
59
- <h2>Files</h2>
60
- <ul class="list">
61
- <li><a href="../../../../files/README.html" value="File: README">README</a></li>
62
- <li><a href="../../../../files/lib/rack/adapter/rails_rb.html" value="File: rails.rb">lib/rack/adapter/rails.rb</a></li>
63
- <li><a href="../../../../files/lib/rack/handler/thin_rb.html" value="File: thin.rb">lib/rack/handler/thin.rb</a></li>
64
- <li><a href="../../../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
65
- <li><a href="../../../../files/lib/thin/connection_rb.html" value="File: connection.rb">lib/thin/connection.rb</a></li>
66
- <li><a href="../../../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
67
- <li><a href="../../../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
68
- <li><a href="../../../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
69
- <li><a href="../../../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
70
- <li><a href="../../../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
71
- <li><a href="../../../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
72
- <li><a href="../../../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
73
- <li><a href="../../../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
74
- <li><a href="../../../../files/lib/thin_rb.html" value="File: thin.rb">lib/thin.rb</a></li>
75
- <li><a href="../../../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
76
- </ul>
77
-
78
- <h2>Classes</h2>
79
- <ul class="list">
80
- <li><a href="../../../../classes/Rack.html" title="Module: Rack">Rack</a></li>
81
- <li><a href="../../../../classes/Rack/Adapter.html" title="Module: Rack::Adapter">Rack::Adapter</a></li>
82
- <li><a href="../../../../classes/Rack/Adapter/Rails.html" title="Class: Rack::Adapter::Rails">Rack::Adapter::Rails</a></li>
83
- <li><a href="../../../../classes/Rack/Adapter/Rails/CGIWrapper.html" title="Class: Rack::Adapter::Rails::CGIWrapper">Rack::Adapter::Rails::CGIWrapper</a></li>
84
- <li><a href="../../../../classes/Rack/Handler.html" title="Module: Rack::Handler">Rack::Handler</a></li>
85
- <li><a href="../../../../classes/Rack/Handler/Thin.html" title="Class: Rack::Handler::Thin">Rack::Handler::Thin</a></li>
86
- <li><a href="../../../../classes/Thin.html" title="Module: Thin">Thin</a></li>
87
- <li><a href="../../../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
88
- <li><a href="../../../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
89
- <li><a href="../../../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
90
- <li><a href="../../../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
91
- <li><a href="../../../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
92
- <li><a href="../../../../classes/Thin/StopServer.html" title="Class: Thin::StopServer">Thin::StopServer</a></li>
93
- <li><a href="../../../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
94
- <li><a href="../../../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
95
- <li><a href="../../../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
96
- <li><a href="../../../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
97
- <li><a href="../../../../classes/Thin/Connection.html" title="Class: Thin::Connection">Thin::Connection</a></li>
98
- <li><a href="../../../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
99
- <li><a href="../../../../classes/Process.html" title="Module: Process">Process</a></li>
100
- </ul>
101
- </div>
102
- <div id="container">
103
- <div id="header">
104
- <a href="/thin/" title="Home">
105
- <img id="logo" src="../../../../logo.gif" />
106
- </a>
107
- <h2 id="tag_line">A fast and very simple Ruby web server</h2>
108
- </div>
109
-
110
- <div id="content">
111
- <h2>Class: Rack::Adapter::Rails::CGIWrapper</h2>
112
-
113
-
114
- <div id="Rack::Adapter::Rails::CGIWrapper" class="page_shade">
115
- <div class="page">
116
- <h3>Class Rack::Adapter::Rails::CGIWrapper &lt; ::CGI</h3>
117
-
118
- <span class="path">(in files
119
- <a href="../../../../files/lib/rack/adapter/rails_rb.html">lib/rack/adapter/rails.rb</a>
120
- )</span>
121
-
122
- <p>
123
- <a href="Rack/Adapter.html">Adapter</a> to run a Rails app with any
124
- supported <a href="Rack.html">Rack</a> handler. By default it will try to
125
- load the Rails application in the current directory in the development
126
- environment. Options:
127
- </p>
128
- <pre>
129
- root: Root directory of the Rails app
130
- env: Rails environment to run in (development, production or test)
131
- </pre>
132
- <p>
133
- Based on <a href="http://fuzed.rubyforge.org">fuzed.rubyforge.org</a>/
134
- Rails adapter
135
- </p>
136
-
137
-
138
-
139
-
140
-
141
- <h2 class="ruled">Methods</h2>
142
- <h4 class="ruled">
143
- <span class="method-type" title="Public Class method">Public Class</span>
144
- <strong><a name="M000011" href="#M000011" title="Permalink to Public Class method: new">new(request, response, *args)</a></strong>
145
- </h4>
146
-
147
-
148
- <div class="sourcecode">
149
- <p class="source-link">[ <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show source</a> ]</p>
150
- <div id="M000011_source" class="dyn-source">
151
- <pre>
152
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 74</span>
153
- 74: <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>)
154
- 75: <span class="ruby-ivar">@request</span> = <span class="ruby-identifier">request</span>
155
- 76: <span class="ruby-ivar">@response</span> = <span class="ruby-identifier">response</span>
156
- 77: <span class="ruby-ivar">@args</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
157
- 78: <span class="ruby-ivar">@input</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>
158
- 79:
159
- 80: <span class="ruby-keyword kw">super</span> <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
160
- 81: <span class="ruby-keyword kw">end</span>
161
- </pre>
162
- </div>
163
- </div>
164
- <h4 class="ruled">
165
- <span class="method-type" title="Public Instance method">Public Instance</span>
166
- <strong><a name="M000016" href="#M000016" title="Permalink to Public Instance method: args">args()</a></strong>
167
- </h4>
168
-
169
- <p>
170
- Used to wrap the normal <a href="CGIWrapper.html#M000016">args</a> variable
171
- used inside CGI.
172
- </p>
173
-
174
- <div class="sourcecode">
175
- <p class="source-link">[ <a href="javascript:toggleSource('M000016_source')" id="l_M000016_source">show source</a> ]</p>
176
- <div id="M000016_source" class="dyn-source">
177
- <pre>
178
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 134</span>
179
- 134: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">args</span>
180
- 135: <span class="ruby-ivar">@args</span>
181
- 136: <span class="ruby-keyword kw">end</span>
182
- </pre>
183
- </div>
184
- </div>
185
- <h4 class="ruled">
186
- <span class="method-type" title="Public Instance method">Public Instance</span>
187
- <strong><a name="M000014" href="#M000014" title="Permalink to Public Instance method: cookies">cookies()</a></strong>
188
- </h4>
189
-
190
-
191
- <div class="sourcecode">
192
- <p class="source-link">[ <a href="javascript:toggleSource('M000014_source')" id="l_M000014_source">show source</a> ]</p>
193
- <div id="M000014_source" class="dyn-source">
194
- <pre>
195
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 125</span>
196
- 125: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cookies</span>
197
- 126: <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">cookies</span>
198
- 127: <span class="ruby-keyword kw">end</span>
199
- </pre>
200
- </div>
201
- </div>
202
- <h4 class="ruled">
203
- <span class="method-type" title="Public Instance method">Public Instance</span>
204
- <strong><a name="M000017" href="#M000017" title="Permalink to Public Instance method: env_table">env_table()</a></strong>
205
- </h4>
206
-
207
- <p>
208
- Used to wrap the normal <a href="CGIWrapper.html#M000017">env_table</a>
209
- variable used inside CGI.
210
- </p>
211
-
212
- <div class="sourcecode">
213
- <p class="source-link">[ <a href="javascript:toggleSource('M000017_source')" id="l_M000017_source">show source</a> ]</p>
214
- <div id="M000017_source" class="dyn-source">
215
- <pre>
216
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 139</span>
217
- 139: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">env_table</span>
218
- 140: <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>
219
- 141: <span class="ruby-keyword kw">end</span>
220
- </pre>
221
- </div>
222
- </div>
223
- <h4 class="ruled">
224
- <span class="method-type" title="Public Instance method">Public Instance</span>
225
- <strong><a name="M000012" href="#M000012" title="Permalink to Public Instance method: header">header(options = &quot;text/html&quot;)</a></strong>
226
- </h4>
227
-
228
-
229
- <div class="sourcecode">
230
- <p class="source-link">[ <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show source</a> ]</p>
231
- <div id="M000012_source" class="dyn-source">
232
- <pre>
233
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 83</span>
234
- 83: <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>)
235
- 84: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
236
- 85: <span class="ruby-ivar">@response</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">@response</span>[<span class="ruby-value str">'Content-Type'</span>]
237
- 86: <span class="ruby-keyword kw">else</span>
238
- 87: <span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Content-Length'</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'Content-Length'</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'Content-Length'</span>]
239
- 88:
240
- 89: <span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'type'</span>) <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;text/html&quot;</span>
241
- 90: <span class="ruby-ivar">@response</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-identifier">delete</span>(<span class="ruby-value str">'charset'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">'charset'</span>]
242
- 91:
243
- 92: <span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Content-Language'</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</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>]
244
- 93: <span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Expires'</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</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>]
245
- 94:
246
- 95: <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">status</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</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>]
247
- 96:
248
- 97: <span class="ruby-comment cmt"># Convert 'cookie' header to 'Set-Cookie' headers.</span>
249
- 98: <span class="ruby-comment cmt"># Because Set-Cookie header can appear more the once in the response body, </span>
250
- 99: <span class="ruby-comment cmt"># we store it in a line break seperated string that will be translated to</span>
251
- 100: <span class="ruby-comment cmt"># multiple Set-Cookie header by the handler.</span>
252
- 101: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cookie</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'cookie'</span>)
253
- 102: <span class="ruby-identifier">cookies</span> = []
254
- 103:
255
- 104: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">cookie</span>
256
- 105: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cookies</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span> }
257
- 106: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Hash</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">_</span>, <span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cookies</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span> }
258
- 107: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">cookies</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">to_s</span>
259
- 108: <span class="ruby-keyword kw">end</span>
260
- 109:
261
- 110: <span class="ruby-ivar">@output_cookies</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cookies</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span> } <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@output_cookies</span>
262
- 111:
263
- 112: <span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Set-Cookie'</span>] = [<span class="ruby-ivar">@response</span>[<span class="ruby-value str">'Set-Cookie'</span>], <span class="ruby-identifier">cookies</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
264
- 113: <span class="ruby-keyword kw">end</span>
265
- 114:
266
- 115: <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">@response</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span> }
267
- 116: <span class="ruby-keyword kw">end</span>
268
- 117:
269
- 118: <span class="ruby-value str">&quot;&quot;</span>
270
- 119: <span class="ruby-keyword kw">end</span>
271
- </pre>
272
- </div>
273
- </div>
274
- <h4 class="ruled">
275
- <span class="method-type" title="Public Instance method">Public Instance</span>
276
- <strong><a name="M000013" href="#M000013" title="Permalink to Public Instance method: params">params()</a></strong>
277
- </h4>
278
-
279
-
280
- <div class="sourcecode">
281
- <p class="source-link">[ <a href="javascript:toggleSource('M000013_source')" id="l_M000013_source">show source</a> ]</p>
282
- <div id="M000013_source" class="dyn-source">
283
- <pre>
284
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 121</span>
285
- 121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">params</span>
286
- 122: <span class="ruby-ivar">@params</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">params</span>
287
- 123: <span class="ruby-keyword kw">end</span>
288
- </pre>
289
- </div>
290
- </div>
291
- <h4 class="ruled">
292
- <span class="method-type" title="Public Instance method">Public Instance</span>
293
- <strong><a name="M000015" href="#M000015" title="Permalink to Public Instance method: query_string">query_string()</a></strong>
294
- </h4>
295
-
296
-
297
- <div class="sourcecode">
298
- <p class="source-link">[ <a href="javascript:toggleSource('M000015_source')" id="l_M000015_source">show source</a> ]</p>
299
- <div id="M000015_source" class="dyn-source">
300
- <pre>
301
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 129</span>
302
- 129: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query_string</span>
303
- 130: <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">query_string</span>
304
- 131: <span class="ruby-keyword kw">end</span>
305
- </pre>
306
- </div>
307
- </div>
308
- <h4 class="ruled">
309
- <span class="method-type" title="Public Instance method">Public Instance</span>
310
- <strong><a name="M000018" href="#M000018" title="Permalink to Public Instance method: stdinput">stdinput()</a></strong>
311
- </h4>
312
-
313
- <p>
314
- Used to wrap the normal <a href="CGIWrapper.html#M000018">stdinput</a>
315
- variable used inside CGI.
316
- </p>
317
-
318
- <div class="sourcecode">
319
- <p class="source-link">[ <a href="javascript:toggleSource('M000018_source')" id="l_M000018_source">show source</a> ]</p>
320
- <div id="M000018_source" class="dyn-source">
321
- <pre>
322
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 144</span>
323
- 144: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdinput</span>
324
- 145: <span class="ruby-ivar">@input</span>
325
- 146: <span class="ruby-keyword kw">end</span>
326
- </pre>
327
- </div>
328
- </div>
329
- <h4 class="ruled">
330
- <span class="method-type" title="Public Instance method">Public Instance</span>
331
- <strong><a name="M000019" href="#M000019" title="Permalink to Public Instance method: stdoutput">stdoutput()</a></strong>
332
- </h4>
333
-
334
-
335
- <div class="sourcecode">
336
- <p class="source-link">[ <a href="javascript:toggleSource('M000019_source')" id="l_M000019_source">show source</a> ]</p>
337
- <div id="M000019_source" class="dyn-source">
338
- <pre>
339
- <span class="ruby-comment cmt"># File lib/rack/adapter/rails.rb, line 148</span>
340
- 148: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdoutput</span>
341
- 149: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;stdoutput should not be used.&quot;</span>
342
- 150: <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">body</span>
343
- 151: <span class="ruby-keyword kw">end</span>
344
- </pre>
345
- </div>
346
- </div>
347
-
348
- </div>
349
- </div>
350
-
351
-
352
- </div>
353
- </div>
354
- <div id="footer">
355
- <hr />
356
- &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
357
- </div>
358
- </body>
359
- </html>