mlanett-daemons 1.0.13 → 1.1.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. data/Gemfile.lock +12 -2
  2. data/LICENSE +1 -8
  3. data/README-mlanett.rdoc +8 -0
  4. data/{README → README.rdoc} +6 -15
  5. data/Releases +84 -9
  6. data/TODO +1 -5
  7. data/daemons.gemspec +1 -0
  8. data/examples/call/call.rb +1 -0
  9. data/examples/daemonize/daemonize.rb +10 -3
  10. data/examples/run/ctrl_hanging.rb +19 -0
  11. data/examples/run/ctrl_monitor_multiple.rb +18 -0
  12. data/examples/run/ctrl_normal.rb +0 -1
  13. data/examples/run/ctrl_proc.rb.output +20 -0
  14. data/examples/run/ctrl_proc_rand.rb +23 -0
  15. data/examples/run/ctrl_slowstop.rb +16 -0
  16. data/examples/run/myserver_crashing.rb +2 -2
  17. data/examples/run/myserver_hanging.rb +21 -0
  18. data/examples/run/myserver_slowstop.rb +21 -0
  19. data/lib/daemons.rb +38 -10
  20. data/lib/daemons/application.rb +131 -26
  21. data/lib/daemons/application_group.rb +58 -10
  22. data/lib/daemons/change_privilege.rb +19 -0
  23. data/lib/daemons/cmdline.rb +10 -6
  24. data/lib/daemons/controller.rb +5 -2
  25. data/lib/daemons/daemonize.rb +64 -150
  26. data/lib/daemons/etc_extension.rb +12 -0
  27. data/lib/daemons/exceptions.rb +3 -0
  28. data/lib/daemons/monitor.rb +27 -19
  29. data/lib/daemons/pid.rb +13 -14
  30. data/lib/daemons/pidfile.rb +14 -7
  31. data/lib/daemons/pidmem.rb +9 -0
  32. data/lib/daemons/version.rb +1 -1
  33. data/spec/pidfile_spec.rb +12 -0
  34. data/spec/spec_helper.rb +1 -0
  35. metadata +31 -47
  36. data/daemons.tmproj +0 -56
  37. data/examples/run/myserver_crashing.rb.output +0 -30
  38. data/html/classes/Daemonize.html +0 -497
  39. data/html/classes/Daemons.html +0 -683
  40. data/html/classes/Daemons/Application.html +0 -836
  41. data/html/classes/Daemons/ApplicationGroup.html +0 -508
  42. data/html/classes/Daemons/CmdException.html +0 -113
  43. data/html/classes/Daemons/Controller.html +0 -429
  44. data/html/classes/Daemons/Error.html +0 -113
  45. data/html/classes/Daemons/Exception.html +0 -111
  46. data/html/classes/Daemons/Monitor.html +0 -263
  47. data/html/classes/Daemons/Optparse.html +0 -244
  48. data/html/classes/Daemons/Pid.html +0 -339
  49. data/html/classes/Daemons/PidFile.html +0 -441
  50. data/html/classes/Daemons/PidMem.html +0 -126
  51. data/html/classes/Daemons/RuntimeException.html +0 -113
  52. data/html/classes/Daemons/SystemError.html +0 -163
  53. data/html/created.rid +0 -1
  54. data/html/files/README.html +0 -377
  55. data/html/files/Releases.html +0 -342
  56. data/html/files/TODO.html +0 -121
  57. data/html/files/lib/daemons/application_group_rb.html +0 -101
  58. data/html/files/lib/daemons/application_rb.html +0 -110
  59. data/html/files/lib/daemons/cmdline_rb.html +0 -101
  60. data/html/files/lib/daemons/controller_rb.html +0 -101
  61. data/html/files/lib/daemons/daemonize_rb.html +0 -207
  62. data/html/files/lib/daemons/exceptions_rb.html +0 -101
  63. data/html/files/lib/daemons/monitor_rb.html +0 -108
  64. data/html/files/lib/daemons/pid_rb.html +0 -108
  65. data/html/files/lib/daemons/pidfile_rb.html +0 -108
  66. data/html/files/lib/daemons/pidmem_rb.html +0 -108
  67. data/html/files/lib/daemons_rb.html +0 -117
  68. data/html/fr_class_index.html +0 -41
  69. data/html/fr_file_index.html +0 -40
  70. data/html/fr_method_index.html +0 -91
  71. data/html/index.html +0 -24
  72. data/html/rdoc-style.css +0 -208
  73. data/test/call_as_daemon.rb +0 -12
  74. data/test/tc_main.rb +0 -24
  75. data/test/test1.rb +0 -19
  76. data/test/testapp.rb +0 -11
