thin 0.3.0 → 0.4.0

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 (51) hide show
  1. data/README +47 -5
  2. data/Rakefile +33 -2
  3. data/doc/rdoc/classes/Kernel.html +182 -0
  4. data/doc/rdoc/classes/Process.html +175 -0
  5. data/doc/rdoc/classes/Thin.html +184 -0
  6. data/doc/rdoc/classes/Thin/CGIWrapper.html +438 -0
  7. data/doc/rdoc/classes/Thin/Cluster.html +392 -0
  8. data/doc/rdoc/classes/Thin/Command.html +221 -0
  9. data/doc/rdoc/classes/Thin/CommandError.html +154 -0
  10. data/doc/rdoc/classes/Thin/Commands.html +145 -0
  11. data/doc/rdoc/classes/Thin/Daemonizable.html +250 -0
  12. data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +203 -0
  13. data/doc/rdoc/classes/Thin/DirHandler.html +250 -0
  14. data/doc/rdoc/classes/Thin/Handler.html +195 -0
  15. data/doc/rdoc/classes/Thin/Headers.html +244 -0
  16. data/doc/rdoc/classes/Thin/InvalidRequest.html +150 -0
  17. data/doc/rdoc/classes/Thin/Logging.html +214 -0
  18. data/doc/rdoc/classes/Thin/RailsHandler.html +234 -0
  19. data/doc/rdoc/classes/Thin/RailsServer.html +175 -0
  20. data/doc/rdoc/classes/Thin/Request.html +379 -0
  21. data/doc/rdoc/classes/Thin/Response.html +311 -0
  22. data/doc/rdoc/classes/Thin/Server.html +381 -0
  23. data/doc/rdoc/created.rid +1 -0
  24. data/doc/rdoc/files/README.html +260 -0
  25. data/doc/rdoc/files/bin/thin.html +188 -0
  26. data/doc/rdoc/files/bin/thin_cluster.html +175 -0
  27. data/doc/rdoc/files/lib/thin/cgi_rb.html +263 -0
  28. data/doc/rdoc/files/lib/thin/cluster_rb.html +263 -0
  29. data/doc/rdoc/files/lib/thin/command_rb.html +263 -0
  30. data/doc/rdoc/files/lib/thin/consts_rb.html +263 -0
  31. data/doc/rdoc/files/lib/thin/daemonizing_rb.html +263 -0
  32. data/doc/rdoc/files/lib/thin/handler_rb.html +263 -0
  33. data/doc/rdoc/files/lib/thin/headers_rb.html +263 -0
  34. data/doc/rdoc/files/lib/thin/logging_rb.html +263 -0
  35. data/doc/rdoc/files/lib/thin/mime_types_rb.html +263 -0
  36. data/doc/rdoc/files/lib/thin/rails_rb.html +263 -0
  37. data/doc/rdoc/files/lib/thin/recipes_rb.html +171 -0
  38. data/doc/rdoc/files/lib/thin/request_rb.html +171 -0
  39. data/doc/rdoc/files/lib/thin/response_rb.html +171 -0
  40. data/doc/rdoc/files/lib/thin/server_rb.html +171 -0
  41. data/doc/rdoc/files/lib/thin/statuses_rb.html +171 -0
  42. data/doc/rdoc/files/lib/thin/version_rb.html +171 -0
  43. data/doc/rdoc/index.html +10 -0
  44. data/doc/rdoc/logo.gif +0 -0
  45. data/doc/rdoc/rdoc-style.css +86 -0
  46. data/lib/thin/commands/cluster/config.rb +2 -0
  47. data/lib/thin/consts.rb +4 -0
  48. data/lib/thin/request.rb +30 -11
  49. data/lib/thin/server.rb +1 -1
  50. data/lib/thin/version.rb +1 -1
  51. metadata +52 -1
