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,392 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ thin &raquo; Class: Thin::Cluster
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::Cluster</h2>
118
+
119
+
120
+ <div id="Thin::Cluster" class="page_shade">
121
+ <div class="page">
122
+ <h3>Class Thin::Cluster &lt; <a href="Server.html">Object</a></h3>
123
+
124
+ <span class="path">(in files
125
+ <a href="../../files/lib/thin/cluster_rb.html">lib/thin/cluster.rb</a>
126
+ )</span>
127
+
128
+ <p>
129
+ Control a set of servers. Generate <a href="Cluster.html#M000058">start</a>
130
+ and <a href="Cluster.html#M000060">stop</a> commands and run them.
131
+ </p>
132
+
133
+
134
+
135
+
136
+ <h4>Includes</h4>
137
+ <ul>
138
+ <li><a href="Logging.html">Logging</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="M000057" href="#M000057" title="Permalink to Public Class method: new">new(dir, address, first_port, size)</a></strong>
145
+ </h4>
146
+
147
+ <p>
148
+ Create a <a href="Cluster.html#M000057">new</a> cluster of servers bound to
149
+ <tt>host</tt> on ports <tt>first_port</tt> to <tt>first_port + size -
150
+ 1</tt>.
151
+ </p>
152
+
153
+ <div class="sourcecode">
154
+ <p class="source-link">[ <a href="javascript:toggleSource('M000057_source')" id="l_M000057_source">show source</a> ]</p>
155
+ <div id="M000057_source" class="dyn-source">
156
+ <pre>
157
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 17</span>
158
+ 17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">address</span>, <span class="ruby-identifier">first_port</span>, <span class="ruby-identifier">size</span>)
159
+ 18: <span class="ruby-ivar">@address</span> = <span class="ruby-identifier">address</span>
160
+ 19: <span class="ruby-ivar">@first_port</span> = <span class="ruby-identifier">first_port</span>
161
+ 20: <span class="ruby-ivar">@size</span> = <span class="ruby-identifier">size</span>
162
+ 21:
163
+ 22: <span class="ruby-ivar">@log_file</span> = <span class="ruby-value str">'thin.log'</span>
164
+ 23: <span class="ruby-ivar">@pid_file</span> = <span class="ruby-value str">'thin.pid'</span>
165
+ 24:
166
+ 25: <span class="ruby-ivar">@timeout</span> = <span class="ruby-value">60</span> <span class="ruby-comment cmt"># sec</span>
167
+ 26:
168
+ 27: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span> <span class="ruby-identifier">dir</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dir</span>
169
+ 28: <span class="ruby-keyword kw">end</span>
170
+ </pre>
171
+ </div>
172
+ </div>
173
+ <h4 class="ruled">
174
+ <span class="method-type" title="Public Class method">Public Class</span>
175
+ <strong><a name="M000056" href="#M000056" title="Permalink to Public Class method: thin=">thin=(value)</a></strong>
176
+ </h4>
177
+
178
+ <p>
179
+ Script to run
180
+ </p>
181
+
182
+ <div class="sourcecode">
183
+ <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p>
184
+ <div id="M000056_source" class="dyn-source">
185
+ <pre>
186
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 10</span>
187
+ 10: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">thin=</span>(<span class="ruby-identifier">value</span>)
188
+ 11: <span class="ruby-ivar">@@thin</span> = <span class="ruby-identifier">value</span>
189
+ 12: <span class="ruby-keyword kw">end</span>
190
+ </pre>
191
+ </div>
192
+ </div>
193
+ <h4 class="ruled">
194
+ <span class="method-type" title="Public Instance method">Public Instance</span>
195
+ <strong><a name="M000063" href="#M000063" title="Permalink to Public Instance method: log_file_for">log_file_for(port)</a></strong>
196
+ </h4>
197
+
198
+
199
+ <div class="sourcecode">
200
+ <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p>
201
+ <div id="M000063_source" class="dyn-source">
202
+ <pre>
203
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 91</span>
204
+ 91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_file_for</span>(<span class="ruby-identifier">port</span>)
205
+ 92: <span class="ruby-identifier">include_port_number</span> <span class="ruby-ivar">@log_file</span>, <span class="ruby-identifier">port</span>
206
+ 93: <span class="ruby-keyword kw">end</span>
207
+ </pre>
208
+ </div>
209
+ </div>
210
+ <h4 class="ruled">
211
+ <span class="method-type" title="Public Instance method">Public Instance</span>
212
+ <strong><a name="M000064" href="#M000064" title="Permalink to Public Instance method: pid_file_for">pid_file_for(port)</a></strong>
213
+ </h4>
214
+
215
+
216
+ <div class="sourcecode">
217
+ <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p>
218
+ <div id="M000064_source" class="dyn-source">
219
+ <pre>
220
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 95</span>
221
+ 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pid_file_for</span>(<span class="ruby-identifier">port</span>)
222
+ 96: <span class="ruby-identifier">include_port_number</span> <span class="ruby-ivar">@pid_file</span>, <span class="ruby-identifier">port</span>
223
+ 97: <span class="ruby-keyword kw">end</span>
224
+ </pre>
225
+ </div>
226
+ </div>
227
+ <h4 class="ruled">
228
+ <span class="method-type" title="Public Instance method">Public Instance</span>
229
+ <strong><a name="M000065" href="#M000065" title="Permalink to Public Instance method: pid_for">pid_for(port)</a></strong>
230
+ </h4>
231
+
232
+
233
+ <div class="sourcecode">
234
+ <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p>
235
+ <div id="M000065_source" class="dyn-source">
236
+ <pre>
237
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 99</span>
238
+ 99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pid_for</span>(<span class="ruby-identifier">port</span>)
239
+ 100: <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">pid_file_for</span>(<span class="ruby-identifier">port</span>)).<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">to_i</span>
240
+ 101: <span class="ruby-keyword kw">end</span>
241
+ </pre>
242
+ </div>
243
+ </div>
244
+ <h4 class="ruled">
245
+ <span class="method-type" title="Public Instance method">Public Instance</span>
246
+ <strong><a name="M000062" href="#M000062" title="Permalink to Public Instance method: restart">restart()</a></strong>
247
+ </h4>
248
+
249
+ <p>
250
+ Restart the servers one at the time. Prevent downtime by making sure only
251
+ one is stopped at the time. See <a
252
+ href="http://blog.carlmercier.com/2007/09/07/a-better-approach-to-restarting-a-mongrel-cluster">blog.carlmercier.com/2007/09/07/a-better-approach-to-restarting-a-mongrel-cluster</a>/
253
+ </p>
254
+
255
+ <div class="sourcecode">
256
+ <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p>
257
+ <div id="M000062_source" class="dyn-source">
258
+ <pre>
259
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 83</span>
260
+ 83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restart</span>
261
+ 84: <span class="ruby-identifier">with_each_instance</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">port</span><span class="ruby-operator">|</span>
262
+ 85: <span class="ruby-identifier">stop_on_port</span> <span class="ruby-identifier">port</span>
263
+ 86: <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.1</span> <span class="ruby-comment cmt"># Let the OS do his thang</span>
264
+ 87: <span class="ruby-identifier">start_on_port</span> <span class="ruby-identifier">port</span>
265
+ 88: <span class="ruby-keyword kw">end</span>
266
+ 89: <span class="ruby-keyword kw">end</span>
267
+ </pre>
268
+ </div>
269
+ </div>
270
+ <h4 class="ruled">
271
+ <span class="method-type" title="Public Instance method">Public Instance</span>
272
+ <strong><a name="M000058" href="#M000058" title="Permalink to Public Instance method: start">start()</a></strong>
273
+ </h4>
274
+
275
+ <p>
276
+ Start the servers
277
+ </p>
278
+
279
+ <div class="sourcecode">
280
+ <p class="source-link">[ <a href="javascript:toggleSource('M000058_source')" id="l_M000058_source">show source</a> ]</p>
281
+ <div id="M000058_source" class="dyn-source">
282
+ <pre>
283
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 31</span>
284
+ 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
285
+ 32: <span class="ruby-identifier">with_each_instance</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">port</span><span class="ruby-operator">|</span>
286
+ 33: <span class="ruby-identifier">start_on_port</span> <span class="ruby-identifier">port</span>
287
+ 34: <span class="ruby-keyword kw">end</span>
288
+ 35: <span class="ruby-keyword kw">end</span>
289
+ </pre>
290
+ </div>
291
+ </div>
292
+ <h4 class="ruled">
293
+ <span class="method-type" title="Public Instance method">Public Instance</span>
294
+ <strong><a name="M000059" href="#M000059" title="Permalink to Public Instance method: start_on_port">start_on_port(port)</a></strong>
295
+ </h4>
296
+
297
+ <p>
298
+ Start the server on a single port
299
+ </p>
300
+
301
+ <div class="sourcecode">
302
+ <p class="source-link">[ <a href="javascript:toggleSource('M000059_source')" id="l_M000059_source">show source</a> ]</p>
303
+ <div id="M000059_source" class="dyn-source">
304
+ <pre>
305
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 38</span>
306
+ 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_on_port</span>(<span class="ruby-identifier">port</span>)
307
+ 39: <span class="ruby-identifier">logc</span> <span class="ruby-node">&quot;Starting #{address}:#{port} ... &quot;</span>
308
+ 40:
309
+ 41: <span class="ruby-identifier">run</span> <span class="ruby-identifier">:start</span>, <span class="ruby-identifier">:port</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">port</span>,
310
+ 42: <span class="ruby-identifier">:address</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@address</span>,
311
+ 43: <span class="ruby-identifier">:environment</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@environment</span>,
312
+ 44: <span class="ruby-identifier">:daemonize</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>,
313
+ 45: <span class="ruby-identifier">:pid_file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">pid_file_for</span>(<span class="ruby-identifier">port</span>),
314
+ 46: <span class="ruby-identifier">:log_file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">log_file_for</span>(<span class="ruby-identifier">port</span>),
315
+ 47: <span class="ruby-identifier">:user</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@user</span>,
316
+ 48: <span class="ruby-identifier">:group</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@group</span>,
317
+ 49: <span class="ruby-identifier">:timeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@timeout</span>,
318
+ 50: <span class="ruby-identifier">:trace</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@trace</span>
319
+ 51:
320
+ 52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">wait_until_pid</span>(<span class="ruby-identifier">:exist</span>, <span class="ruby-identifier">port</span>)
321
+ 53: <span class="ruby-identifier">log</span> <span class="ruby-node">&quot;started in #{pid_for(port)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$?</span>.<span class="ruby-identifier">success?</span>
322
+ 54: <span class="ruby-keyword kw">else</span>
323
+ 55: <span class="ruby-identifier">log</span> <span class="ruby-value str">'failed to start'</span>
324
+ 56: <span class="ruby-keyword kw">end</span>
325
+ 57: <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="M000060" href="#M000060" title="Permalink to Public Instance method: stop">stop()</a></strong>
332
+ </h4>
333
+
334
+ <p>
335
+ Stop the servers
336
+ </p>
337
+
338
+ <div class="sourcecode">
339
+ <p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p>
340
+ <div id="M000060_source" class="dyn-source">
341
+ <pre>
342
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 60</span>
343
+ 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
344
+ 61: <span class="ruby-identifier">with_each_instance</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">port</span><span class="ruby-operator">|</span>
345
+ 62: <span class="ruby-identifier">stop_on_port</span> <span class="ruby-identifier">port</span>
346
+ 63: <span class="ruby-keyword kw">end</span>
347
+ 64: <span class="ruby-keyword kw">end</span>
348
+ </pre>
349
+ </div>
350
+ </div>
351
+ <h4 class="ruled">
352
+ <span class="method-type" title="Public Instance method">Public Instance</span>
353
+ <strong><a name="M000061" href="#M000061" title="Permalink to Public Instance method: stop_on_port">stop_on_port(port)</a></strong>
354
+ </h4>
355
+
356
+ <p>
357
+ Stop the server running on <tt>port</tt>
358
+ </p>
359
+
360
+ <div class="sourcecode">
361
+ <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p>
362
+ <div id="M000061_source" class="dyn-source">
363
+ <pre>
364
+ <span class="ruby-comment cmt"># File lib/thin/cluster.rb, line 67</span>
365
+ 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop_on_port</span>(<span class="ruby-identifier">port</span>)
366
+ 68: <span class="ruby-identifier">logc</span> <span class="ruby-node">&quot;Stopping #{address}:#{port} ... &quot;</span>
367
+ 69:
368
+ 70: <span class="ruby-identifier">run</span> <span class="ruby-identifier">:stop</span>, <span class="ruby-identifier">:pid_file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">pid_file_for</span>(<span class="ruby-identifier">port</span>),
369
+ 71: <span class="ruby-identifier">:timeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@timeout</span>
370
+ 72:
371
+ 73: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">wait_until_pid</span>(<span class="ruby-operator">!</span><span class="ruby-identifier">:exist</span>, <span class="ruby-identifier">port</span>)
372
+ 74: <span class="ruby-identifier">log</span> <span class="ruby-value str">'stopped'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$?</span>.<span class="ruby-identifier">success?</span>
373
+ 75: <span class="ruby-keyword kw">else</span>
374
+ 76: <span class="ruby-identifier">log</span> <span class="ruby-value str">'failed to stop'</span>
375
+ 77: <span class="ruby-keyword kw">end</span>
376
+ 78: <span class="ruby-keyword kw">end</span>
377
+ </pre>
378
+ </div>
379
+ </div>
380
+
381
+ </div>
382
+ </div>
383
+
384
+
385
+ </div>
386
+ </div>
387
+ <div id="footer">
388
+ <hr />
389
+ &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
390
+ </div>
391
+ </body>
392
+ </html>
@@ -0,0 +1,221 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ thin &raquo; Class: Thin::Command
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::Command</h2>
118
+
119
+
120
+ <div id="Thin::Command" class="page_shade">
121
+ <div class="page">
122
+ <h3>Class Thin::Command &lt; <a href="Handler.html">Object</a></h3>
123
+
124
+ <span class="path">(in files
125
+ <a href="../../files/lib/thin/command_rb.html">lib/thin/command.rb</a>
126
+ )</span>
127
+
128
+ <p>
129
+ A command that can be runned from a command line script.
130
+ </p>
131
+
132
+
133
+
134
+
135
+
136
+ <h2 class="ruled">Methods</h2>
137
+ <h4 class="ruled">
138
+ <span class="method-type" title="Public Class method">Public Class</span>
139
+ <strong><a name="M000024" href="#M000024" title="Permalink to Public Class method: command_name">command_name()</a></strong>
140
+ </h4>
141
+
142
+
143
+ <div class="sourcecode">
144
+ <p class="source-link">[ <a href="javascript:toggleSource('M000024_source')" id="l_M000024_source">show source</a> ]</p>
145
+ <div id="M000024_source" class="dyn-source">
146
+ <pre>
147
+ <span class="ruby-comment cmt"># File lib/thin/command.rb, line 29</span>
148
+ 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">command_name</span>
149
+ 30: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/::(\w+)$/</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">downcase</span>
150
+ 31: <span class="ruby-keyword kw">end</span>
151
+ </pre>
152
+ </div>
153
+ </div>
154
+ <h4 class="ruled">
155
+ <span class="method-type" title="Public Class method">Public Class</span>
156
+ <strong><a name="M000025" href="#M000025" title="Permalink to Public Class method: detailed_help">detailed_help()</a></strong>
157
+ </h4>
158
+
159
+
160
+ <div class="sourcecode">
161
+ <p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p>
162
+ <div id="M000025_source" class="dyn-source">
163
+ <pre>
164
+ <span class="ruby-comment cmt"># File lib/thin/command.rb, line 33</span>
165
+ 33: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">detailed_help</span>
166
+ 34: <span class="ruby-value str">&quot;usage: \#{File.basename($PROGRAM_NAME)} \#{command_name}\n\n\#{help}\n&quot;</span>
167
+ 35: <span class="ruby-keyword kw">end</span>
168
+ </pre>
169
+ </div>
170
+ </div>
171
+ <h4 class="ruled">
172
+ <span class="method-type" title="Public Class method">Public Class</span>
173
+ <strong><a name="M000023" href="#M000023" title="Permalink to Public Class method: new">new(non_options, options)</a></strong>
174
+ </h4>
175
+
176
+
177
+ <div class="sourcecode">
178
+ <p class="source-link">[ <a href="javascript:toggleSource('M000023_source')" id="l_M000023_source">show source</a> ]</p>
179
+ <div id="M000023_source" class="dyn-source">
180
+ <pre>
181
+ <span class="ruby-comment cmt"># File lib/thin/command.rb, line 21</span>
182
+ 21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">non_options</span>, <span class="ruby-identifier">options</span>)
183
+ 22: <span class="ruby-ivar">@args</span> = <span class="ruby-identifier">non_options</span>
184
+ 23:
185
+ 24: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">option</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
186
+ 25: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{option}=&quot;</span>, <span class="ruby-identifier">value</span>)
187
+ 26: <span class="ruby-keyword kw">end</span>
188
+ 27: <span class="ruby-keyword kw">end</span>
189
+ </pre>
190
+ </div>
191
+ </div>
192
+ <h4 class="ruled">
193
+ <span class="method-type" title="Protected Instance method">Protected Instance</span>
194
+ <strong><a name="M000026" href="#M000026" title="Permalink to Protected Instance method: error">error(message)</a></strong>
195
+ </h4>
196
+
197
+
198
+ <div class="sourcecode">
199
+ <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p>
200
+ <div id="M000026_source" class="dyn-source">
201
+ <pre>
202
+ <span class="ruby-comment cmt"># File lib/thin/command.rb, line 43</span>
203
+ 43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error</span>(<span class="ruby-identifier">message</span>)
204
+ 44: <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandError</span>, <span class="ruby-identifier">message</span>
205
+ 45: <span class="ruby-keyword kw">end</span>
206
+ </pre>
207
+ </div>
208
+ </div>
209
+
210
+ </div>
211
+ </div>
212
+
213
+
214
+ </div>
215
+ </div>
216
+ <div id="footer">
217
+ <hr />
218
+ &copy; <a href="http://macournoyer.com">Marc-Andr&eacute; Cournoyer</a>
219
+ </div>
220
+ </body>
221
+ </html>