my_help 1.2.2 → 1.2.4p1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +5 -5
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile.lock +11 -12
- data/README.org +117 -84
- data/README_e.org +110 -0
- data/Rakefile +20 -1
- data/development_memo.org +5 -0
- data/doc/MyHelp/CLI.html +56 -54
- data/doc/MyHelp/Config.html +4 -4
- data/doc/MyHelp/Error.html +3 -3
- data/doc/MyHelp/GetConfig.html +3 -3
- data/doc/MyHelp/Git.html +3 -3
- data/doc/MyHelp/Init.html +3 -3
- data/doc/MyHelp/List.html +19 -15
- data/doc/MyHelp/Md2Hash.html +3 -3
- data/doc/MyHelp/Modify.html +3 -3
- data/doc/MyHelp/Org2Hash.html +7 -5
- data/doc/MyHelp.html +4 -4
- data/doc/Org2Yaml.html +3 -3
- data/doc/_index.html +4 -4
- data/doc/file.README.html +3 -3
- data/doc/frames.html +10 -5
- data/doc/index.html +3 -3
- data/doc/top-level-namespace.html +3 -3
- data/lib/my_help/cli.rb +29 -2
- data/lib/my_help/config.rb +1 -1
- data/lib/my_help/list.rb +5 -3
- data/lib/my_help/org2hash.rb +2 -1
- data/lib/my_help/version.rb +1 -1
- data/lib/templates/emacs.org +2 -1
- data/lib/templates/emacs_j.org +76 -0
- data/lib/templates/example.org +5 -6
- data/lib/templates/my_help_j.org +24 -0
- data/lib/templates/org_j.org +25 -0
- data/my_help_install.org +33 -0
- metadata +8 -7
- data/README_j.org +0 -143
- data/doc/MyHelp/Control.html +0 -1127
- data/doc/OrgToYaml.html +0 -497
- data/tmp.txt +0 -14
data/doc/MyHelp/Control.html
DELETED
@@ -1,1127 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: MyHelp::Control
|
8
|
-
|
9
|
-
— my_help
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
-
|
17
|
-
<script type="text/javascript">
|
18
|
-
pathId = "MyHelp::Control";
|
19
|
-
relpath = '../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../_index.html">Index (C)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../MyHelp.html" title="MyHelp (module)">MyHelp</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">Control</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: MyHelp::Control
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName">Object</span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li>Object</li>
|
76
|
-
|
77
|
-
<li class="next">MyHelp::Control</li>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
<a href="#" class="inheritanceTree">show all</a>
|
81
|
-
|
82
|
-
</dd>
|
83
|
-
</dl>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<dl>
|
96
|
-
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/my_help/my_help_controll.rb</dd>
|
98
|
-
</dl>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
<h2>
|
105
|
-
Constant Summary
|
106
|
-
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
107
|
-
</h2>
|
108
|
-
|
109
|
-
<dl class="constants">
|
110
|
-
|
111
|
-
<dt id="WrongFileName-constant" class="">WrongFileName =
|
112
|
-
|
113
|
-
</dt>
|
114
|
-
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>RuntimeError</span><span class='rparen'>)</span></pre></dd>
|
115
|
-
|
116
|
-
<dt id="WrongItemName-constant" class="">WrongItemName =
|
117
|
-
|
118
|
-
</dt>
|
119
|
-
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>RuntimeError</span><span class='rparen'>)</span></pre></dd>
|
120
|
-
|
121
|
-
</dl>
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
128
|
-
<ul class="summary">
|
129
|
-
|
130
|
-
<li class="public ">
|
131
|
-
<span class="summary_signature">
|
132
|
-
|
133
|
-
<a href="#editor-instance_method" title="#editor (instance method)">#<strong>editor</strong> ⇒ Object </a>
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
</span>
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
<span class="summary_desc"><div class='inline'>
|
151
|
-
<p>Returns the value of attribute editor.</p>
|
152
|
-
</div></span>
|
153
|
-
|
154
|
-
</li>
|
155
|
-
|
156
|
-
|
157
|
-
<li class="public ">
|
158
|
-
<span class="summary_signature">
|
159
|
-
|
160
|
-
<a href="#local_help_dir-instance_method" title="#local_help_dir (instance method)">#<strong>local_help_dir</strong> ⇒ Object </a>
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
</span>
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
<span class="summary_desc"><div class='inline'>
|
178
|
-
<p>Returns the value of attribute local_help_dir.</p>
|
179
|
-
</div></span>
|
180
|
-
|
181
|
-
</li>
|
182
|
-
|
183
|
-
|
184
|
-
</ul>
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
<h2>
|
191
|
-
Instance Method Summary
|
192
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
193
|
-
</h2>
|
194
|
-
|
195
|
-
<ul class="summary">
|
196
|
-
|
197
|
-
<li class="public ">
|
198
|
-
<span class="summary_signature">
|
199
|
-
|
200
|
-
<a href="#delete_help-instance_method" title="#delete_help (instance method)">#<strong>delete_help</strong>(file) ⇒ Object </a>
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
</span>
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
<span class="summary_desc"><div class='inline'>
|
215
|
-
<p>def delete_help(file) file = File.join(@local_help_dir,file+'.org') print “Are you sure to delete ”<code>file.blue"?[Ynq]</code> “.red case STDIN.gets.chomp when 'Y' begin FileUtils.rm(file,:verbose=>true) rescue => error puts error.to_s.red end when 'n', 'q' ; exit end end.</p>
|
216
|
-
</div></span>
|
217
|
-
|
218
|
-
</li>
|
219
|
-
|
220
|
-
|
221
|
-
<li class="public ">
|
222
|
-
<span class="summary_signature">
|
223
|
-
|
224
|
-
<a href="#edit_help-instance_method" title="#edit_help (instance method)">#<strong>edit_help</strong>(file) ⇒ Object </a>
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
</span>
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
239
|
-
|
240
|
-
</li>
|
241
|
-
|
242
|
-
|
243
|
-
<li class="public ">
|
244
|
-
<span class="summary_signature">
|
245
|
-
|
246
|
-
<a href="#init_help-instance_method" title="#init_help (instance method)">#<strong>init_help</strong>(file) ⇒ Object </a>
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
</span>
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
261
|
-
|
262
|
-
</li>
|
263
|
-
|
264
|
-
|
265
|
-
<li class="public ">
|
266
|
-
<span class="summary_signature">
|
267
|
-
|
268
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Control </a>
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
</span>
|
273
|
-
|
274
|
-
|
275
|
-
<span class="note title constructor">constructor</span>
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
<span class="summary_desc"><div class='inline'>
|
285
|
-
<p>A new instance of Control.</p>
|
286
|
-
</div></span>
|
287
|
-
|
288
|
-
</li>
|
289
|
-
|
290
|
-
|
291
|
-
<li class="public ">
|
292
|
-
<span class="summary_signature">
|
293
|
-
|
294
|
-
<a href="#list_all-instance_method" title="#list_all (instance method)">#<strong>list_all</strong> ⇒ Object </a>
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
</span>
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
309
|
-
|
310
|
-
</li>
|
311
|
-
|
312
|
-
|
313
|
-
<li class="public ">
|
314
|
-
<span class="summary_signature">
|
315
|
-
|
316
|
-
<a href="#list_help-instance_method" title="#list_help (instance method)">#<strong>list_help</strong>(file) ⇒ Object </a>
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
</span>
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
331
|
-
|
332
|
-
</li>
|
333
|
-
|
334
|
-
|
335
|
-
<li class="public ">
|
336
|
-
<span class="summary_signature">
|
337
|
-
|
338
|
-
<a href="#load_conf-instance_method" title="#load_conf (instance method)">#<strong>load_conf</strong> ⇒ Object </a>
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
</span>
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
353
|
-
|
354
|
-
</li>
|
355
|
-
|
356
|
-
|
357
|
-
<li class="public ">
|
358
|
-
<span class="summary_signature">
|
359
|
-
|
360
|
-
<a href="#search_help-instance_method" title="#search_help (instance method)">#<strong>search_help</strong>(word) ⇒ Object </a>
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
</span>
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
375
|
-
|
376
|
-
</li>
|
377
|
-
|
378
|
-
|
379
|
-
<li class="public ">
|
380
|
-
<span class="summary_signature">
|
381
|
-
|
382
|
-
<a href="#set_editor-instance_method" title="#set_editor (instance method)">#<strong>set_editor</strong>(editor) ⇒ Object </a>
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
</span>
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
397
|
-
|
398
|
-
</li>
|
399
|
-
|
400
|
-
|
401
|
-
<li class="public ">
|
402
|
-
<span class="summary_signature">
|
403
|
-
|
404
|
-
<a href="#set_help_dir_if_not_exists-instance_method" title="#set_help_dir_if_not_exists (instance method)">#<strong>set_help_dir_if_not_exists</strong> ⇒ Object </a>
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
</span>
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
419
|
-
|
420
|
-
</li>
|
421
|
-
|
422
|
-
|
423
|
-
<li class="public ">
|
424
|
-
<span class="summary_signature">
|
425
|
-
|
426
|
-
<a href="#show_item-instance_method" title="#show_item (instance method)">#<strong>show_item</strong>(file, item) ⇒ Object </a>
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
</span>
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
441
|
-
|
442
|
-
</li>
|
443
|
-
|
444
|
-
|
445
|
-
</ul>
|
446
|
-
|
447
|
-
|
448
|
-
<div id="constructor_details" class="method_details_list">
|
449
|
-
<h2>Constructor Details</h2>
|
450
|
-
|
451
|
-
<div class="method_details first">
|
452
|
-
<h3 class="signature first" id="initialize-instance_method">
|
453
|
-
|
454
|
-
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="MyHelp::Control (class)">Control</a></span></tt>
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
</h3><div class="docstring">
|
461
|
-
<div class="discussion">
|
462
|
-
|
463
|
-
<p>Returns a new instance of Control.</p>
|
464
|
-
|
465
|
-
|
466
|
-
</div>
|
467
|
-
</div>
|
468
|
-
<div class="tags">
|
469
|
-
|
470
|
-
|
471
|
-
</div><table class="source_code">
|
472
|
-
<tr>
|
473
|
-
<td>
|
474
|
-
<pre class="lines">
|
475
|
-
|
476
|
-
|
477
|
-
8
|
478
|
-
9
|
479
|
-
10
|
480
|
-
11
|
481
|
-
12
|
482
|
-
13
|
483
|
-
14
|
484
|
-
15
|
485
|
-
16
|
486
|
-
17
|
487
|
-
18
|
488
|
-
19</pre>
|
489
|
-
</td>
|
490
|
-
<td>
|
491
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 8</span>
|
492
|
-
|
493
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
494
|
-
<span class='comment'># for configuration setups
|
495
|
-
</span> <span class='comment'># see https://stackoverflow.com/questions/6233124/where-to-place-access-config-file-in-gem
|
496
|
-
</span>
|
497
|
-
<span class='ivar'>@template_dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>../../templates</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>__FILE__</span><span class='rparen'>)</span>
|
498
|
-
<span class='ivar'>@exe_dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>../../exe</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>__FILE__</span><span class='rparen'>)</span>
|
499
|
-
<span class='ivar'>@local_help_dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>HOME</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.my_help</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
500
|
-
<span class='ivar'>@editor</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'>EDITOR</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'>emacs</span><span class='tstring_end'>'</span></span> <span class='comment'>#'code', 'emacs' #'vim' #default editor
|
501
|
-
</span> <span class='comment'># @mini_account = File
|
502
|
-
</span> <span class='id identifier rubyid_set_help_dir_if_not_exists'>set_help_dir_if_not_exists</span>
|
503
|
-
<span class='id identifier rubyid_load_conf'>load_conf</span>
|
504
|
-
<span class='kw'>end</span></pre>
|
505
|
-
</td>
|
506
|
-
</tr>
|
507
|
-
</table>
|
508
|
-
</div>
|
509
|
-
|
510
|
-
</div>
|
511
|
-
|
512
|
-
<div id="instance_attr_details" class="attr_details">
|
513
|
-
<h2>Instance Attribute Details</h2>
|
514
|
-
|
515
|
-
|
516
|
-
<span id="editor=-instance_method"></span>
|
517
|
-
<div class="method_details first">
|
518
|
-
<h3 class="signature first" id="editor-instance_method">
|
519
|
-
|
520
|
-
#<strong>editor</strong> ⇒ <tt>Object</tt>
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
</h3><div class="docstring">
|
527
|
-
<div class="discussion">
|
528
|
-
|
529
|
-
<p>Returns the value of attribute editor.</p>
|
530
|
-
|
531
|
-
|
532
|
-
</div>
|
533
|
-
</div>
|
534
|
-
<div class="tags">
|
535
|
-
|
536
|
-
|
537
|
-
</div><table class="source_code">
|
538
|
-
<tr>
|
539
|
-
<td>
|
540
|
-
<pre class="lines">
|
541
|
-
|
542
|
-
|
543
|
-
7
|
544
|
-
8
|
545
|
-
9</pre>
|
546
|
-
</td>
|
547
|
-
<td>
|
548
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 7</span>
|
549
|
-
|
550
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_editor'>editor</span>
|
551
|
-
<span class='ivar'>@editor</span>
|
552
|
-
<span class='kw'>end</span></pre>
|
553
|
-
</td>
|
554
|
-
</tr>
|
555
|
-
</table>
|
556
|
-
</div>
|
557
|
-
|
558
|
-
|
559
|
-
<span id="local_help_dir=-instance_method"></span>
|
560
|
-
<div class="method_details ">
|
561
|
-
<h3 class="signature " id="local_help_dir-instance_method">
|
562
|
-
|
563
|
-
#<strong>local_help_dir</strong> ⇒ <tt>Object</tt>
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
</h3><div class="docstring">
|
570
|
-
<div class="discussion">
|
571
|
-
|
572
|
-
<p>Returns the value of attribute local_help_dir.</p>
|
573
|
-
|
574
|
-
|
575
|
-
</div>
|
576
|
-
</div>
|
577
|
-
<div class="tags">
|
578
|
-
|
579
|
-
|
580
|
-
</div><table class="source_code">
|
581
|
-
<tr>
|
582
|
-
<td>
|
583
|
-
<pre class="lines">
|
584
|
-
|
585
|
-
|
586
|
-
7
|
587
|
-
8
|
588
|
-
9</pre>
|
589
|
-
</td>
|
590
|
-
<td>
|
591
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 7</span>
|
592
|
-
|
593
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_local_help_dir'>local_help_dir</span>
|
594
|
-
<span class='ivar'>@local_help_dir</span>
|
595
|
-
<span class='kw'>end</span></pre>
|
596
|
-
</td>
|
597
|
-
</tr>
|
598
|
-
</table>
|
599
|
-
</div>
|
600
|
-
|
601
|
-
</div>
|
602
|
-
|
603
|
-
|
604
|
-
<div id="instance_method_details" class="method_details_list">
|
605
|
-
<h2>Instance Method Details</h2>
|
606
|
-
|
607
|
-
|
608
|
-
<div class="method_details first">
|
609
|
-
<h3 class="signature first" id="delete_help-instance_method">
|
610
|
-
|
611
|
-
#<strong>delete_help</strong>(file) ⇒ <tt>Object</tt>
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
</h3><div class="docstring">
|
618
|
-
<div class="discussion">
|
619
|
-
|
620
|
-
<p>def delete_help(file)</p>
|
621
|
-
|
622
|
-
<pre class="code ruby"><code class="ruby"> file = File.join(@local_help_dir,file+'.org')
|
623
|
-
print "Are you sure to delete "+file.blue+"?[Ynq] ".red
|
624
|
-
case STDIN.gets.chomp
|
625
|
-
when 'Y'
|
626
|
-
begin
|
627
|
-
FileUtils.rm(file,:verbose=>true)
|
628
|
-
rescue => error
|
629
|
-
puts error.to_s.red
|
630
|
-
end
|
631
|
-
when 'n', 'q' ; exit
|
632
|
-
end
|
633
|
-
end
|
634
|
-
</code></pre>
|
635
|
-
|
636
|
-
|
637
|
-
</div>
|
638
|
-
</div>
|
639
|
-
<div class="tags">
|
640
|
-
|
641
|
-
|
642
|
-
</div><table class="source_code">
|
643
|
-
<tr>
|
644
|
-
<td>
|
645
|
-
<pre class="lines">
|
646
|
-
|
647
|
-
|
648
|
-
144
|
649
|
-
145
|
650
|
-
146
|
651
|
-
147
|
652
|
-
148
|
653
|
-
149
|
654
|
-
150
|
655
|
-
151
|
656
|
-
152
|
657
|
-
153
|
658
|
-
154
|
659
|
-
155
|
660
|
-
156
|
661
|
-
157
|
662
|
-
158
|
663
|
-
159
|
664
|
-
160
|
665
|
-
161
|
666
|
-
162</pre>
|
667
|
-
</td>
|
668
|
-
<td>
|
669
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 144</span>
|
670
|
-
|
671
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_delete_help'>delete_help</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
672
|
-
<span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.org</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
673
|
-
<span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='kw'>true</span>
|
674
|
-
<span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Are you sure to delete </span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_blue'>blue</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>?[Yn] </span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_red'>red</span>
|
675
|
-
<span class='kw'>case</span> <span class='const'>STDIN</span><span class='period'>.</span><span class='id identifier rubyid_gets'>gets</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span>
|
676
|
-
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Y</span><span class='tstring_end'>'</span></span>
|
677
|
-
<span class='kw'>begin</span>
|
678
|
-
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_rm'>rm</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span><span class='symbol'>:verbose</span><span class='op'>=></span><span class='kw'>true</span><span class='rparen'>)</span>
|
679
|
-
<span class='kw'>return</span> <span class='int'>0</span>
|
680
|
-
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_error'>error</span>
|
681
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_red'>red</span>
|
682
|
-
<span class='kw'>return</span> <span class='int'>1</span>
|
683
|
-
<span class='kw'>end</span>
|
684
|
-
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>n</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>q</span><span class='tstring_end'>'</span></span> <span class='semicolon'>;</span> <span class='kw'>return</span> <span class='int'>0</span>
|
685
|
-
<span class='kw'>end</span>
|
686
|
-
<span class='kw'>else</span>
|
687
|
-
<span class='id identifier rubyid_print'>print</span> <span class='id identifier rubyid_file'>file</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> is a non-existent file</span><span class='tstring_end'>"</span></span>
|
688
|
-
<span class='kw'>end</span>
|
689
|
-
<span class='kw'>end</span></pre>
|
690
|
-
</td>
|
691
|
-
</tr>
|
692
|
-
</table>
|
693
|
-
</div>
|
694
|
-
|
695
|
-
<div class="method_details ">
|
696
|
-
<h3 class="signature " id="edit_help-instance_method">
|
697
|
-
|
698
|
-
#<strong>edit_help</strong>(file) ⇒ <tt>Object</tt>
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
</h3><table class="source_code">
|
705
|
-
<tr>
|
706
|
-
<td>
|
707
|
-
<pre class="lines">
|
708
|
-
|
709
|
-
|
710
|
-
105
|
711
|
-
106
|
712
|
-
107
|
713
|
-
108
|
714
|
-
109
|
715
|
-
110
|
716
|
-
111
|
717
|
-
112
|
718
|
-
113</pre>
|
719
|
-
</td>
|
720
|
-
<td>
|
721
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 105</span>
|
722
|
-
|
723
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_edit_help'>edit_help</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
724
|
-
<span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_target_help'>target_help</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.org</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
725
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_local_help_entries'>local_help_entries</span><span class='period'>.</span><span class='id identifier rubyid_member?'>member?</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.org</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
726
|
-
<span class='id identifier rubyid_system'>system</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='ivar'>@editor</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target_help'>target_help</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
727
|
-
<span class='kw'>else</span>
|
728
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>file </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target_help'>target_help</span><span class='embexpr_end'>}</span><span class='tstring_content'> does not exits in </span><span class='embexpr_beg'>#{</span><span class='ivar'>@local_help_dir</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
729
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>init </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file'>file</span><span class='embexpr_end'>}</span><span class='tstring_content'> first.</span><span class='tstring_end'>"</span></span>
|
730
|
-
<span class='kw'>end</span>
|
731
|
-
<span class='kw'>end</span></pre>
|
732
|
-
</td>
|
733
|
-
</tr>
|
734
|
-
</table>
|
735
|
-
</div>
|
736
|
-
|
737
|
-
<div class="method_details ">
|
738
|
-
<h3 class="signature " id="init_help-instance_method">
|
739
|
-
|
740
|
-
#<strong>init_help</strong>(file) ⇒ <tt>Object</tt>
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
</h3><table class="source_code">
|
747
|
-
<tr>
|
748
|
-
<td>
|
749
|
-
<pre class="lines">
|
750
|
-
|
751
|
-
|
752
|
-
115
|
753
|
-
116
|
754
|
-
117
|
755
|
-
118
|
756
|
-
119
|
757
|
-
120
|
758
|
-
121
|
759
|
-
122
|
760
|
-
123
|
761
|
-
124
|
762
|
-
125
|
763
|
-
126
|
764
|
-
127</pre>
|
765
|
-
</td>
|
766
|
-
<td>
|
767
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 115</span>
|
768
|
-
|
769
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_init_help'>init_help</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
770
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
771
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>specify NAME</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_red'>red</span>
|
772
|
-
<span class='id identifier rubyid_exit'>exit</span>
|
773
|
-
<span class='kw'>end</span>
|
774
|
-
<span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_target_help'>target_help</span><span class='op'>=</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.org</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
775
|
-
<span class='kw'>if</span> <span class='const'>File</span><span class='op'>::</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_target_help'>target_help</span><span class='rparen'>)</span>
|
776
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>File exists. delete it first to initialize it.</span><span class='tstring_end'>"</span></span>
|
777
|
-
<span class='id identifier rubyid_exit'>exit</span>
|
778
|
-
<span class='kw'>end</span>
|
779
|
-
<span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_template'>template</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@template_dir</span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>help_template.org</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
780
|
-
<span class='const'>FileUtils</span><span class='op'>::</span><span class='const'>Verbose</span><span class='period'>.</span><span class='id identifier rubyid_cp'>cp</span><span class='lparen'>(</span><span class='id identifier rubyid_template'>template</span><span class='comma'>,</span><span class='id identifier rubyid_target_help'>target_help</span><span class='rparen'>)</span>
|
781
|
-
<span class='kw'>end</span></pre>
|
782
|
-
</td>
|
783
|
-
</tr>
|
784
|
-
</table>
|
785
|
-
</div>
|
786
|
-
|
787
|
-
<div class="method_details ">
|
788
|
-
<h3 class="signature " id="list_all-instance_method">
|
789
|
-
|
790
|
-
#<strong>list_all</strong> ⇒ <tt>Object</tt>
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
</h3><table class="source_code">
|
797
|
-
<tr>
|
798
|
-
<td>
|
799
|
-
<pre class="lines">
|
800
|
-
|
801
|
-
|
802
|
-
55
|
803
|
-
56
|
804
|
-
57
|
805
|
-
58
|
806
|
-
59
|
807
|
-
60
|
808
|
-
61
|
809
|
-
62
|
810
|
-
63
|
811
|
-
64
|
812
|
-
65
|
813
|
-
66
|
814
|
-
67
|
815
|
-
68
|
816
|
-
69
|
817
|
-
70
|
818
|
-
71
|
819
|
-
72
|
820
|
-
73</pre>
|
821
|
-
</td>
|
822
|
-
<td>
|
823
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 55</span>
|
824
|
-
|
825
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_list_all'>list_all</span>
|
826
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\nList all helps\n</span><span class='tstring_end'>"</span></span>
|
827
|
-
<span class='id identifier rubyid_local_help_entries'>local_help_entries</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_file'>file</span><span class='op'>|</span>
|
828
|
-
<span class='id identifier rubyid_file_path'>file_path</span><span class='op'>=</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
829
|
-
<span class='id identifier rubyid_title'>title</span> <span class='op'>=</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
830
|
-
<span class='id identifier rubyid_help'>help</span> <span class='op'>=</span> <span class='id identifier rubyid_auto_load'>auto_load</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
|
831
|
-
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_help'>help</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
832
|
-
<span class='kw'>begin</span>
|
833
|
-
<span class='id identifier rubyid_desc'>desc</span> <span class='op'>=</span> <span class='id identifier rubyid_help'>help</span><span class='lbracket'>[</span><span class='symbol'>:head</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:cont</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</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><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
834
|
-
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
835
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_e'>e</span>
|
836
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No head in </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_path'>file_path</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_red'>red</span>
|
837
|
-
<span class='kw'>next</span>
|
838
|
-
<span class='kw'>end</span>
|
839
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'><<</span> <span class='id identifier rubyid_title'>title</span><span class='period'>.</span><span class='id identifier rubyid_rjust'>rjust</span><span class='lparen'>(</span><span class='int'>10</span><span class='rparen'>)</span>
|
840
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_desc'>desc</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
841
|
-
<span class='kw'>end</span>
|
842
|
-
<span class='id identifier rubyid_output'>output</span>
|
843
|
-
<span class='kw'>end</span></pre>
|
844
|
-
</td>
|
845
|
-
</tr>
|
846
|
-
</table>
|
847
|
-
</div>
|
848
|
-
|
849
|
-
<div class="method_details ">
|
850
|
-
<h3 class="signature " id="list_help-instance_method">
|
851
|
-
|
852
|
-
#<strong>list_help</strong>(file) ⇒ <tt>Object</tt>
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
</h3><table class="source_code">
|
859
|
-
<tr>
|
860
|
-
<td>
|
861
|
-
<pre class="lines">
|
862
|
-
|
863
|
-
|
864
|
-
76
|
865
|
-
77
|
866
|
-
78
|
867
|
-
79
|
868
|
-
80
|
869
|
-
81
|
870
|
-
82
|
871
|
-
83
|
872
|
-
84
|
873
|
-
85
|
874
|
-
86
|
875
|
-
87
|
876
|
-
88
|
877
|
-
89</pre>
|
878
|
-
</td>
|
879
|
-
<td>
|
880
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 76</span>
|
881
|
-
|
882
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_list_help'>list_help</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
883
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
884
|
-
<span class='id identifier rubyid_file_path'>file_path</span><span class='op'>=</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.org</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
885
|
-
<span class='kw'>begin</span>
|
886
|
-
<span class='id identifier rubyid_help'>help</span> <span class='op'>=</span> <span class='id identifier rubyid_auto_load'>auto_load</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
|
887
|
-
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
888
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="#WrongFileName-constant" title="MyHelp::Control::WrongFileName (constant)">WrongFileName</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No help named '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file'>file</span><span class='embexpr_end'>}</span><span class='tstring_content'>' in the directory '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_local_help_dir'>local_help_dir</span><span class='embexpr_end'>}</span><span class='tstring_content'>'.</span><span class='tstring_end'>"</span></span>
|
889
|
-
<span class='kw'>end</span>
|
890
|
-
<span class='id identifier rubyid_help'>help</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_conts'>conts</span><span class='op'>|</span>
|
891
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'><<</span> <span class='id identifier rubyid_conts'>conts</span><span class='lbracket'>[</span><span class='symbol'>:cont</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='op'>==</span><span class='symbol'>:head</span>
|
892
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'><<</span> <span class='id identifier rubyid_disp_opts'>disp_opts</span><span class='lparen'>(</span> <span class='id identifier rubyid_conts'>conts</span><span class='lbracket'>[</span><span class='symbol'>:opts</span><span class='rbracket'>]</span> <span class='rparen'>)</span>
|
893
|
-
<span class='kw'>end</span>
|
894
|
-
<span class='id identifier rubyid_output'>output</span>
|
895
|
-
<span class='kw'>end</span></pre>
|
896
|
-
</td>
|
897
|
-
</tr>
|
898
|
-
</table>
|
899
|
-
</div>
|
900
|
-
|
901
|
-
<div class="method_details ">
|
902
|
-
<h3 class="signature " id="load_conf-instance_method">
|
903
|
-
|
904
|
-
#<strong>load_conf</strong> ⇒ <tt>Object</tt>
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
</h3><table class="source_code">
|
911
|
-
<tr>
|
912
|
-
<td>
|
913
|
-
<pre class="lines">
|
914
|
-
|
915
|
-
|
916
|
-
30
|
917
|
-
31
|
918
|
-
32
|
919
|
-
33
|
920
|
-
34
|
921
|
-
35
|
922
|
-
36
|
923
|
-
37
|
924
|
-
38
|
925
|
-
39
|
926
|
-
40
|
927
|
-
41
|
928
|
-
42</pre>
|
929
|
-
</td>
|
930
|
-
<td>
|
931
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 30</span>
|
932
|
-
|
933
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_load_conf'>load_conf</span>
|
934
|
-
<span class='id identifier rubyid_file_name'>file_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.my_help_conf.yml</span><span class='tstring_end'>'</span></span>
|
935
|
-
<span class='comment'># @conf_file = File.join(Dir.pwd, file_name)
|
936
|
-
</span> <span class='ivar'>@conf_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='rparen'>)</span>
|
937
|
-
<span class='kw'>begin</span>
|
938
|
-
<span class='id identifier rubyid_conf'>conf</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span><span class='lparen'>(</span><span class='ivar'>@conf_file</span><span class='rparen'>)</span>
|
939
|
-
<span class='ivar'>@editor</span> <span class='op'>=</span> <span class='id identifier rubyid_conf'>conf</span><span class='lbracket'>[</span><span class='symbol'>:editor</span><span class='rbracket'>]</span>
|
940
|
-
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
941
|
-
<span class='id identifier rubyid_puts'>puts</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='period'>.</span><span class='id identifier rubyid_red'>red</span>
|
942
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>make .my_help_conf.yml</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span>
|
943
|
-
<span class='id identifier rubyid_set_editor'>set_editor</span><span class='lparen'>(</span><span class='ivar'>@editor</span><span class='rparen'>)</span>
|
944
|
-
<span class='kw'>end</span>
|
945
|
-
<span class='kw'>end</span></pre>
|
946
|
-
</td>
|
947
|
-
</tr>
|
948
|
-
</table>
|
949
|
-
</div>
|
950
|
-
|
951
|
-
<div class="method_details ">
|
952
|
-
<h3 class="signature " id="search_help-instance_method">
|
953
|
-
|
954
|
-
#<strong>search_help</strong>(word) ⇒ <tt>Object</tt>
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
</h3><table class="source_code">
|
961
|
-
<tr>
|
962
|
-
<td>
|
963
|
-
<pre class="lines">
|
964
|
-
|
965
|
-
|
966
|
-
164
|
967
|
-
165
|
968
|
-
166
|
969
|
-
167</pre>
|
970
|
-
</td>
|
971
|
-
<td>
|
972
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 164</span>
|
973
|
-
|
974
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_search_help'>search_help</span><span class='lparen'>(</span><span class='id identifier rubyid_word'>word</span><span class='rparen'>)</span>
|
975
|
-
<span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_find_char'>find_char</span> <span class='op'>=</span> <span class='id identifier rubyid_word'>word</span>
|
976
|
-
<span class='id identifier rubyid_system'>system</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ls </span><span class='embexpr_beg'>#{</span><span class='ivar'>@local_help_dir</span><span class='embexpr_end'>}</span><span class='tstring_content'> | grep </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_find_char'>find_char</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
977
|
-
<span class='kw'>end</span></pre>
|
978
|
-
</td>
|
979
|
-
</tr>
|
980
|
-
</table>
|
981
|
-
</div>
|
982
|
-
|
983
|
-
<div class="method_details ">
|
984
|
-
<h3 class="signature " id="set_editor-instance_method">
|
985
|
-
|
986
|
-
#<strong>set_editor</strong>(editor) ⇒ <tt>Object</tt>
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
</h3><table class="source_code">
|
993
|
-
<tr>
|
994
|
-
<td>
|
995
|
-
<pre class="lines">
|
996
|
-
|
997
|
-
|
998
|
-
21
|
999
|
-
22
|
1000
|
-
23
|
1001
|
-
24
|
1002
|
-
25
|
1003
|
-
26
|
1004
|
-
27
|
1005
|
-
28</pre>
|
1006
|
-
</td>
|
1007
|
-
<td>
|
1008
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 21</span>
|
1009
|
-
|
1010
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_set_editor'>set_editor</span><span class='lparen'>(</span><span class='id identifier rubyid_editor'>editor</span><span class='rparen'>)</span>
|
1011
|
-
<span class='ivar'>@editor</span> <span class='op'>=</span> <span class='id identifier rubyid_editor'>editor</span>
|
1012
|
-
<span class='id identifier rubyid_file_name'>file_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.my_help_conf.yml</span><span class='tstring_end'>'</span></span>
|
1013
|
-
<span class='ivar'>@conf_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='rparen'>)</span>
|
1014
|
-
<span class='id identifier rubyid_conf'>conf</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>editor:</span> <span class='id identifier rubyid_editor'>editor</span><span class='rbrace'>}</span>
|
1015
|
-
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='ivar'>@conf_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</span></span><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'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span><span class='lparen'>(</span><span class='id identifier rubyid_conf'>conf</span><span class='comma'>,</span> <span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1016
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>set editor '</span><span class='embexpr_beg'>#{</span><span class='ivar'>@editor</span><span class='embexpr_end'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span>
|
1017
|
-
<span class='kw'>end</span></pre>
|
1018
|
-
</td>
|
1019
|
-
</tr>
|
1020
|
-
</table>
|
1021
|
-
</div>
|
1022
|
-
|
1023
|
-
<div class="method_details ">
|
1024
|
-
<h3 class="signature " id="set_help_dir_if_not_exists-instance_method">
|
1025
|
-
|
1026
|
-
#<strong>set_help_dir_if_not_exists</strong> ⇒ <tt>Object</tt>
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
</h3><table class="source_code">
|
1033
|
-
<tr>
|
1034
|
-
<td>
|
1035
|
-
<pre class="lines">
|
1036
|
-
|
1037
|
-
|
1038
|
-
44
|
1039
|
-
45
|
1040
|
-
46
|
1041
|
-
47
|
1042
|
-
48
|
1043
|
-
49
|
1044
|
-
50
|
1045
|
-
51
|
1046
|
-
52
|
1047
|
-
53</pre>
|
1048
|
-
</td>
|
1049
|
-
<td>
|
1050
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 44</span>
|
1051
|
-
|
1052
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_set_help_dir_if_not_exists'>set_help_dir_if_not_exists</span>
|
1053
|
-
<span class='kw'>return</span> <span class='kw'>if</span> <span class='const'>File</span><span class='op'>::</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='rparen'>)</span>
|
1054
|
-
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_mkdir_p'>mkdir_p</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span> <span class='symbol'>:verbose</span><span class='op'>=></span><span class='kw'>true</span><span class='rparen'>)</span>
|
1055
|
-
<span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='ivar'>@template_dir</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span>
|
1056
|
-
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_file'>file</span><span class='op'>==</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>help_template.org</span><span class='tstring_end'>'</span></span>
|
1057
|
-
<span class='id identifier rubyid_file_path'>file_path</span><span class='op'>=</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
|
1058
|
-
<span class='kw'>next</span> <span class='kw'>if</span> <span class='const'>File</span><span class='op'>::</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
|
1059
|
-
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_cp'>cp</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@template_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='comma'>,</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='symbol'>:verbose</span><span class='op'>=></span><span class='kw'>true</span><span class='rparen'>)</span>
|
1060
|
-
<span class='rbrace'>}</span>
|
1061
|
-
<span class='kw'>end</span></pre>
|
1062
|
-
</td>
|
1063
|
-
</tr>
|
1064
|
-
</table>
|
1065
|
-
</div>
|
1066
|
-
|
1067
|
-
<div class="method_details ">
|
1068
|
-
<h3 class="signature " id="show_item-instance_method">
|
1069
|
-
|
1070
|
-
#<strong>show_item</strong>(file, item) ⇒ <tt>Object</tt>
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
</h3><table class="source_code">
|
1077
|
-
<tr>
|
1078
|
-
<td>
|
1079
|
-
<pre class="lines">
|
1080
|
-
|
1081
|
-
|
1082
|
-
92
|
1083
|
-
93
|
1084
|
-
94
|
1085
|
-
95
|
1086
|
-
96
|
1087
|
-
97
|
1088
|
-
98
|
1089
|
-
99
|
1090
|
-
100
|
1091
|
-
101
|
1092
|
-
102
|
1093
|
-
103</pre>
|
1094
|
-
</td>
|
1095
|
-
<td>
|
1096
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 92</span>
|
1097
|
-
|
1098
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_show_item'>show_item</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
|
1099
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
1100
|
-
<span class='id identifier rubyid_file_path'>file_path</span><span class='op'>=</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='ivar'>@local_help_dir</span><span class='comma'>,</span><span class='id identifier rubyid_file'>file</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.org</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1101
|
-
<span class='id identifier rubyid_help'>help</span> <span class='op'>=</span> <span class='id identifier rubyid_auto_load'>auto_load</span><span class='lparen'>(</span><span class='id identifier rubyid_file_path'>file_path</span><span class='rparen'>)</span>
|
1102
|
-
<span class='id identifier rubyid_select'>select</span> <span class='op'>=</span> <span class='id identifier rubyid_select_item'>select_item</span><span class='lparen'>(</span><span class='id identifier rubyid_help'>help</span><span class='comma'>,</span> <span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
|
1103
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'><<</span> <span class='id identifier rubyid_help'>help</span><span class='lbracket'>[</span><span class='symbol'>:head</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:cont</span><span class='rbracket'>]</span>
|
1104
|
-
<span class='kw'>unless</span> <span class='id identifier rubyid_select'>select</span> <span class='kw'>then</span>
|
1105
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="#WrongItemName-constant" title="MyHelp::Control::WrongItemName (constant)">WrongItemName</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No item entry: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_item'>item</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1106
|
-
<span class='kw'>end</span>
|
1107
|
-
<span class='id identifier rubyid_output'>output</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='int'>5</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='id identifier rubyid_select'>select</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
1108
|
-
<span class='id identifier rubyid_output'>output</span> <span class='op'><<</span> <span class='id identifier rubyid_help'>help</span><span class='lbracket'>[</span><span class='id identifier rubyid_select'>select</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:cont</span><span class='rbracket'>]</span>
|
1109
|
-
<span class='kw'>end</span></pre>
|
1110
|
-
</td>
|
1111
|
-
</tr>
|
1112
|
-
</table>
|
1113
|
-
</div>
|
1114
|
-
|
1115
|
-
</div>
|
1116
|
-
|
1117
|
-
</div>
|
1118
|
-
|
1119
|
-
<div id="footer">
|
1120
|
-
Generated on Thu Apr 1 16:20:44 2021 by
|
1121
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1122
|
-
0.9.26 (ruby-2.7.2).
|
1123
|
-
</div>
|
1124
|
-
|
1125
|
-
</div>
|
1126
|
-
</body>
|
1127
|
-
</html>
|