@@ -0,0 +1,214 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ thin &raquo; Module: Thin::Logging
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/">home</a></li>
53
+ <li><a href="/thin/doc/">doc</a></li>
54
+ <li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
55
+ <li><a href="/thin/trac.fcgi/browser">code</a></li>
56
+ <li><a href="/thin/trac.fcgi/report">tickets</a></li>
57
+ <li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
58
+ </ul>
59
+ <div id="sidebar">
60
+ <h2>Files</h2>
61
+ <ul class="list">
62
+ <li><a href="../../files/README.html" value="File: README">README</a></li>
63
+ <li><a href="../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.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/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
66
+ <li><a href="../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
67
+ <li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
68
+ <li><a href="../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
69
+ <li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
70
+ <li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
71
+ <li><a href="../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
72
+ <li><a href="../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
73
+ <li><a href="../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
74
+ <li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
75
+ <li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
76
+ <li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
77
+ <li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
78
+ <li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
79
+ <li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
80
+ <li><a href="../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
81
+ </ul>
82
+
83
+ <h2>Classes</h2>
84
+ <ul class="list">
85
+ <li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
86
+ <li><a href="../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</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/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
92
+ <li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
93
+ <li><a href="../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
94
+ <li><a href="../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
95
+ <li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
96
+ <li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
97
+ <li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
98
+ <li><a href="../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
99
+ <li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
100
+ <li><a href="../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
101
+ <li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
102
+ <li><a href="../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
103
+ <li><a href="../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
104
+ <li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
105
+ <li><a href="../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
106
+ </ul>
107
+ </div>
108
+ <div id="container">
109
+ <div id="header">
110
+ <a href="/thin/" title="Home">
111
+ <img id="logo" src="../../logo.gif" />
112
+ </a>
113
+ <h2 id="tag_line">A fast and very simple Ruby web server</h2>
114
+ </div>
115
+
116
+ <div id="content">
117
+ <h2>Module: Thin::Logging</h2>
118
+
119
+
120
+ <div id="Thin::Logging" class="page_shade">
121
+ <div class="page">
122
+ <h3>Module Thin::Logging</h3>
123
+
124
+ <span class="path">(in files
125
+ <a href="../../files/lib/thin/logging_rb.html">lib/thin/logging.rb</a>
126
+ )</span>
127
+
128
+ <p>
129
+ To be included into classes to allow some basic logging that can be
130
+ silented (<tt>silent</tt>) or made more verbose (<tt><a
131
+ href="Logging.html#M000008">trace</a></tt>).
132
+ </p>
133
+
134
+
135
+
136
+
137
+
138
+ <h2 class="ruled">Methods</h2>
139
+ <h4 class="ruled">
140
+ <span class="method-type" title="Protected Instance method">Protected Instance</span>
141
+ <strong><a name="M000006" href="#M000006" title="Permalink to Protected Instance method: log">log(msg)</a></strong>
142
+ </h4>
143
+
144
+ <p>
145
+ Log a message to the console
146
+ </p>
147
+
148
+ <div class="sourcecode">
149
+ <p class="source-link">[ <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">show source</a> ]</p>
150
+ <div id="M000006_source" class="dyn-source">
151
+ <pre>
152
+ <span class="ruby-comment cmt"># File lib/thin/logging.rb, line 13</span>
153
+ 13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">msg</span>)
154
+ 14: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@silent</span>
155
+ 15: <span class="ruby-keyword kw">end</span>
156
+ </pre>
157
+ </div>
158
+ </div>
159
+ <h4 class="ruled">
160
+ <span class="method-type" title="Protected Instance method">Protected Instance</span>
161
+ <strong><a name="M000007" href="#M000007" title="Permalink to Protected Instance method: logc">logc(msg)</a></strong>
162
+ </h4>
163
+
164
+ <p>
165
+ Log a message to the console (no line feed)
166
+ </p>
167
+
168
+ <div class="sourcecode">
169
+ <p class="source-link">[ <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show source</a> ]</p>
170
+ <div id="M000007_source" class="dyn-source">
171
+ <pre>
172
+ <span class="ruby-comment cmt"># File lib/thin/logging.rb, line 18</span>
173
+ 18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logc</span>(<span class="ruby-identifier">msg</span>)
174
+ 19: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@silent</span>
175
+ 20: <span class="ruby-identifier">print</span> <span class="ruby-identifier">msg</span>
176
+ 21: <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">flush</span> <span class="ruby-comment cmt"># Make sure the msg is shown right away</span>
177
+ 22: <span class="ruby-keyword kw">end</span>
178
+ 23: <span class="ruby-keyword kw">end</span>
179
+ </pre>
180
+ </div>
181
+ </div>
182
+ <h4 class="ruled">
183
+ <span class="method-type" title="Protected Instance method">Protected Instance</span>
184
+ <strong><a name="M000008" href="#M000008" title="Permalink to Protected Instance method: trace">trace(msg=nil) {|if @trace &amp;&amp; !@silent| ...}</a></strong>
185
+ </h4>
186
+
187
+ <p>
188
+ Log a message to the console if tracing is activated
189
+ </p>
190
+
191
+ <div class="sourcecode">
192
+ <p class="source-link">[ <a href="javascript:toggleSource('M000008_source')" id="l_M000008_source">show source</a> ]</p>
193
+ <div id="M000008_source" class="dyn-source">
194
+ <pre>
195
+ <span class="ruby-comment cmt"># File lib/thin/logging.rb, line 26</span>
196
+ 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">trace</span>(<span class="ruby-identifier">msg</span>=<span class="ruby-keyword kw">nil</span>)
197
+ 27: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-operator">||</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@trace</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@silent</span>
198
+ 28: <span class="ruby-keyword kw">end</span>
199
+ </pre>
200
+ </div>
201
+ </div>
202
+
203
+ </div>
204
+ </div>
205
+
206
+
207
+ </div>
208
+ </div>
209
+ <div id="footer">
210
+ <hr />
211
+ &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
212
+ </div>
213
+ </body>
214
+ </html>
@@ -0,0 +1,234 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ thin &raquo; Class: Thin::RailsHandler
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/">home</a></li>
53
+ <li><a href="/thin/doc/">doc</a></li>
54
+ <li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
55
+ <li><a href="/thin/trac.fcgi/browser">code</a></li>
56
+ <li><a href="/thin/trac.fcgi/report">tickets</a></li>
57
+ <li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
58
+ </ul>
59
+ <div id="sidebar">
60
+ <h2>Files</h2>
61
+ <ul class="list">
62
+ <li><a href="../../files/README.html" value="File: README">README</a></li>
63
+ <li><a href="../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.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/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
66
+ <li><a href="../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
67
+ <li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
68
+ <li><a href="../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
69
+ <li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
70
+ <li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
71
+ <li><a href="../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
72
+ <li><a href="../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
73
+ <li><a href="../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
74
+ <li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
75
+ <li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
76
+ <li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
77
+ <li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
78
+ <li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
79
+ <li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
80
+ <li><a href="../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
81
+ </ul>
82
+
83
+ <h2>Classes</h2>
84
+ <ul class="list">
85
+ <li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
86
+ <li><a href="../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</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/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
92
+ <li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
93
+ <li><a href="../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
94
+ <li><a href="../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
95
+ <li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
96
+ <li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
97
+ <li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
98
+ <li><a href="../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
99
+ <li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
100
+ <li><a href="../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
101
+ <li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
102
+ <li><a href="../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
103
+ <li><a href="../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
104
+ <li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
105
+ <li><a href="../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
106
+ </ul>
107
+ </div>
108
+ <div id="container">
109
+ <div id="header">
110
+ <a href="/thin/" title="Home">
111
+ <img id="logo" src="../../logo.gif" />
112
+ </a>
113
+ <h2 id="tag_line">A fast and very simple Ruby web server</h2>
114
+ </div>
115
+
116
+ <div id="content">
117
+ <h2>Class: Thin::RailsHandler</h2>
118
+
119
+
120
+ <div id="Thin::RailsHandler" class="page_shade">
121
+ <div class="page">
122
+ <h3>Class Thin::RailsHandler &lt; <a href="Handler.html">Handler</a></h3>
123
+
124
+ <span class="path">(in files
125
+ <a href="../../files/lib/thin/rails_rb.html">lib/thin/rails.rb</a>
126
+ )</span>
127
+
128
+ <p>
129
+ Forwards incoming request to Rails dispatcher.
130
+ </p>
131
+
132
+
133
+
134
+
135
+ <h4>Includes</h4>
136
+ <ul>
137
+ <li><a href="Logging.html">Logging</a></li>
138
+ </ul>
139
+
140
+ <h2 class="ruled">Methods</h2>
141
+ <h4 class="ruled">
142
+ <span class="method-type" title="Public Class method">Public Class</span>
143
+ <strong><a name="M000066" href="#M000066" title="Permalink to Public Class method: new">new(pwd, env='development')</a></strong>
144
+ </h4>
145
+
146
+
147
+ <div class="sourcecode">
148
+ <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p>
149
+ <div id="M000066_source" class="dyn-source">
150
+ <pre>
151
+ <span class="ruby-comment cmt"># File lib/thin/rails.rb, line 4</span>
152
+ 4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">pwd</span>, <span class="ruby-identifier">env</span>=<span class="ruby-value str">'development'</span>)
153
+ 5: <span class="ruby-ivar">@env</span> = <span class="ruby-identifier">env</span>
154
+ 6: <span class="ruby-ivar">@pwd</span> = <span class="ruby-identifier">pwd</span>
155
+ 7: <span class="ruby-keyword kw">end</span>
156
+ </pre>
157
+ </div>
158
+ </div>
159
+ <h4 class="ruled">
160
+ <span class="method-type" title="Public Instance method">Public Instance</span>
161
+ <strong><a name="M000068" href="#M000068" title="Permalink to Public Instance method: process">process(request, response)</a></strong>
162
+ </h4>
163
+
164
+
165
+ <div class="sourcecode">
166
+ <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p>
167
+ <div id="M000068_source" class="dyn-source">
168
+ <pre>
169
+ <span class="ruby-comment cmt"># File lib/thin/rails.rb, line 16</span>
170
+ 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
171
+ 17: <span class="ruby-comment cmt"># Rails doesn't serve static files</span>
172
+ 18: <span class="ruby-comment cmt"># TODO handle Rails page caching</span>
173
+ 19: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@pwd</span>, <span class="ruby-value str">'public'</span>, <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>))
174
+ 20:
175
+ 21: <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>)
176
+ 22:
177
+ 23: <span class="ruby-constant">Dispatcher</span>.<span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">cgi</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>, <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>)
178
+ 24:
179
+ 25: <span class="ruby-comment cmt"># This finalizes the output using the proper HttpResponse way</span>
180
+ 26: <span class="ruby-identifier">cgi</span>.<span class="ruby-identifier">out</span>(<span class="ruby-value str">&quot;text/html&quot;</span>, <span class="ruby-keyword kw">true</span>) {<span class="ruby-value str">&quot;&quot;</span>}
181
+ 27: <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="M000067" href="#M000067" title="Permalink to Public Instance method: start">start()</a></strong>
188
+ </h4>
189
+
190
+
191
+ <div class="sourcecode">
192
+ <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p>
193
+ <div id="M000067_source" class="dyn-source">
194
+ <pre>
195
+ <span class="ruby-comment cmt"># File lib/thin/rails.rb, line 9</span>
196
+ 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
197
+ 10: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'RAILS_ENV'</span>] = <span class="ruby-ivar">@env</span>
198
+ 11:
199
+ 12: <span class="ruby-identifier">require</span> <span class="ruby-node">&quot;#{@pwd}/config/environment&quot;</span>
200
+ 13: <span class="ruby-identifier">require</span> <span class="ruby-value str">'dispatcher'</span>
201
+ 14: <span class="ruby-keyword kw">end</span>
202
+ </pre>
203
+ </div>
204
+ </div>
205
+ <h4 class="ruled">
206
+ <span class="method-type" title="Public Instance method">Public Instance</span>
207
+ <strong><a name="M000069" href="#M000069" title="Permalink to Public Instance method: to_s">to_s()</a></strong>
208
+ </h4>
209
+
210
+
211
+ <div class="sourcecode">
212
+ <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p>
213
+ <div id="M000069_source" class="dyn-source">
214
+ <pre>
215
+ <span class="ruby-comment cmt"># File lib/thin/rails.rb, line 29</span>
216
+ 29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
217
+ 30: <span class="ruby-node">&quot;Rails on #{@pwd} (env=#{@env})&quot;</span>
218
+ 31: <span class="ruby-keyword kw">end</span>
219
+ </pre>
220
+ </div>
221
+ </div>
222
+
223
+ </div>
224
+ </div>
225
+
226
+
227
+ </div>
228
+ </div>
229
+ <div id="footer">
230
+ <hr />
231
+ &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
232
+ </div>
233
+ </body>
234
+ </html>
@@ -0,0 +1,175 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ thin &raquo; Class: Thin::RailsServer
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/">home</a></li>
53
+ <li><a href="/thin/doc/">doc</a></li>
54
+ <li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
55
+ <li><a href="/thin/trac.fcgi/browser">code</a></li>
56
+ <li><a href="/thin/trac.fcgi/report">tickets</a></li>
57
+ <li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
58
+ </ul>
59
+ <div id="sidebar">
60
+ <h2>Files</h2>
61
+ <ul class="list">
62
+ <li><a href="../../files/README.html" value="File: README">README</a></li>
63
+ <li><a href="../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.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/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
66
+ <li><a href="../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
67
+ <li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
68
+ <li><a href="../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
69
+ <li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
70
+ <li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
71
+ <li><a href="../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
72
+ <li><a href="../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
73
+ <li><a href="../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
74
+ <li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
75
+ <li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
76
+ <li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
77
+ <li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
78
+ <li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
79
+ <li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
80
+ <li><a href="../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
81
+ </ul>
82
+
83
+ <h2>Classes</h2>
84
+ <ul class="list">
85
+ <li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
86
+ <li><a href="../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</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/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
92
+ <li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
93
+ <li><a href="../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
94
+ <li><a href="../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
95
+ <li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
96
+ <li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
97
+ <li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
98
+ <li><a href="../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
99
+ <li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
100
+ <li><a href="../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
101
+ <li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
102
+ <li><a href="../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
103
+ <li><a href="../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
104
+ <li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
105
+ <li><a href="../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
106
+ </ul>
107
+ </div>
108
+ <div id="container">
109
+ <div id="header">
110
+ <a href="/thin/" title="Home">
111
+ <img id="logo" src="../../logo.gif" />
112
+ </a>
113
+ <h2 id="tag_line">A fast and very simple Ruby web server</h2>
114
+ </div>
115
+
116
+ <div id="content">
117
+ <h2>Class: Thin::RailsServer</h2>
118
+
119
+
120
+ <div id="Thin::RailsServer" class="page_shade">
121
+ <div class="page">
122
+ <h3>Class Thin::RailsServer &lt; <a href="Server.html">Server</a></h3>
123
+
124
+ <span class="path">(in files
125
+ <a href="../../files/lib/thin/rails_rb.html">lib/thin/rails.rb</a>
126
+ )</span>
127
+
128
+ <p>
129
+ Serve the Rails application in the current directory.
130
+ </p>
131
+
132
+
133
+
134
+
135
+ <h4>Includes</h4>
136
+ <ul>
137
+ <li><a href="Logging.html">Logging</a></li>
138
+ <li><a href="Daemonizable.html">Daemonizable</a></li>
139
+ </ul>
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="M000055" href="#M000055" title="Permalink to Public Class method: new">new(address, port, environment='development', cwd='.')</a></strong>
145
+ </h4>
146
+
147
+
148
+ <div class="sourcecode">
149
+ <p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p>
150
+ <div id="M000055_source" class="dyn-source">
151
+ <pre>
152
+ <span class="ruby-comment cmt"># File lib/thin/rails.rb, line 36</span>
153
+ 36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">address</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">environment</span>=<span class="ruby-value str">'development'</span>, <span class="ruby-identifier">cwd</span>=<span class="ruby-value str">'.'</span>)
154
+ 37: <span class="ruby-keyword kw">super</span> <span class="ruby-identifier">address</span>, <span class="ruby-identifier">port</span>,
155
+ 38: <span class="ruby-comment cmt"># Let Rails handle his thing and ignore files</span>
156
+ 39: <span class="ruby-constant">Thin</span><span class="ruby-operator">::</span><span class="ruby-constant">RailsHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cwd</span>, <span class="ruby-identifier">environment</span>),
157
+ 40: <span class="ruby-comment cmt"># Serve static files</span>
158
+ 41: <span class="ruby-constant">Thin</span><span class="ruby-operator">::</span><span class="ruby-constant">DirHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">cwd</span>, <span class="ruby-value str">'public'</span>))
159
+ 42: <span class="ruby-keyword kw">end</span>
160
+ </pre>
161
+ </div>
162
+ </div>
163
+
164
+ </div>
165
+ </div>
166
+
167
+
168
+ </div>
169
+ </div>
170
+ <div id="footer">
171
+ <hr />
172
+ &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
173
+ </div>
174
+ </body>
175
+ </html>