@@ -1,441 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Daemons::PidFile</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">Daemons::PidFile</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/daemons/pidfile_rb.html">
59
- lib/daemons/pidfile.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- <a href="Pid.html">
69
- Pid
70
- </a>
71
- </td>
72
- </tr>
73
- </table>
74
- </div>
75
- <!-- banner header -->
76
-
77
- <div id="bodyContent">
78
-
79
-
80
-
81
- <div id="contextContent">
82
-
83
- <div id="description">
84
- <h3>What is a <a href="Pid.html">Pid</a>-File?</h3>
85
- <p>
86
- A <em><a href="Pid.html">Pid</a>-File</em> is a file containing the
87
- <em>process identification number</em> (<a
88
- href="PidFile.html#M000045">pid</a>) that is stored in a well-defined
89
- location of the filesystem thus allowing other programs to find out the <a
90
- href="PidFile.html#M000045">pid</a> of a running script.
91
- </p>
92
- <p>
93
- <a href="../Daemons.html">Daemons</a> needs the <a
94
- href="PidFile.html#M000045">pid</a> of the scripts that are currently
95
- running in the background to send them so called <em>signals</em>. <a
96
- href="../Daemons.html">Daemons</a> uses the <tt>TERM</tt> signal to tell
97
- the script to exit when you issue a <tt>stop</tt> command.
98
- </p>
99
- <h3>How does a <a href="Pid.html">Pid</a>-File look like?</h3>
100
- <p>
101
- <a href="Pid.html">Pid</a>-Files generated by <a
102
- href="../Daemons.html">Daemons</a> have to following format:
103
- </p>
104
- <pre>
105
- &lt;scriptname&gt;.rb&lt;number&gt;.pid
106
- </pre>
107
- <p>
108
- (Note that <tt>&lt;number&gt;</tt> is omitted if only one instance of the
109
- script can run at any time)
110
- </p>
111
- <p>
112
- Each file just contains one line with the <a
113
- href="PidFile.html#M000045">pid</a> as string (for example <tt>6432</tt>).
114
- </p>
115
- <h3>Where are the <a href="Pid.html">Pid</a>-Files stored?</h3>
116
- <p>
117
- <a href="../Daemons.html">Daemons</a> is configurable to store the <a
118
- href="Pid.html">Pid</a>-Files relative to three different locations:
119
- </p>
120
- <ol>
121
- <li>in a directory relative to the directory where the script (the one that is
122
- supposed to run as a daemon) resides (<tt>:script</tt> option for
123
- <tt>:dir_mode</tt>)
124
-
125
- </li>
126
- <li>in a directory given by <tt>:dir</tt> (<tt>:normal</tt> option for
127
- <tt>:dir_mode</tt>)
128
-
129
- </li>
130
- <li>in the preconfigured directory <tt>/var/run</tt> (<tt>:system</tt> option
131
- for <tt>:dir_mode</tt>)
132
-
133
- </li>
134
- </ol>
135
-
136
- </div>
137
-
138
-
139
- </div>
140
-
141
- <div id="method-list">
142
- <h3 class="section-bar">Methods</h3>
143
-
144
- <div class="name-list">
145
- <a href="#M000044">cleanup</a>&nbsp;&nbsp;
146
- <a href="#M000042">exist?</a>&nbsp;&nbsp;
147
- <a href="#M000039">existing</a>&nbsp;&nbsp;
148
- <a href="#M000041">filename</a>&nbsp;&nbsp;
149
- <a href="#M000038">find_files</a>&nbsp;&nbsp;
150
- <a href="#M000040">new</a>&nbsp;&nbsp;
151
- <a href="#M000045">pid</a>&nbsp;&nbsp;
152
- <a href="#M000043">pid=</a>&nbsp;&nbsp;
153
- </div>
154
- </div>
155
-
156
- </div>
157
-
158
-
159
- <!-- if includes -->
160
-
161
- <div id="section">
162
-
163
-
164
-
165
-
166
-
167
- <div id="attribute-list">
168
- <h3 class="section-bar">Attributes</h3>
169
-
170
- <div class="name-list">
171
- <table>
172
- <tr class="top-aligned-row context-row">
173
- <td class="context-item-name">dir</td>
174
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
175
- <td class="context-item-desc"></td>
176
- </tr>
177
- <tr class="top-aligned-row context-row">
178
- <td class="context-item-name">multiple</td>
179
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
180
- <td class="context-item-desc"></td>
181
- </tr>
182
- <tr class="top-aligned-row context-row">
183
- <td class="context-item-name">number</td>
184
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
185
- <td class="context-item-desc"></td>
186
- </tr>
187
- <tr class="top-aligned-row context-row">
188
- <td class="context-item-name">progname</td>
189
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
190
- <td class="context-item-desc"></td>
191
- </tr>
192
- </table>
193
- </div>
194
- </div>
195
-
196
-
197
-
198
- <!-- if method_list -->
199
- <div id="methods">
200
- <h3 class="section-bar">Public Class methods</h3>
201
-
202
- <div id="method-M000039" class="method-detail">
203
- <a name="M000039"></a>
204
-
205
- <div class="method-heading">
206
- <a href="#M000039" class="method-signature">
207
- <span class="method-name">existing</span><span class="method-args">(path)</span>
208
- </a>
209
- </div>
210
-
211
- <div class="method-description">
212
- <p><a class="source-toggle" href="#"
213
- onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
214
- <div class="method-source-code" id="M000039-source">
215
- <pre>
216
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 55</span>
217
- 55: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">PidFile</span>.<span class="ruby-identifier">existing</span>(<span class="ruby-identifier">path</span>)
218
- 56: <span class="ruby-identifier">new_instance</span> = <span class="ruby-constant">PidFile</span>.<span class="ruby-identifier">allocate</span>
219
- 57:
220
- 58: <span class="ruby-identifier">new_instance</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">:@path</span>, <span class="ruby-identifier">path</span>)
221
- 59:
222
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_instance</span>.<span class="ruby-identifier">filename</span>
223
- 61: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@path</span>
224
- 62: <span class="ruby-keyword kw">end</span>
225
- 63:
226
- 64: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">new_instance</span>
227
- 65: <span class="ruby-keyword kw">end</span>
228
- </pre>
229
- </div>
230
- </div>
231
- </div>
232
-
233
- <div id="method-M000038" class="method-detail">
234
- <a name="M000038"></a>
235
-
236
- <div class="method-heading">
237
- <a href="#M000038" class="method-signature">
238
- <span class="method-name">find_files</span><span class="method-args">(dir, progname, delete = false)</span>
239
- </a>
240
- </div>
241
-
242
- <div class="method-description">
243
- <p><a class="source-toggle" href="#"
244
- onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
245
- <div class="method-source-code" id="M000038-source">
246
- <pre>
247
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 36</span>
248
- 36: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">PidFile</span>.<span class="ruby-identifier">find_files</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">progname</span>, <span class="ruby-identifier">delete</span> = <span class="ruby-keyword kw">false</span>)
249
- 37: <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-node">&quot;#{progname}*.pid&quot;</span>)]
250
- 38:
251
- 39: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">delete_if</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">not</span> (<span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">readable?</span>(<span class="ruby-identifier">f</span>))}
252
- 40: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">delete</span>
253
- 41: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">delete_if</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
254
- 42: <span class="ruby-identifier">pid</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">f</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">read</span>}.<span class="ruby-identifier">to_i</span>
255
- 43: <span class="ruby-identifier">rsl</span> = <span class="ruby-operator">!</span> <span class="ruby-constant">Pid</span>.<span class="ruby-identifier">running?</span>(<span class="ruby-identifier">pid</span>)
256
- 44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rsl</span>
257
- 45: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;pid-file for killed process #{pid} found (#{f}), deleting.&quot;</span>
258
- 46: <span class="ruby-keyword kw">begin</span>; <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-identifier">f</span>); <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">Exception</span>; <span class="ruby-keyword kw">end</span>
259
- 47: <span class="ruby-keyword kw">end</span>
260
- 48: <span class="ruby-identifier">rsl</span>
261
- 49: <span class="ruby-keyword kw">end</span>
262
- 50: <span class="ruby-keyword kw">end</span>
263
- 51:
264
- 52: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">files</span>
265
- 53: <span class="ruby-keyword kw">end</span>
266
- </pre>
267
- </div>
268
- </div>
269
- </div>
270
-
271
- <div id="method-M000040" class="method-detail">
272
- <a name="M000040"></a>
273
-
274
- <div class="method-heading">
275
- <a href="#M000040" class="method-signature">
276
- <span class="method-name">new</span><span class="method-args">(dir, progname, multiple = false)</span>
277
- </a>
278
- </div>
279
-
280
- <div class="method-description">
281
- <p><a class="source-toggle" href="#"
282
- onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
283
- <div class="method-source-code" id="M000040-source">
284
- <pre>
285
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 67</span>
286
- 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span><span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">progname</span>, <span class="ruby-identifier">multiple</span> = <span class="ruby-keyword kw">false</span>)
287
- 68: <span class="ruby-ivar">@dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">dir</span>)
288
- 69: <span class="ruby-ivar">@progname</span> = <span class="ruby-identifier">progname</span>
289
- 70: <span class="ruby-ivar">@multiple</span> = <span class="ruby-identifier">multiple</span>
290
- 71: <span class="ruby-ivar">@number</span> = <span class="ruby-keyword kw">nil</span>
291
- 72: <span class="ruby-ivar">@number</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">multiple</span>
292
- 73:
293
- 74: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">multiple</span>
294
- 75: <span class="ruby-keyword kw">while</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@number</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">1024</span>
295
- 76: <span class="ruby-ivar">@number</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
296
- 77: <span class="ruby-keyword kw">end</span>
297
- 78:
298
- 79: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@number</span> <span class="ruby-operator">==</span> <span class="ruby-value">1024</span>
299
- 80: <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeException</span>(<span class="ruby-value str">'cannot run more than 1024 instances of the application'</span>)
300
- 81: <span class="ruby-keyword kw">end</span>
301
- 82: <span class="ruby-keyword kw">end</span>
302
- 83: <span class="ruby-keyword kw">end</span>
303
- </pre>
304
- </div>
305
- </div>
306
- </div>
307
-
308
- <h3 class="section-bar">Public Instance methods</h3>
309
-
310
- <div id="method-M000044" class="method-detail">
311
- <a name="M000044"></a>
312
-
313
- <div class="method-heading">
314
- <a href="#M000044" class="method-signature">
315
- <span class="method-name">cleanup</span><span class="method-args">()</span>
316
- </a>
317
- </div>
318
-
319
- <div class="method-description">
320
- <p><a class="source-toggle" href="#"
321
- onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
322
- <div class="method-source-code" id="M000044-source">
323
- <pre>
324
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 99</span>
325
- 99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
326
- 100: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">filename</span>)
327
- 101: <span class="ruby-keyword kw">end</span>
328
- </pre>
329
- </div>
330
- </div>
331
- </div>
332
-
333
- <div id="method-M000042" class="method-detail">
334
- <a name="M000042"></a>
335
-
336
- <div class="method-heading">
337
- <a href="#M000042" class="method-signature">
338
- <span class="method-name">exist?</span><span class="method-args">()</span>
339
- </a>
340
- </div>
341
-
342
- <div class="method-description">
343
- <p><a class="source-toggle" href="#"
344
- onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
345
- <div class="method-source-code" id="M000042-source">
346
- <pre>
347
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 89</span>
348
- 89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exist?</span>
349
- 90: <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-identifier">filename</span>
350
- 91: <span class="ruby-keyword kw">end</span>
351
- </pre>
352
- </div>
353
- </div>
354
- </div>
355
-
356
- <div id="method-M000041" class="method-detail">
357
- <a name="M000041"></a>
358
-
359
- <div class="method-heading">
360
- <a href="#M000041" class="method-signature">
361
- <span class="method-name">filename</span><span class="method-args">()</span>
362
- </a>
363
- </div>
364
-
365
- <div class="method-description">
366
- <p><a class="source-toggle" href="#"
367
- onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
368
- <div class="method-source-code" id="M000041-source">
369
- <pre>
370
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 85</span>
371
- 85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">filename</span>
372
- 86: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">&quot;#{@progname}#{ @number or '' }.pid&quot;</span>)
373
- 87: <span class="ruby-keyword kw">end</span>
374
- </pre>
375
- </div>
376
- </div>
377
- </div>
378
-
379
- <div id="method-M000045" class="method-detail">
380
- <a name="M000045"></a>
381
-
382
- <div class="method-heading">
383
- <a href="#M000045" class="method-signature">
384
- <span class="method-name">pid</span><span class="method-args">()</span>
385
- </a>
386
- </div>
387
-
388
- <div class="method-description">
389
- <p><a class="source-toggle" href="#"
390
- onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
391
- <div class="method-source-code" id="M000045-source">
392
- <pre>
393
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 103</span>
394
- 103: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pid</span>
395
- 104: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
396
- 105: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">gets</span>.<span class="ruby-identifier">to_i</span>
397
- 106: }
398
- 107: <span class="ruby-keyword kw">end</span>
399
- </pre>
400
- </div>
401
- </div>
402
- </div>
403
-
404
- <div id="method-M000043" class="method-detail">
405
- <a name="M000043"></a>
406
-
407
- <div class="method-heading">
408
- <a href="#M000043" class="method-signature">
409
- <span class="method-name">pid=</span><span class="method-args">(p)</span>
410
- </a>
411
- </div>
412
-
413
- <div class="method-description">
414
- <p><a class="source-toggle" href="#"
415
- onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
416
- <div class="method-source-code" id="M000043-source">
417
- <pre>
418
- <span class="ruby-comment cmt"># File lib/daemons/pidfile.rb, line 93</span>
419
- 93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pid=</span>(<span class="ruby-identifier">p</span>)
420
- 94: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
421
- 95: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">p</span> <span class="ruby-comment cmt">#Process.pid</span>
422
- 96: }
423
- 97: <span class="ruby-keyword kw">end</span>
424
- </pre>
425
- </div>
426
- </div>
427
- </div>
428
-
429
-
430
- </div>
431
-
432
-
433
- </div>
434
-
435
-
436
- <div id="validator-badges">
437
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
438
- </div>
439
-
440
- </body>
441
- </html>
@@ -1,126 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Daemons::PidMem</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">Daemons::PidMem</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/daemons/pidmem_rb.html">
59
- lib/daemons/pidmem.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- <a href="Pid.html">
69
- Pid
70
- </a>
71
- </td>
72
- </tr>
73
- </table>
74
- </div>
75
- <!-- banner header -->
76
-
77
- <div id="bodyContent">
78
-
79
-
80
-
81
- <div id="contextContent">
82
-
83
-
84
-
85
- </div>
86
-
87
-
88
- </div>
89
-
90
-
91
- <!-- if includes -->
92
-
93
- <div id="section">
94
-
95
-
96
-
97
-
98
-
99
- <div id="attribute-list">
100
- <h3 class="section-bar">Attributes</h3>
101
-
102
- <div class="name-list">
103
- <table>
104
- <tr class="top-aligned-row context-row">
105
- <td class="context-item-name">pid</td>
106
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
107
- <td class="context-item-desc"></td>
108
- </tr>
109
- </table>
110
- </div>
111
- </div>
112
-
113
-
114
-
115
- <!-- if method_list -->
116
-
117
-
118
- </div>
119
-
120
-
121
- <div id="validator-badges">
122
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
123
- </div>
124
-
125
- </body>
126
- </html>