upstart-exporter 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1427 @@
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: Upstart::Exporter
8
+
9
+ &mdash; Documentation by YARD 0.7.4
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 (E)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../Upstart.html" title="Upstart (module)">Upstart</a></span></span>
38
+ &raquo;
39
+ <span class="title">Exporter</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: Upstart::Exporter
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">Object</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">Upstart::Exporter</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <dt class="r2 last">Defined in:</dt>
90
+ <dd class="r2 last">lib/upstart-exporter.rb<span class="defines">,<br />
91
+ lib/upstart-exporter/version.rb</span>
92
+ </dd>
93
+
94
+ </dl>
95
+ <div class="clear"></div>
96
+
97
+
98
+ <h2>Constant Summary</h2>
99
+
100
+ <dl class="constants">
101
+
102
+ <dt id="DEFAULTS-constant" class="">DEFAULTS =
103
+
104
+ </dt>
105
+ <dd><pre class="code"><span class='lbrace token'>{</span>
106
+ <span class='string val'>'helper_dir'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>'/var/local/upstart_helpers/'</span><span class='comma token'>,</span>
107
+ <span class='string val'>'upstart_dir'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>'/etc/init/'</span><span class='comma token'>,</span>
108
+ <span class='string val'>'run_user'</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>'service'</span>
109
+ <span class='rbrace token'>}</span>
110
+ </pre></dd>
111
+
112
+ <dt id="CONF-constant" class="">CONF =
113
+
114
+ </dt>
115
+ <dd><pre class="code"><span class='string val'>'/etc/upstart-exporter.yaml'</span>
116
+ </pre></dd>
117
+
118
+ <dt id="HELPER_TPL-constant" class="">HELPER_TPL =
119
+
120
+ </dt>
121
+ <dd><pre class="code"><span class='string val'>&quot;#!/bin/sh\n%s\n&quot;</span>
122
+ </pre></dd>
123
+
124
+ <dt id="APP_TPL-constant" class="">APP_TPL =
125
+
126
+ </dt>
127
+ <dd><pre class="code"><span class='string val'>&quot;pre-start script\n\nbash &lt;&lt; \&quot;EOF\&quot;\nmkdir -p /var/log/%s\nchown -R %s /var/log/%s\nEOF\n\nend script\n&quot;</span>
128
+ </pre></dd>
129
+
130
+ <dt id="COMMAND_TPL-constant" class="">COMMAND_TPL =
131
+
132
+ </dt>
133
+ <dd><pre class="code"><span class='string val'>&quot;start on starting %s\nstop on stopping %s\n&quot;</span>
134
+ </pre></dd>
135
+
136
+ <dt id="COMMAND_REAL_TPL-constant" class="">COMMAND_REAL_TPL =
137
+
138
+ </dt>
139
+ <dd><pre class="code"><span class='string val'>&quot;start on starting %s\nstop on stopping %s\nrespawn\n\nexec sudo -u %s /bin/sh %s &gt;&gt; /var/log/%s/%s.log 2&gt;&amp;1\n&quot;</span>
140
+ </pre></dd>
141
+
142
+ <dt id="VERSION-constant" class="">VERSION =
143
+
144
+ </dt>
145
+ <dd><pre class="code"><span class='string val'>&quot;0.0.4&quot;</span>
146
+ </pre></dd>
147
+
148
+ </dl>
149
+
150
+
151
+
152
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
153
+ <ul class="summary">
154
+
155
+ <li class="public ">
156
+ <span class="summary_signature">
157
+
158
+ <a href="#helper_dir-instance_method" title="#helper_dir (instance method)">- (Object) <strong>helper_dir</strong> </a>
159
+
160
+
161
+
162
+ </span>
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+ <span class="summary_desc"><div class='inline'><p>
175
+ Returns the value of attribute helper_dir.
176
+ </p>
177
+ </div></span>
178
+
179
+ </li>
180
+
181
+
182
+ <li class="public ">
183
+ <span class="summary_signature">
184
+
185
+ <a href="#run_user-instance_method" title="#run_user (instance method)">- (Object) <strong>run_user</strong> </a>
186
+
187
+
188
+
189
+ </span>
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+ <span class="summary_desc"><div class='inline'><p>
202
+ Returns the value of attribute run_user.
203
+ </p>
204
+ </div></span>
205
+
206
+ </li>
207
+
208
+
209
+ <li class="public ">
210
+ <span class="summary_signature">
211
+
212
+ <a href="#upstart_dir-instance_method" title="#upstart_dir (instance method)">- (Object) <strong>upstart_dir</strong> </a>
213
+
214
+
215
+
216
+ </span>
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+ <span class="summary_desc"><div class='inline'><p>
229
+ Returns the value of attribute upstart_dir.
230
+ </p>
231
+ </div></span>
232
+
233
+ </li>
234
+
235
+
236
+ </ul>
237
+
238
+
239
+
240
+
241
+
242
+ <h2>
243
+ Instance Method Summary
244
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
245
+ </h2>
246
+
247
+ <ul class="summary">
248
+
249
+ <li class="public ">
250
+ <span class="summary_signature">
251
+
252
+ <a href="#app_cmd-instance_method" title="#app_cmd (instance method)">- (Object) <strong>app_cmd</strong>(cmd_name) </a>
253
+
254
+
255
+
256
+ </span>
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ <span class="summary_desc"><div class='inline'></div></span>
266
+
267
+ </li>
268
+
269
+
270
+ <li class="public ">
271
+ <span class="summary_signature">
272
+
273
+ <a href="#check_dir-instance_method" title="#check_dir (instance method)">- (Object) <strong>check_dir</strong>(dir) </a>
274
+
275
+
276
+
277
+ </span>
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+ <span class="summary_desc"><div class='inline'></div></span>
287
+
288
+ </li>
289
+
290
+
291
+ <li class="public ">
292
+ <span class="summary_signature">
293
+
294
+ <a href="#clear-instance_method" title="#clear (instance method)">- (Object) <strong>clear</strong> </a>
295
+
296
+
297
+
298
+ </span>
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+ <span class="summary_desc"><div class='inline'></div></span>
308
+
309
+ </li>
310
+
311
+
312
+ <li class="public ">
313
+ <span class="summary_signature">
314
+
315
+ <a href="#error-instance_method" title="#error (instance method)">- (Object) <strong>error</strong>(msg) </a>
316
+
317
+
318
+
319
+ </span>
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+ <span class="summary_desc"><div class='inline'></div></span>
329
+
330
+ </li>
331
+
332
+
333
+ <li class="public ">
334
+ <span class="summary_signature">
335
+
336
+ <a href="#export-instance_method" title="#export (instance method)">- (Object) <strong>export</strong> </a>
337
+
338
+
339
+
340
+ </span>
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+ <span class="summary_desc"><div class='inline'></div></span>
350
+
351
+ </li>
352
+
353
+
354
+ <li class="public ">
355
+ <span class="summary_signature">
356
+
357
+ <a href="#export_app-instance_method" title="#export_app (instance method)">- (Object) <strong>export_app</strong> </a>
358
+
359
+
360
+
361
+ </span>
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+ <span class="summary_desc"><div class='inline'></div></span>
371
+
372
+ </li>
373
+
374
+
375
+ <li class="public ">
376
+ <span class="summary_signature">
377
+
378
+ <a href="#export_cmd_helper-instance_method" title="#export_cmd_helper (instance method)">- (Object) <strong>export_cmd_helper</strong>(cmd_name, cmd) </a>
379
+
380
+
381
+
382
+ </span>
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+ <span class="summary_desc"><div class='inline'></div></span>
392
+
393
+ </li>
394
+
395
+
396
+ <li class="public ">
397
+ <span class="summary_signature">
398
+
399
+ <a href="#export_cmd_upstart_confs-instance_method" title="#export_cmd_upstart_confs (instance method)">- (Object) <strong>export_cmd_upstart_confs</strong>(cmd_name) </a>
400
+
401
+
402
+
403
+ </span>
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+ <span class="summary_desc"><div class='inline'></div></span>
413
+
414
+ </li>
415
+
416
+
417
+ <li class="public ">
418
+ <span class="summary_signature">
419
+
420
+ <a href="#export_command-instance_method" title="#export_command (instance method)">- (Object) <strong>export_command</strong>(cmd_name, cmd) </a>
421
+
422
+
423
+
424
+ </span>
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+ <span class="summary_desc"><div class='inline'></div></span>
434
+
435
+ </li>
436
+
437
+
438
+ <li class="public ">
439
+ <span class="summary_signature">
440
+
441
+ <a href="#helper_cmd_conf-instance_method" title="#helper_cmd_conf (instance method)">- (Object) <strong>helper_cmd_conf</strong>(cmd_name) </a>
442
+
443
+
444
+
445
+ </span>
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+ <span class="summary_desc"><div class='inline'></div></span>
455
+
456
+ </li>
457
+
458
+
459
+ <li class="public ">
460
+ <span class="summary_signature">
461
+
462
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Exporter) <strong>initialize</strong>(options) </a>
463
+
464
+
465
+
466
+ </span>
467
+
468
+ <span class="note title constructor">constructor</span>
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+ <span class="summary_desc"><div class='inline'><p>
478
+ A new instance of Exporter.
479
+ </p>
480
+ </div></span>
481
+
482
+ </li>
483
+
484
+
485
+ <li class="public ">
486
+ <span class="summary_signature">
487
+
488
+ <a href="#process_appname-instance_method" title="#process_appname (instance method)">- (Object) <strong>process_appname</strong>(app_name) </a>
489
+
490
+
491
+
492
+ </span>
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+ <span class="summary_desc"><div class='inline'></div></span>
502
+
503
+ </li>
504
+
505
+
506
+ <li class="public ">
507
+ <span class="summary_signature">
508
+
509
+ <a href="#process_opts-instance_method" title="#process_opts (instance method)">- (Object) <strong>process_opts</strong>(options) </a>
510
+
511
+
512
+
513
+ </span>
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+ <span class="summary_desc"><div class='inline'></div></span>
523
+
524
+ </li>
525
+
526
+
527
+ <li class="public ">
528
+ <span class="summary_signature">
529
+
530
+ <a href="#process_procfile-instance_method" title="#process_procfile (instance method)">- (Object) <strong>process_procfile</strong>(name) </a>
531
+
532
+
533
+
534
+ </span>
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+ <span class="summary_desc"><div class='inline'></div></span>
544
+
545
+ </li>
546
+
547
+
548
+ <li class="public ">
549
+ <span class="summary_signature">
550
+
551
+ <a href="#read_global_opts-instance_method" title="#read_global_opts (instance method)">- (Object) <strong>read_global_opts</strong> </a>
552
+
553
+
554
+
555
+ </span>
556
+
557
+
558
+
559
+
560
+
561
+
562
+
563
+
564
+ <span class="summary_desc"><div class='inline'></div></span>
565
+
566
+ </li>
567
+
568
+
569
+ <li class="public ">
570
+ <span class="summary_signature">
571
+
572
+ <a href="#upstart_cmd_conf-instance_method" title="#upstart_cmd_conf (instance method)">- (Object) <strong>upstart_cmd_conf</strong>(cmd_name) </a>
573
+
574
+
575
+
576
+ </span>
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+ <span class="summary_desc"><div class='inline'></div></span>
586
+
587
+ </li>
588
+
589
+
590
+ <li class="public ">
591
+ <span class="summary_signature">
592
+
593
+ <a href="#upstart_conf-instance_method" title="#upstart_conf (instance method)">- (Object) <strong>upstart_conf</strong> </a>
594
+
595
+
596
+
597
+ </span>
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+ <span class="summary_desc"><div class='inline'></div></span>
607
+
608
+ </li>
609
+
610
+
611
+ </ul>
612
+
613
+
614
+ <div id="constructor_details" class="method_details_list">
615
+ <h2>Constructor Details</h2>
616
+
617
+ <div class="method_details first">
618
+ <p class="signature first" id="initialize-instance_method">
619
+
620
+ - (<tt><span class='object_link'><a href="" title="Upstart::Exporter (class)">Exporter</a></span></tt>) <strong>initialize</strong>(options)
621
+
622
+
623
+
624
+ </p><div class="docstring">
625
+ <div class="discussion">
626
+ <p>
627
+ A new instance of Exporter
628
+ </p>
629
+
630
+
631
+ </div>
632
+ </div>
633
+ <div class="tags">
634
+
635
+
636
+ </div><table class="source_code">
637
+ <tr>
638
+ <td>
639
+ <pre class="lines">
640
+
641
+
642
+ 16
643
+ 17
644
+ 18
645
+ 19
646
+ 20
647
+ 21</pre>
648
+ </td>
649
+ <td>
650
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 16</span>
651
+
652
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_options identifier id'>options</span><span class='rparen token'>)</span>
653
+ <span class='rubyid_process_opts identifier id'>process_opts</span><span class='lparen token'>(</span><span class='rubyid_options identifier id'>options</span><span class='rparen token'>)</span>
654
+ <span class='rubyid_read_global_opts identifier id'>read_global_opts</span>
655
+ <span class='rubyid_check_dir identifier id'>check_dir</span><span class='lparen token'>(</span><span class='rubyid_@helper_dir ivar id'>@helper_dir</span><span class='rparen token'>)</span>
656
+ <span class='rubyid_check_dir identifier id'>check_dir</span><span class='lparen token'>(</span><span class='rubyid_@upstart_dir ivar id'>@upstart_dir</span><span class='rparen token'>)</span>
657
+ <span class='rubyid_end end kw'>end</span>
658
+ </pre>
659
+ </td>
660
+ </tr>
661
+ </table>
662
+ </div>
663
+
664
+ </div>
665
+
666
+ <div id="instance_attr_details" class="attr_details">
667
+ <h2>Instance Attribute Details</h2>
668
+
669
+
670
+ <span id="helper_dir=-instance_method"></span>
671
+ <span id="helper_dir-instance_method"></span>
672
+ <div class="method_details first">
673
+ <p class="signature first" id="helper_dir-instance_method">
674
+
675
+ - (<tt>Object</tt>) <strong>helper_dir</strong>
676
+
677
+
678
+
679
+ </p><div class="docstring">
680
+ <div class="discussion">
681
+ <p>
682
+ Returns the value of attribute helper_dir
683
+ </p>
684
+
685
+
686
+ </div>
687
+ </div>
688
+ <div class="tags">
689
+
690
+
691
+ </div><table class="source_code">
692
+ <tr>
693
+ <td>
694
+ <pre class="lines">
695
+
696
+
697
+ 14
698
+ 15
699
+ 16</pre>
700
+ </td>
701
+ <td>
702
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 14</span>
703
+
704
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_helper_dir identifier id'>helper_dir</span>
705
+ <span class='rubyid_@helper_dir ivar id'>@helper_dir</span>
706
+ <span class='rubyid_end end kw'>end</span>
707
+ </pre>
708
+ </td>
709
+ </tr>
710
+ </table>
711
+ </div>
712
+
713
+
714
+ <span id="run_user=-instance_method"></span>
715
+ <span id="run_user-instance_method"></span>
716
+ <div class="method_details ">
717
+ <p class="signature " id="run_user-instance_method">
718
+
719
+ - (<tt>Object</tt>) <strong>run_user</strong>
720
+
721
+
722
+
723
+ </p><div class="docstring">
724
+ <div class="discussion">
725
+ <p>
726
+ Returns the value of attribute run_user
727
+ </p>
728
+
729
+
730
+ </div>
731
+ </div>
732
+ <div class="tags">
733
+
734
+
735
+ </div><table class="source_code">
736
+ <tr>
737
+ <td>
738
+ <pre class="lines">
739
+
740
+
741
+ 14
742
+ 15
743
+ 16</pre>
744
+ </td>
745
+ <td>
746
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 14</span>
747
+
748
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_run_user identifier id'>run_user</span>
749
+ <span class='rubyid_@run_user ivar id'>@run_user</span>
750
+ <span class='rubyid_end end kw'>end</span>
751
+ </pre>
752
+ </td>
753
+ </tr>
754
+ </table>
755
+ </div>
756
+
757
+
758
+ <span id="upstart_dir=-instance_method"></span>
759
+ <span id="upstart_dir-instance_method"></span>
760
+ <div class="method_details ">
761
+ <p class="signature " id="upstart_dir-instance_method">
762
+
763
+ - (<tt>Object</tt>) <strong>upstart_dir</strong>
764
+
765
+
766
+
767
+ </p><div class="docstring">
768
+ <div class="discussion">
769
+ <p>
770
+ Returns the value of attribute upstart_dir
771
+ </p>
772
+
773
+
774
+ </div>
775
+ </div>
776
+ <div class="tags">
777
+
778
+
779
+ </div><table class="source_code">
780
+ <tr>
781
+ <td>
782
+ <pre class="lines">
783
+
784
+
785
+ 14
786
+ 15
787
+ 16</pre>
788
+ </td>
789
+ <td>
790
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 14</span>
791
+
792
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_upstart_dir identifier id'>upstart_dir</span>
793
+ <span class='rubyid_@upstart_dir ivar id'>@upstart_dir</span>
794
+ <span class='rubyid_end end kw'>end</span>
795
+ </pre>
796
+ </td>
797
+ </tr>
798
+ </table>
799
+ </div>
800
+
801
+ </div>
802
+
803
+
804
+ <div id="instance_method_details" class="method_details_list">
805
+ <h2>Instance Method Details</h2>
806
+
807
+
808
+ <div class="method_details first">
809
+ <p class="signature first" id="app_cmd-instance_method">
810
+
811
+ - (<tt>Object</tt>) <strong>app_cmd</strong>(cmd_name)
812
+
813
+
814
+
815
+ </p><table class="source_code">
816
+ <tr>
817
+ <td>
818
+ <pre class="lines">
819
+
820
+
821
+ 126
822
+ 127
823
+ 128</pre>
824
+ </td>
825
+ <td>
826
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 126</span>
827
+
828
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_app_cmd identifier id'>app_cmd</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span>
829
+ <span class='dstring node'>&quot;#{@app_name}-#{cmd_name}&quot;</span>
830
+ <span class='rubyid_end end kw'>end</span>
831
+ </pre>
832
+ </td>
833
+ </tr>
834
+ </table>
835
+ </div>
836
+
837
+ <div class="method_details ">
838
+ <p class="signature " id="check_dir-instance_method">
839
+
840
+ - (<tt>Object</tt>) <strong>check_dir</strong>(dir)
841
+
842
+
843
+
844
+ </p><table class="source_code">
845
+ <tr>
846
+ <td>
847
+ <pre class="lines">
848
+
849
+
850
+ 75
851
+ 76
852
+ 77
853
+ 78</pre>
854
+ </td>
855
+ <td>
856
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 75</span>
857
+
858
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_check_dir identifier id'>check_dir</span><span class='lparen token'>(</span><span class='rubyid_dir identifier id'>dir</span><span class='rparen token'>)</span>
859
+ <span class='rubyid_FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='rubyid_mkdir_p identifier id'>mkdir_p</span><span class='lparen token'>(</span><span class='rubyid_dir identifier id'>dir</span><span class='rparen token'>)</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_FileTest constant id'>FileTest</span><span class='dot token'>.</span><span class='rubyid_directory? fid id'>directory?</span><span class='lparen token'>(</span><span class='rubyid_dir identifier id'>dir</span><span class='rparen token'>)</span>
860
+ <span class='rubyid_error identifier id'>error</span> <span class='dstring node'>&quot;Path #{dir} does not exist&quot;</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_FileTest constant id'>FileTest</span><span class='dot token'>.</span><span class='rubyid_directory? fid id'>directory?</span><span class='lparen token'>(</span><span class='rubyid_dir identifier id'>dir</span><span class='rparen token'>)</span>
861
+ <span class='rubyid_end end kw'>end</span>
862
+ </pre>
863
+ </td>
864
+ </tr>
865
+ </table>
866
+ </div>
867
+
868
+ <div class="method_details ">
869
+ <p class="signature " id="clear-instance_method">
870
+
871
+ - (<tt>Object</tt>) <strong>clear</strong>
872
+
873
+
874
+
875
+ </p><table class="source_code">
876
+ <tr>
877
+ <td>
878
+ <pre class="lines">
879
+
880
+
881
+ 138
882
+ 139
883
+ 140
884
+ 141
885
+ 142
886
+ 143
887
+ 144
888
+ 145
889
+ 146</pre>
890
+ </td>
891
+ <td>
892
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 138</span>
893
+
894
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_clear identifier id'>clear</span>
895
+ <span class='rubyid_FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='rubyid_rm identifier id'>rm</span><span class='lparen token'>(</span><span class='rubyid_upstart_conf identifier id'>upstart_conf</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_FileTest constant id'>FileTest</span><span class='dot token'>.</span><span class='rubyid_file? fid id'>file?</span><span class='lparen token'>(</span><span class='rubyid_upstart_conf identifier id'>upstart_conf</span><span class='rparen token'>)</span>
896
+ <span class='rubyid_Dir constant id'>Dir</span><span class='lbrack token'>[</span><span class='rubyid_upstart_cmd_conf identifier id'>upstart_cmd_conf</span><span class='lparen token'>(</span><span class='string val'>'*'</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
897
+ <span class='rubyid_FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='rubyid_rm identifier id'>rm</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='rparen token'>)</span>
898
+ <span class='rubyid_end end kw'>end</span>
899
+ <span class='rubyid_Dir constant id'>Dir</span><span class='lbrack token'>[</span><span class='rubyid_helper_cmd_conf identifier id'>helper_cmd_conf</span><span class='lparen token'>(</span><span class='string val'>'*'</span><span class='rparen token'>)</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
900
+ <span class='rubyid_FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='rubyid_rm identifier id'>rm</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='rparen token'>)</span>
901
+ <span class='rubyid_end end kw'>end</span>
902
+ <span class='rubyid_end end kw'>end</span>
903
+ </pre>
904
+ </td>
905
+ </tr>
906
+ </table>
907
+ </div>
908
+
909
+ <div class="method_details ">
910
+ <p class="signature " id="error-instance_method">
911
+
912
+ - (<tt>Object</tt>) <strong>error</strong>(msg)
913
+
914
+
915
+
916
+ </p><div class="docstring">
917
+ <div class="discussion">
918
+
919
+
920
+ </div>
921
+ </div>
922
+ <div class="tags">
923
+
924
+ <h3>Raises:</h3>
925
+ <ul class="raise">
926
+
927
+ <li>
928
+
929
+
930
+ <span class='type'>(<tt><span class='object_link'><a href="ExportError.html" title="Upstart::ExportError (class)">Upstart::ExportError</a></span></tt>)</span>
931
+
932
+
933
+
934
+ </li>
935
+
936
+ </ul>
937
+
938
+ </div><table class="source_code">
939
+ <tr>
940
+ <td>
941
+ <pre class="lines">
942
+
943
+
944
+ 179
945
+ 180
946
+ 181</pre>
947
+ </td>
948
+ <td>
949
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 179</span>
950
+
951
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_error identifier id'>error</span><span class='lparen token'>(</span><span class='rubyid_msg identifier id'>msg</span><span class='rparen token'>)</span>
952
+ <span class='rubyid_raise identifier id'>raise</span> <span class='rubyid_Upstart constant id'>Upstart</span><span class='colon2 op'>::</span><span class='rubyid_ExportError constant id'>ExportError</span><span class='comma token'>,</span> <span class='rubyid_msg identifier id'>msg</span>
953
+ <span class='rubyid_end end kw'>end</span>
954
+ </pre>
955
+ </td>
956
+ </tr>
957
+ </table>
958
+ </div>
959
+
960
+ <div class="method_details ">
961
+ <p class="signature " id="export-instance_method">
962
+
963
+ - (<tt>Object</tt>) <strong>export</strong>
964
+
965
+
966
+
967
+ </p><table class="source_code">
968
+ <tr>
969
+ <td>
970
+ <pre class="lines">
971
+
972
+
973
+ 80
974
+ 81
975
+ 82
976
+ 83
977
+ 84
978
+ 85
979
+ 86</pre>
980
+ </td>
981
+ <td>
982
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 80</span>
983
+
984
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_export identifier id'>export</span>
985
+ <span class='rubyid_clear identifier id'>clear</span>
986
+ <span class='rubyid_export_app identifier id'>export_app</span>
987
+ <span class='rubyid_@commands ivar id'>@commands</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='comma token'>,</span> <span class='rubyid_cmd identifier id'>cmd</span><span class='bitor op'>|</span>
988
+ <span class='rubyid_export_command identifier id'>export_command</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='comma token'>,</span> <span class='rubyid_cmd identifier id'>cmd</span><span class='rparen token'>)</span>
989
+ <span class='rubyid_end end kw'>end</span>
990
+ <span class='rubyid_end end kw'>end</span>
991
+ </pre>
992
+ </td>
993
+ </tr>
994
+ </table>
995
+ </div>
996
+
997
+ <div class="method_details ">
998
+ <p class="signature " id="export_app-instance_method">
999
+
1000
+ - (<tt>Object</tt>) <strong>export_app</strong>
1001
+
1002
+
1003
+
1004
+ </p><table class="source_code">
1005
+ <tr>
1006
+ <td>
1007
+ <pre class="lines">
1008
+
1009
+
1010
+ 148
1011
+ 149
1012
+ 150
1013
+ 151
1014
+ 152
1015
+ 153</pre>
1016
+ </td>
1017
+ <td>
1018
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 148</span>
1019
+
1020
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_export_app identifier id'>export_app</span>
1021
+ <span class='rubyid_app_conf identifier id'>app_conf</span> <span class='assign token'>=</span> <span class='rubyid_APP_TPL constant id'>APP_TPL</span> <span class='mod op'>%</span> <span class='lbrack token'>[</span><span class='rubyid_@app_name ivar id'>@app_name</span><span class='comma token'>,</span> <span class='rubyid_@run_user ivar id'>@run_user</span><span class='comma token'>,</span> <span class='rubyid_@app_name ivar id'>@app_name</span><span class='rbrack token'>]</span>
1022
+ <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_upstart_conf identifier id'>upstart_conf</span><span class='comma token'>,</span> <span class='string val'>'w'</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
1023
+ <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_write identifier id'>write</span><span class='lparen token'>(</span><span class='rubyid_app_conf identifier id'>app_conf</span><span class='rparen token'>)</span>
1024
+ <span class='rubyid_end end kw'>end</span>
1025
+ <span class='rubyid_end end kw'>end</span>
1026
+ </pre>
1027
+ </td>
1028
+ </tr>
1029
+ </table>
1030
+ </div>
1031
+
1032
+ <div class="method_details ">
1033
+ <p class="signature " id="export_cmd_helper-instance_method">
1034
+
1035
+ - (<tt>Object</tt>) <strong>export_cmd_helper</strong>(cmd_name, cmd)
1036
+
1037
+
1038
+
1039
+ </p><table class="source_code">
1040
+ <tr>
1041
+ <td>
1042
+ <pre class="lines">
1043
+
1044
+
1045
+ 155
1046
+ 156
1047
+ 157
1048
+ 158
1049
+ 159
1050
+ 160</pre>
1051
+ </td>
1052
+ <td>
1053
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 155</span>
1054
+
1055
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_export_cmd_helper identifier id'>export_cmd_helper</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='comma token'>,</span> <span class='rubyid_cmd identifier id'>cmd</span><span class='rparen token'>)</span>
1056
+ <span class='rubyid_helper_script_cont identifier id'>helper_script_cont</span> <span class='assign token'>=</span> <span class='rubyid_HELPER_TPL constant id'>HELPER_TPL</span> <span class='mod op'>%</span> <span class='lbrack token'>[</span><span class='rubyid_cmd identifier id'>cmd</span><span class='rbrack token'>]</span>
1057
+ <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_helper_cmd_conf identifier id'>helper_cmd_conf</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='string val'>'w'</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
1058
+ <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_write identifier id'>write</span><span class='lparen token'>(</span><span class='rubyid_helper_script_cont identifier id'>helper_script_cont</span><span class='rparen token'>)</span>
1059
+ <span class='rubyid_end end kw'>end</span>
1060
+ <span class='rubyid_end end kw'>end</span>
1061
+ </pre>
1062
+ </td>
1063
+ </tr>
1064
+ </table>
1065
+ </div>
1066
+
1067
+ <div class="method_details ">
1068
+ <p class="signature " id="export_cmd_upstart_confs-instance_method">
1069
+
1070
+ - (<tt>Object</tt>) <strong>export_cmd_upstart_confs</strong>(cmd_name)
1071
+
1072
+
1073
+
1074
+ </p><table class="source_code">
1075
+ <tr>
1076
+ <td>
1077
+ <pre class="lines">
1078
+
1079
+
1080
+ 162
1081
+ 163
1082
+ 164
1083
+ 165
1084
+ 166
1085
+ 167
1086
+ 168
1087
+ 169
1088
+ 170
1089
+ 171
1090
+ 172</pre>
1091
+ </td>
1092
+ <td>
1093
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 162</span>
1094
+
1095
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_export_cmd_upstart_confs identifier id'>export_cmd_upstart_confs</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span>
1096
+ <span class='rubyid_cmd_upstart_conf_content identifier id'>cmd_upstart_conf_content</span> <span class='assign token'>=</span> <span class='rubyid_COMMAND_TPL constant id'>COMMAND_TPL</span> <span class='mod op'>%</span> <span class='lbrack token'>[</span><span class='rubyid_@app_name ivar id'>@app_name</span><span class='comma token'>,</span> <span class='rubyid_@app_name ivar id'>@app_name</span><span class='rbrack token'>]</span>
1097
+ <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_upstart_cmd_conf identifier id'>upstart_cmd_conf</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='string val'>'w'</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
1098
+ <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_write identifier id'>write</span><span class='lparen token'>(</span><span class='rubyid_cmd_upstart_conf_content identifier id'>cmd_upstart_conf_content</span><span class='rparen token'>)</span>
1099
+ <span class='rubyid_end end kw'>end</span>
1100
+
1101
+ <span class='rubyid_cmd_upstart_conf_content_real identifier id'>cmd_upstart_conf_content_real</span> <span class='assign token'>=</span> <span class='rubyid_COMMAND_REAL_TPL constant id'>COMMAND_REAL_TPL</span> <span class='mod op'>%</span> <span class='lbrack token'>[</span><span class='rubyid_app_cmd identifier id'>app_cmd</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_app_cmd identifier id'>app_cmd</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_@run_user ivar id'>@run_user</span><span class='comma token'>,</span> <span class='rubyid_helper_cmd_conf identifier id'>helper_cmd_conf</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_@app_name ivar id'>@app_name</span><span class='comma token'>,</span> <span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rbrack token'>]</span>
1102
+ <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_open identifier id'>open</span><span class='lparen token'>(</span><span class='rubyid_upstart_cmd_conf identifier id'>upstart_cmd_conf</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span> <span class='plus op'>+</span> <span class='string val'>'-real'</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='string val'>'w'</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_f identifier id'>f</span><span class='bitor op'>|</span>
1103
+ <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_write identifier id'>write</span><span class='lparen token'>(</span><span class='rubyid_cmd_upstart_conf_content_real identifier id'>cmd_upstart_conf_content_real</span><span class='rparen token'>)</span>
1104
+ <span class='rubyid_end end kw'>end</span>
1105
+ <span class='rubyid_end end kw'>end</span>
1106
+ </pre>
1107
+ </td>
1108
+ </tr>
1109
+ </table>
1110
+ </div>
1111
+
1112
+ <div class="method_details ">
1113
+ <p class="signature " id="export_command-instance_method">
1114
+
1115
+ - (<tt>Object</tt>) <strong>export_command</strong>(cmd_name, cmd)
1116
+
1117
+
1118
+
1119
+ </p><table class="source_code">
1120
+ <tr>
1121
+ <td>
1122
+ <pre class="lines">
1123
+
1124
+
1125
+ 174
1126
+ 175
1127
+ 176
1128
+ 177</pre>
1129
+ </td>
1130
+ <td>
1131
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 174</span>
1132
+
1133
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_export_command identifier id'>export_command</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='comma token'>,</span> <span class='rubyid_cmd identifier id'>cmd</span><span class='rparen token'>)</span>
1134
+ <span class='rubyid_export_cmd_helper identifier id'>export_cmd_helper</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='comma token'>,</span> <span class='rubyid_cmd identifier id'>cmd</span><span class='rparen token'>)</span>
1135
+ <span class='rubyid_export_cmd_upstart_confs identifier id'>export_cmd_upstart_confs</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span>
1136
+ <span class='rubyid_end end kw'>end</span>
1137
+ </pre>
1138
+ </td>
1139
+ </tr>
1140
+ </table>
1141
+ </div>
1142
+
1143
+ <div class="method_details ">
1144
+ <p class="signature " id="helper_cmd_conf-instance_method">
1145
+
1146
+ - (<tt>Object</tt>) <strong>helper_cmd_conf</strong>(cmd_name)
1147
+
1148
+
1149
+
1150
+ </p><table class="source_code">
1151
+ <tr>
1152
+ <td>
1153
+ <pre class="lines">
1154
+
1155
+
1156
+ 134
1157
+ 135
1158
+ 136</pre>
1159
+ </td>
1160
+ <td>
1161
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 134</span>
1162
+
1163
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_helper_cmd_conf identifier id'>helper_cmd_conf</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span>
1164
+ <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_join identifier id'>join</span><span class='lparen token'>(</span><span class='rubyid_@helper_dir ivar id'>@helper_dir</span><span class='comma token'>,</span> <span class='dstring node'>&quot;#{app_cmd(cmd_name)}.sh&quot;</span><span class='rparen token'>)</span>
1165
+ <span class='rubyid_end end kw'>end</span>
1166
+ </pre>
1167
+ </td>
1168
+ </tr>
1169
+ </table>
1170
+ </div>
1171
+
1172
+ <div class="method_details ">
1173
+ <p class="signature " id="process_appname-instance_method">
1174
+
1175
+ - (<tt>Object</tt>) <strong>process_appname</strong>(app_name)
1176
+
1177
+
1178
+
1179
+ </p><table class="source_code">
1180
+ <tr>
1181
+ <td>
1182
+ <pre class="lines">
1183
+
1184
+
1185
+ 70
1186
+ 71
1187
+ 72
1188
+ 73</pre>
1189
+ </td>
1190
+ <td>
1191
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 70</span>
1192
+
1193
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_process_appname identifier id'>process_appname</span><span class='lparen token'>(</span><span class='rubyid_app_name identifier id'>app_name</span><span class='rparen token'>)</span>
1194
+ <span class='rubyid_error identifier id'>error</span> <span class='dstring node'>&quot;Application name should contain only letters (and underscore) and be nonempty, so #{app_name.inspect} is not suitable&quot;</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_app_name identifier id'>app_name</span> <span class='match op'>=~</span> <span class='regexp val'>/^\w+$/</span>
1195
+ <span class='rubyid_@app_name ivar id'>@app_name</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;fb-#{app_name}&quot;</span>
1196
+ <span class='rubyid_end end kw'>end</span>
1197
+ </pre>
1198
+ </td>
1199
+ </tr>
1200
+ </table>
1201
+ </div>
1202
+
1203
+ <div class="method_details ">
1204
+ <p class="signature " id="process_opts-instance_method">
1205
+
1206
+ - (<tt>Object</tt>) <strong>process_opts</strong>(options)
1207
+
1208
+
1209
+
1210
+ </p><table class="source_code">
1211
+ <tr>
1212
+ <td>
1213
+ <pre class="lines">
1214
+
1215
+
1216
+ 42
1217
+ 43
1218
+ 44
1219
+ 45
1220
+ 46
1221
+ 47
1222
+ 48
1223
+ 49</pre>
1224
+ </td>
1225
+ <td>
1226
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 42</span>
1227
+
1228
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_process_opts identifier id'>process_opts</span><span class='lparen token'>(</span><span class='rubyid_options identifier id'>options</span><span class='rparen token'>)</span>
1229
+ <span class='rubyid_@commands ivar id'>@commands</span> <span class='assign token'>=</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:clear</span><span class='rbrack token'>]</span>
1230
+ <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
1231
+ <span class='rubyid_else else kw'>else</span>
1232
+ <span class='rubyid_process_procfile identifier id'>process_procfile</span><span class='lparen token'>(</span><span class='rubyid_options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:procfile</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
1233
+ <span class='rubyid_end end kw'>end</span>
1234
+ <span class='rubyid_process_appname identifier id'>process_appname</span><span class='lparen token'>(</span><span class='rubyid_options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:app_name</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
1235
+ <span class='rubyid_end end kw'>end</span>
1236
+ </pre>
1237
+ </td>
1238
+ </tr>
1239
+ </table>
1240
+ </div>
1241
+
1242
+ <div class="method_details ">
1243
+ <p class="signature " id="process_procfile-instance_method">
1244
+
1245
+ - (<tt>Object</tt>) <strong>process_procfile</strong>(name)
1246
+
1247
+
1248
+
1249
+ </p><table class="source_code">
1250
+ <tr>
1251
+ <td>
1252
+ <pre class="lines">
1253
+
1254
+
1255
+ 51
1256
+ 52
1257
+ 53
1258
+ 54
1259
+ 55
1260
+ 56
1261
+ 57
1262
+ 58
1263
+ 59
1264
+ 60
1265
+ 61
1266
+ 62
1267
+ 63
1268
+ 64
1269
+ 65
1270
+ 66
1271
+ 67
1272
+ 68</pre>
1273
+ </td>
1274
+ <td>
1275
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 51</span>
1276
+
1277
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_process_procfile identifier id'>process_procfile</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span>
1278
+ <span class='rubyid_error identifier id'>error</span> <span class='dstring node'>&quot;#{name} is not a readable file&quot;</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_FileTest constant id'>FileTest</span><span class='dot token'>.</span><span class='rubyid_file? fid id'>file?</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span>
1279
+ <span class='rubyid_commands identifier id'>commands</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
1280
+ <span class='rubyid_content identifier id'>content</span> <span class='assign token'>=</span> <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_read identifier id'>read</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span>
1281
+ <span class='rubyid_content identifier id'>content</span><span class='dot token'>.</span><span class='rubyid_lines identifier id'>lines</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_line identifier id'>line</span><span class='bitor op'>|</span>
1282
+ <span class='rubyid_line identifier id'>line</span><span class='dot token'>.</span><span class='rubyid_chomp! fid id'>chomp!</span>
1283
+ <span class='rubyid_if if kw'>if</span> <span class='rubyid_line identifier id'>line</span> <span class='match op'>=~</span> <span class='regexp val'>/^(\w+?):(.*)$/</span>
1284
+ <span class='rubyid_label identifier id'>label</span> <span class='assign token'>=</span> <span class='rubyid_$1 nth_ref id'>$1</span>
1285
+ <span class='rubyid_command identifier id'>command</span> <span class='assign token'>=</span> <span class='rubyid_$2 nth_ref id'>$2</span>
1286
+ <span class='rubyid_commands identifier id'>commands</span><span class='lbrack token'>[</span><span class='rubyid_label identifier id'>label</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_command identifier id'>command</span>
1287
+ <span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_line identifier id'>line</span> <span class='match op'>=~</span> <span class='regexp val'>/^\s*$/</span>
1288
+ <span class='comment val'># do nothing</span>
1289
+ <span class='rubyid_else else kw'>else</span>
1290
+ <span class='rubyid_error identifier id'>error</span> <span class='string val'>&quot;procfile lines should have the following format: 'some_label: command'&quot;</span>
1291
+ <span class='rubyid_end end kw'>end</span>
1292
+ <span class='rubyid_end end kw'>end</span>
1293
+ <span class='rubyid_commands identifier id'>commands</span>
1294
+ <span class='rubyid_end end kw'>end</span>
1295
+ </pre>
1296
+ </td>
1297
+ </tr>
1298
+ </table>
1299
+ </div>
1300
+
1301
+ <div class="method_details ">
1302
+ <p class="signature " id="read_global_opts-instance_method">
1303
+
1304
+ - (<tt>Object</tt>) <strong>read_global_opts</strong>
1305
+
1306
+
1307
+
1308
+ </p><table class="source_code">
1309
+ <tr>
1310
+ <td>
1311
+ <pre class="lines">
1312
+
1313
+
1314
+ 24
1315
+ 25
1316
+ 26
1317
+ 27
1318
+ 28
1319
+ 29
1320
+ 30
1321
+ 31
1322
+ 32
1323
+ 33
1324
+ 34
1325
+ 35
1326
+ 36
1327
+ 37
1328
+ 38
1329
+ 39
1330
+ 40</pre>
1331
+ </td>
1332
+ <td>
1333
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 24</span>
1334
+
1335
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_read_global_opts identifier id'>read_global_opts</span>
1336
+ <span class='rubyid_config identifier id'>config</span> <span class='assign token'>=</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_FileTest constant id'>FileTest</span><span class='dot token'>.</span><span class='rubyid_file? fid id'>file?</span><span class='lparen token'>(</span><span class='rubyid_CONF constant id'>CONF</span><span class='rparen token'>)</span>
1337
+ <span class='rubyid_YAML constant id'>YAML</span><span class='colon2 op'>::</span><span class='rubyid_load identifier id'>load</span><span class='lparen token'>(</span><span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_read identifier id'>read</span><span class='lparen token'>(</span><span class='rubyid_CONF constant id'>CONF</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
1338
+ <span class='rubyid_else else kw'>else</span>
1339
+ <span class='rubyid_STDERR constant id'>STDERR</span><span class='dot token'>.</span><span class='rubyid_puts identifier id'>puts</span> <span class='dstring node'>&quot;#{CONF} not found&quot;</span>
1340
+ <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
1341
+ <span class='rubyid_end end kw'>end</span>
1342
+ <span class='dstring node'>%w{helper_dir upstart_dir run_user}</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_param identifier id'>param</span><span class='bitor op'>|</span>
1343
+ <span class='rubyid_value identifier id'>value</span> <span class='assign token'>=</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_config identifier id'>config</span><span class='lbrack token'>[</span><span class='rubyid_param identifier id'>param</span><span class='rbrack token'>]</span>
1344
+ <span class='rubyid_config identifier id'>config</span><span class='lbrack token'>[</span><span class='rubyid_param identifier id'>param</span><span class='rbrack token'>]</span>
1345
+ <span class='rubyid_else else kw'>else</span>
1346
+ <span class='rubyid_STDERR constant id'>STDERR</span><span class='dot token'>.</span><span class='rubyid_puts identifier id'>puts</span> <span class='dstring node'>&quot;Param #{param} is not set, taking default value #{DEFAULTS[param]}&quot;</span>
1347
+ <span class='rubyid_DEFAULTS constant id'>DEFAULTS</span><span class='lbrack token'>[</span><span class='rubyid_param identifier id'>param</span><span class='rbrack token'>]</span>
1348
+ <span class='rubyid_end end kw'>end</span>
1349
+ <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_send identifier id'>send</span> <span class='dstring node'>&quot;#{param}=&quot;</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span>
1350
+ <span class='rubyid_end end kw'>end</span>
1351
+ <span class='rubyid_end end kw'>end</span>
1352
+ </pre>
1353
+ </td>
1354
+ </tr>
1355
+ </table>
1356
+ </div>
1357
+
1358
+ <div class="method_details ">
1359
+ <p class="signature " id="upstart_cmd_conf-instance_method">
1360
+
1361
+ - (<tt>Object</tt>) <strong>upstart_cmd_conf</strong>(cmd_name)
1362
+
1363
+
1364
+
1365
+ </p><table class="source_code">
1366
+ <tr>
1367
+ <td>
1368
+ <pre class="lines">
1369
+
1370
+
1371
+ 130
1372
+ 131
1373
+ 132</pre>
1374
+ </td>
1375
+ <td>
1376
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 130</span>
1377
+
1378
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_upstart_cmd_conf identifier id'>upstart_cmd_conf</span><span class='lparen token'>(</span><span class='rubyid_cmd_name identifier id'>cmd_name</span><span class='rparen token'>)</span>
1379
+ <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_join identifier id'>join</span><span class='lparen token'>(</span><span class='rubyid_@upstart_dir ivar id'>@upstart_dir</span><span class='comma token'>,</span> <span class='dstring node'>&quot;#{app_cmd(cmd_name)}.conf&quot;</span><span class='rparen token'>)</span>
1380
+ <span class='rubyid_end end kw'>end</span>
1381
+ </pre>
1382
+ </td>
1383
+ </tr>
1384
+ </table>
1385
+ </div>
1386
+
1387
+ <div class="method_details ">
1388
+ <p class="signature " id="upstart_conf-instance_method">
1389
+
1390
+ - (<tt>Object</tt>) <strong>upstart_conf</strong>
1391
+
1392
+
1393
+
1394
+ </p><table class="source_code">
1395
+ <tr>
1396
+ <td>
1397
+ <pre class="lines">
1398
+
1399
+
1400
+ 122
1401
+ 123
1402
+ 124</pre>
1403
+ </td>
1404
+ <td>
1405
+ <pre class="code"><span class="info file"># File 'lib/upstart-exporter.rb', line 122</span>
1406
+
1407
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_upstart_conf identifier id'>upstart_conf</span>
1408
+ <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_join identifier id'>join</span><span class='lparen token'>(</span><span class='rubyid_@upstart_dir ivar id'>@upstart_dir</span><span class='comma token'>,</span> <span class='dstring node'>&quot;#{@app_name}.conf&quot;</span><span class='rparen token'>)</span>
1409
+ <span class='rubyid_end end kw'>end</span>
1410
+ </pre>
1411
+ </td>
1412
+ </tr>
1413
+ </table>
1414
+ </div>
1415
+
1416
+ </div>
1417
+
1418
+ </div>
1419
+
1420
+ <div id="footer">
1421
+ Generated on Thu Dec 15 17:00:58 2011 by
1422
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1423
+ 0.7.4 (ruby-1.8.7).
1424
+ </div>
1425
+
1426
+ </body>
1427
+ </html>