resque-pool-dynamic 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +4 -0
- data/README.md +242 -0
- data/Rakefile +42 -0
- data/doc/Resque/Pool/Dynamic/Logfile.html +722 -0
- data/doc/Resque/Pool/Dynamic/Shell.html +636 -0
- data/doc/Resque/Pool/Dynamic.html +2187 -0
- data/doc/Resque/Pool.html +125 -0
- data/doc/Resque.html +110 -0
- data/doc/_index.html +166 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +316 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +316 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +318 -0
- data/doc/top-level-namespace.html +105 -0
- data/help.yml +140 -0
- data/lib/resque/pool/dynamic/logfile.rb +97 -0
- data/lib/resque/pool/dynamic/shell.rb +106 -0
- data/lib/resque/pool/dynamic/tasks.rb +29 -0
- data/lib/resque/pool/dynamic/version.rb +7 -0
- data/lib/resque/pool/dynamic.rb +217 -0
- data/lib/resque/pool/help.json +1 -0
- data/resque-pool-dynamic.gemspec +29 -0
- metadata +127 -0
@@ -0,0 +1,636 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Resque::Pool::Dynamic::Shell
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '../../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../../../_index.html">Index (S)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../../Resque.html" title="Resque (module)">Resque</a></span></span> » <span class='title'><span class='object_link'><a href="../../Pool.html" title="Resque::Pool (class)">Pool</a></span></span> » <span class='title'><span class='object_link'><a href="../Dynamic.html" title="Resque::Pool::Dynamic (class)">Dynamic</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Shell</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Class: Resque::Pool::Dynamic::Shell
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Ripl::Shell</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">Ripl::Shell</li>
|
75
|
+
|
76
|
+
<li class="next">Resque::Pool::Dynamic::Shell</li>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
<a href="#" class="inheritanceTree">show all</a>
|
80
|
+
|
81
|
+
</dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<dt class="r2 last">Defined in:</dt>
|
92
|
+
<dd class="r2 last">lib/resque/pool/dynamic/shell.rb</dd>
|
93
|
+
|
94
|
+
</dl>
|
95
|
+
<div class="clear"></div>
|
96
|
+
|
97
|
+
<h2>Overview</h2><div class="docstring">
|
98
|
+
<div class="discussion">
|
99
|
+
<p>
|
100
|
+
Ripl shell subclassed for nicer CLI experience
|
101
|
+
</p>
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
<div class="tags">
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<h2>
|
118
|
+
Class Method Summary
|
119
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
120
|
+
</h2>
|
121
|
+
|
122
|
+
<ul class="summary">
|
123
|
+
|
124
|
+
<li class="public ">
|
125
|
+
<span class="summary_signature">
|
126
|
+
|
127
|
+
<a href="#run-class_method" title="run (class method)">+ (void) <strong>run</strong>(instance, opts = {}) </a>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
</span>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<span class="summary_desc"><div class='inline'><p>
|
141
|
+
Run the Ripl shell in context of specified instance.
|
142
|
+
</p>
|
143
|
+
</div></span>
|
144
|
+
|
145
|
+
</li>
|
146
|
+
|
147
|
+
|
148
|
+
</ul>
|
149
|
+
|
150
|
+
<h2>
|
151
|
+
Instance Method Summary
|
152
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
153
|
+
</h2>
|
154
|
+
|
155
|
+
<ul class="summary">
|
156
|
+
|
157
|
+
<li class="public ">
|
158
|
+
<span class="summary_signature">
|
159
|
+
|
160
|
+
<a href="#eval_input-instance_method" title="#eval_input (instance method)">- (void) <strong>eval_input</strong>(input) </a>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
</span>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<span class="summary_desc"><div class='inline'><p>
|
174
|
+
Handle help as special command.
|
175
|
+
</p>
|
176
|
+
</div></span>
|
177
|
+
|
178
|
+
</li>
|
179
|
+
|
180
|
+
|
181
|
+
<li class="public ">
|
182
|
+
<span class="summary_signature">
|
183
|
+
|
184
|
+
<a href="#help-instance_method" title="#help (instance method)">- (void) <strong>help</strong>(subject = nil) </a>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<span class="summary_desc"><div class='inline'><p>
|
198
|
+
Show help.
|
199
|
+
</p>
|
200
|
+
</div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#print_eval_error-instance_method" title="#print_eval_error (instance method)">- (void) <strong>print_eval_error</strong>(e) </a>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</span>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'><p>
|
222
|
+
When printing error, cut backtrace at (ripl).
|
223
|
+
</p>
|
224
|
+
</div></span>
|
225
|
+
|
226
|
+
</li>
|
227
|
+
|
228
|
+
|
229
|
+
<li class="public ">
|
230
|
+
<span class="summary_signature">
|
231
|
+
|
232
|
+
<a href="#print_result-instance_method" title="#print_result (instance method)">- (void) <strong>print_result</strong>(result) </a>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
</span>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<span class="summary_desc"><div class='inline'><p>
|
246
|
+
Don’t print nil return values.
|
247
|
+
</p>
|
248
|
+
</div></span>
|
249
|
+
|
250
|
+
</li>
|
251
|
+
|
252
|
+
|
253
|
+
</ul>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<div id="class_method_details" class="method_details_list">
|
260
|
+
<h2>Class Method Details</h2>
|
261
|
+
|
262
|
+
|
263
|
+
<div class="method_details first">
|
264
|
+
<p class="signature first" id="run-class_method">
|
265
|
+
|
266
|
+
+ (<tt>void</tt>) <strong>run</strong>(instance, opts = {})
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
</p><div class="docstring">
|
271
|
+
<div class="discussion">
|
272
|
+
<p>
|
273
|
+
Run the Ripl shell in context of specified instance
|
274
|
+
</p>
|
275
|
+
|
276
|
+
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
<div class="tags">
|
280
|
+
<h3>Parameters:</h3>
|
281
|
+
<ul class="param">
|
282
|
+
|
283
|
+
<li>
|
284
|
+
|
285
|
+
<span class='name'>instance</span>
|
286
|
+
|
287
|
+
|
288
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
—
|
293
|
+
<div class='inline'><p>
|
294
|
+
Instance to get bindings from
|
295
|
+
</p>
|
296
|
+
</div>
|
297
|
+
|
298
|
+
</li>
|
299
|
+
|
300
|
+
<li>
|
301
|
+
|
302
|
+
<span class='name'>opts</span>
|
303
|
+
|
304
|
+
|
305
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
306
|
+
|
307
|
+
|
308
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
309
|
+
|
310
|
+
|
311
|
+
—
|
312
|
+
<div class='inline'><p>
|
313
|
+
Options passed to Ripl::Shell
|
314
|
+
</p>
|
315
|
+
</div>
|
316
|
+
|
317
|
+
</li>
|
318
|
+
|
319
|
+
</ul>
|
320
|
+
|
321
|
+
|
322
|
+
</div><table class="source_code">
|
323
|
+
<tr>
|
324
|
+
<td>
|
325
|
+
<pre class="lines">
|
326
|
+
|
327
|
+
|
328
|
+
80
|
329
|
+
81
|
330
|
+
82
|
331
|
+
83
|
332
|
+
84
|
333
|
+
85
|
334
|
+
86
|
335
|
+
87
|
336
|
+
88
|
337
|
+
89
|
338
|
+
90</pre>
|
339
|
+
</td>
|
340
|
+
<td>
|
341
|
+
<pre class="code"><span class="info file"># File 'lib/resque/pool/dynamic/shell.rb', line 80</span>
|
342
|
+
|
343
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='id identifier rubyid_instance'>instance</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
344
|
+
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
345
|
+
<span class='symbol'>:readline</span> <span class='op'>=></span> <span class='kw'>true</span><span class='comma'>,</span>
|
346
|
+
<span class='symbol'>:riplrc</span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>RIPL_RC</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>~/.riplrc</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
347
|
+
<span class='symbol'>:completion</span> <span class='op'>=></span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span>
|
348
|
+
<span class='symbol'>:binding</span> <span class='op'>=></span> <span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_instance_eval'>instance_eval</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_binding'>binding</span> <span class='rbrace'>}</span>
|
349
|
+
<span class='rbrace'>}</span>
|
350
|
+
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
351
|
+
<span class='const'>Ripl</span><span class='op'>::</span><span class='const'>Runner</span><span class='op'>::</span><span class='id identifier rubyid_load_rc'>load_rc</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:riplrc</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:riplrc</span><span class='rbracket'>]</span><span class='op'>!=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
352
|
+
<span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_loop'>loop</span>
|
353
|
+
<span class='kw'>end</span></pre>
|
354
|
+
</td>
|
355
|
+
</tr>
|
356
|
+
</table>
|
357
|
+
</div>
|
358
|
+
|
359
|
+
</div>
|
360
|
+
|
361
|
+
<div id="instance_method_details" class="method_details_list">
|
362
|
+
<h2>Instance Method Details</h2>
|
363
|
+
|
364
|
+
|
365
|
+
<div class="method_details first">
|
366
|
+
<p class="signature first" id="eval_input-instance_method">
|
367
|
+
|
368
|
+
- (<tt>void</tt>) <strong>eval_input</strong>(input)
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
</p><div class="docstring">
|
373
|
+
<div class="discussion">
|
374
|
+
<p>
|
375
|
+
Handle help as special command
|
376
|
+
</p>
|
377
|
+
|
378
|
+
|
379
|
+
</div>
|
380
|
+
</div>
|
381
|
+
<div class="tags">
|
382
|
+
<h3>Parameters:</h3>
|
383
|
+
<ul class="param">
|
384
|
+
|
385
|
+
<li>
|
386
|
+
|
387
|
+
<span class='name'>input</span>
|
388
|
+
|
389
|
+
|
390
|
+
<span class='type'>(<tt>String</tt>)</span>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
—
|
395
|
+
<div class='inline'><p>
|
396
|
+
Input string
|
397
|
+
</p>
|
398
|
+
</div>
|
399
|
+
|
400
|
+
</li>
|
401
|
+
|
402
|
+
</ul>
|
403
|
+
|
404
|
+
|
405
|
+
</div><table class="source_code">
|
406
|
+
<tr>
|
407
|
+
<td>
|
408
|
+
<pre class="lines">
|
409
|
+
|
410
|
+
|
411
|
+
68
|
412
|
+
69
|
413
|
+
70
|
414
|
+
71
|
415
|
+
72
|
416
|
+
73
|
417
|
+
74
|
418
|
+
75</pre>
|
419
|
+
</td>
|
420
|
+
<td>
|
421
|
+
<pre class="code"><span class="info file"># File 'lib/resque/pool/dynamic/shell.rb', line 68</span>
|
422
|
+
|
423
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_eval_input'>eval_input</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
|
424
|
+
<span class='id identifier rubyid_splut'>splut</span> <span class='op'>=</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\s+</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='int'>2</span><span class='rparen'>)</span>
|
425
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_splut'>splut</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>help</span><span class='tstring_end'>'</span></span>
|
426
|
+
<span class='id identifier rubyid_help'>help</span><span class='lparen'>(</span><span class='id identifier rubyid_splut'>splut</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
427
|
+
<span class='kw'>else</span>
|
428
|
+
<span class='kw'>super</span>
|
429
|
+
<span class='kw'>end</span>
|
430
|
+
<span class='kw'>end</span></pre>
|
431
|
+
</td>
|
432
|
+
</tr>
|
433
|
+
</table>
|
434
|
+
</div>
|
435
|
+
|
436
|
+
<div class="method_details ">
|
437
|
+
<p class="signature " id="help-instance_method">
|
438
|
+
|
439
|
+
- (<tt>void</tt>) <strong>help</strong>(subject = nil)
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
</p><div class="docstring">
|
444
|
+
<div class="discussion">
|
445
|
+
<p>
|
446
|
+
Show help
|
447
|
+
</p>
|
448
|
+
|
449
|
+
|
450
|
+
</div>
|
451
|
+
</div>
|
452
|
+
<div class="tags">
|
453
|
+
<h3>Parameters:</h3>
|
454
|
+
<ul class="param">
|
455
|
+
|
456
|
+
<li>
|
457
|
+
|
458
|
+
<span class='name'>subject</span>
|
459
|
+
|
460
|
+
|
461
|
+
<span class='type'>(<tt>String</tt>)</span>
|
462
|
+
|
463
|
+
|
464
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
465
|
+
|
466
|
+
|
467
|
+
—
|
468
|
+
<div class='inline'><p>
|
469
|
+
Topic to display
|
470
|
+
</p>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
</li>
|
474
|
+
|
475
|
+
</ul>
|
476
|
+
|
477
|
+
|
478
|
+
</div><table class="source_code">
|
479
|
+
<tr>
|
480
|
+
<td>
|
481
|
+
<pre class="lines">
|
482
|
+
|
483
|
+
|
484
|
+
48
|
485
|
+
49
|
486
|
+
50
|
487
|
+
51
|
488
|
+
52
|
489
|
+
53
|
490
|
+
54
|
491
|
+
55
|
492
|
+
56
|
493
|
+
57
|
494
|
+
58
|
495
|
+
59
|
496
|
+
60
|
497
|
+
61
|
498
|
+
62
|
499
|
+
63
|
500
|
+
64</pre>
|
501
|
+
</td>
|
502
|
+
<td>
|
503
|
+
<pre class="code"><span class="info file"># File 'lib/resque/pool/dynamic/shell.rb', line 48</span>
|
504
|
+
|
505
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_help'>help</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
506
|
+
<span class='ivar'>@help</span> <span class='op'>||=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span>
|
507
|
+
<span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>help.json</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
508
|
+
<span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='const'>JSON</span><span class='op'>::</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
509
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_subject'>subject</span>
|
510
|
+
<span class='kw'>if</span> <span class='ivar'>@help</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='rparen'>)</span>
|
511
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='ivar'>@help</span><span class='lbracket'>[</span><span class='id identifier rubyid_subject'>subject</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>full</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
512
|
+
<span class='kw'>return</span>
|
513
|
+
<span class='kw'>end</span>
|
514
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I don't know anything about </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_subject'>subject</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
515
|
+
<span class='kw'>end</span>
|
516
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Known commands:</span><span class='tstring_end'>"</span></span>
|
517
|
+
<span class='ivar'>@help</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span>
|
518
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rbrace'>}</span><span class='tstring_content'> - </span><span class='embexpr_beg'>#{</span><span class='ivar'>@help</span><span class='lbracket'>[</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>summary</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
519
|
+
<span class='kw'>end</span>
|
520
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>For details, type: help command</span><span class='tstring_end'>"</span></span>
|
521
|
+
<span class='kw'>end</span></pre>
|
522
|
+
</td>
|
523
|
+
</tr>
|
524
|
+
</table>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div class="method_details ">
|
528
|
+
<p class="signature " id="print_eval_error-instance_method">
|
529
|
+
|
530
|
+
- (<tt>void</tt>) <strong>print_eval_error</strong>(e)
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
</p><div class="docstring">
|
535
|
+
<div class="discussion">
|
536
|
+
<p>
|
537
|
+
When printing error, cut backtrace at (ripl)
|
538
|
+
</p>
|
539
|
+
|
540
|
+
|
541
|
+
</div>
|
542
|
+
</div>
|
543
|
+
<div class="tags">
|
544
|
+
|
545
|
+
|
546
|
+
</div><table class="source_code">
|
547
|
+
<tr>
|
548
|
+
<td>
|
549
|
+
<pre class="lines">
|
550
|
+
|
551
|
+
|
552
|
+
28
|
553
|
+
29
|
554
|
+
30
|
555
|
+
31
|
556
|
+
32
|
557
|
+
33
|
558
|
+
34
|
559
|
+
35
|
560
|
+
36
|
561
|
+
37
|
562
|
+
38
|
563
|
+
39</pre>
|
564
|
+
</td>
|
565
|
+
<td>
|
566
|
+
<pre class="code"><span class="info file"># File 'lib/resque/pool/dynamic/shell.rb', line 28</span>
|
567
|
+
|
568
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_print_eval_error'>print_eval_error</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span>
|
569
|
+
<span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_ln'>ln</span><span class='op'>|</span> <span class='id identifier rubyid_ln'>ln</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\(ripl\):\d+:in `run'</span><span class='regexp_end'>/</span></span> <span class='rbrace'>}</span>
|
570
|
+
<span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_i'>i</span>
|
571
|
+
<span class='id identifier rubyid_bt'>bt</span> <span class='op'>=</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span>
|
572
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_i'>i</span> <span class='op'>></span> <span class='int'>0</span>
|
573
|
+
<span class='id identifier rubyid_bt'>bt</span> <span class='op'>=</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='id identifier rubyid_i'>i</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
|
574
|
+
<span class='kw'>else</span>
|
575
|
+
<span class='id identifier rubyid_bt'>bt</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
576
|
+
<span class='kw'>end</span>
|
577
|
+
<span class='id identifier rubyid_bt'>bt</span> <span class='op'>=</span> <span class='id identifier rubyid_bt'>bt</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_ln'>ln</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span> <span class='op'><<</span> <span class='id identifier rubyid_ln'>ln</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
578
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ERROR: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_bt'>bt</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
579
|
+
<span class='kw'>end</span></pre>
|
580
|
+
</td>
|
581
|
+
</tr>
|
582
|
+
</table>
|
583
|
+
</div>
|
584
|
+
|
585
|
+
<div class="method_details ">
|
586
|
+
<p class="signature " id="print_result-instance_method">
|
587
|
+
|
588
|
+
- (<tt>void</tt>) <strong>print_result</strong>(result)
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
</p><div class="docstring">
|
593
|
+
<div class="discussion">
|
594
|
+
<p>
|
595
|
+
Don’t print nil return values
|
596
|
+
</p>
|
597
|
+
|
598
|
+
|
599
|
+
</div>
|
600
|
+
</div>
|
601
|
+
<div class="tags">
|
602
|
+
|
603
|
+
|
604
|
+
</div><table class="source_code">
|
605
|
+
<tr>
|
606
|
+
<td>
|
607
|
+
<pre class="lines">
|
608
|
+
|
609
|
+
|
610
|
+
42
|
611
|
+
43
|
612
|
+
44</pre>
|
613
|
+
</td>
|
614
|
+
<td>
|
615
|
+
<pre class="code"><span class="info file"># File 'lib/resque/pool/dynamic/shell.rb', line 42</span>
|
616
|
+
|
617
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_print_result'>print_result</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
|
618
|
+
<span class='kw'>super</span> <span class='kw'>if</span> <span class='ivar'>@error_raised</span> <span class='kw'>or</span> <span class='op'>!</span><span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
619
|
+
<span class='kw'>end</span></pre>
|
620
|
+
</td>
|
621
|
+
</tr>
|
622
|
+
</table>
|
623
|
+
</div>
|
624
|
+
|
625
|
+
</div>
|
626
|
+
|
627
|
+
</div>
|
628
|
+
|
629
|
+
<div id="footer">
|
630
|
+
Generated on Wed Apr 25 21:03:03 2012 by
|
631
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
632
|
+
0.7.5 (ruby-1.9.2).
|
633
|
+
</div>
|
634
|
+
|
635
|
+
</body>
|
636
|
+
</html>
|