my_help 0.8.6 → 1.1a
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/'../test'/.my_help/.my_help_conf.yml +2 -0
- data/'../test'/.my_help/emacs.org +50 -0
- data/{lib/templates → '../test'/.my_help}/org.org +0 -0
- data/{lib/templates → '../test'/.my_help}/todo.org +0 -0
- data/.gitignore +8 -0
- data/.my_help/example2.org +9 -0
- data/.rspec +1 -2
- data/.rspec_status +13 -0
- data/.yardoc/checksums +3 -3
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile +10 -5
- data/Gemfile.lock +61 -88
- data/README.org +35 -47
- data/Rakefile +25 -14
- data/doc/MyHelp/Control.html +443 -221
- data/doc/MyHelp.html +7 -7
- data/doc/OrgToYaml.html +12 -10
- data/doc/_index.html +7 -7
- data/doc/class_list.html +2 -2
- data/doc/css/style.css +3 -2
- data/doc/file.README.html +29 -29
- data/doc/file_list.html +2 -2
- data/doc/frames.html +2 -2
- data/doc/index.html +29 -29
- data/doc/js/app.js +14 -3
- data/doc/method_list.html +24 -8
- data/doc/top-level-namespace.html +6 -6
- data/docs/README.html +218 -0
- data/docs/README.org +202 -0
- data/docs/old_docs/16b_nasu.pdf +0 -0
- data/docs/old_docs/17b_oyagi.pdf +0 -0
- data/docs/old_docs/19b_okabata.pdf +0 -0
- data/docs/old_docs/19b_yamaguchi.pdf +0 -0
- data/docs/old_docs/features/delete.feature +7 -0
- data/docs/old_docs/features/edit.feature +7 -0
- data/docs/old_docs/features/list.feature +6 -0
- data/docs/old_docs/features/new.feature +7 -0
- data/docs/old_docs/features/step_definitions/delete_spec.rb +12 -0
- data/docs/old_docs/features/step_definitions/edit_spec.rb +14 -0
- data/docs/old_docs/features/step_definitions/list_spec.rb +10 -0
- data/docs/old_docs/features/step_definitions/new_spec.rb +12 -0
- data/docs/old_docs/features/support/env.rb +3 -0
- data/docs/old_docs/fukumori_symp/18_human_interface_fukumori_workshop.pdf +0 -0
- data/docs/old_docs/fukumori_symp/memo_perp_magician.pdf +0 -0
- data/docs/old_docs/fukumori_symp//347/237/245/350/255/230/343/201/256/347/233/264/344/272/244/350/243/234/347/251/272/351/226/223.png +0 -0
- data/exe/my_help +1 -142
- data/lib/my_help/cli.rb +106 -0
- data/lib/my_help/config.rb +70 -0
- data/lib/my_help/git_cli.rb +40 -0
- data/lib/my_help/init.rb +28 -0
- data/lib/my_help/list.rb +76 -0
- data/lib/my_help/md2hash.rb +54 -0
- data/lib/my_help/modify.rb +33 -0
- data/lib/my_help/org2hash.rb +45 -0
- data/lib/my_help/org2yml.rb +14 -14
- data/lib/my_help/version.rb +3 -1
- data/lib/my_help.rb +23 -7
- data/lib/templates/emacs.org +13 -14
- data/lib/templates/example.md +17 -0
- data/lib/templates/example.org +9 -0
- data/my_help.gemspec +27 -22
- data/tmp.txt +14 -0
- metadata +52 -26
- data/README.html +0 -443
- data/README.rdoc +0 -6
- data/bin/my_help_thor +0 -66
- data/exe/my_help_gli +0 -82
- data/lib/my_help/my_help_controll.rb +0 -222
- data/lib/my_help/tomo_help_controll.rb +0 -0
- data/lib/templates/help_template.org +0 -8
data/doc/MyHelp/Control.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Class: MyHelp::Control
|
8
8
|
|
9
|
-
—
|
9
|
+
— my_help
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "MyHelp::Control";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -100,24 +100,64 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
|
103
|
+
|
104
|
+
<h2>
|
105
|
+
Constant Summary
|
106
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
107
|
+
</h2>
|
103
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
|
+
|
104
123
|
|
105
124
|
|
106
125
|
|
107
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
|
+
|
108
135
|
|
136
|
+
|
137
|
+
</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
109
147
|
|
110
|
-
<h2>
|
111
|
-
Instance Method Summary
|
112
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
113
|
-
</h2>
|
114
148
|
|
115
|
-
|
116
|
-
|
117
|
-
|
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 ">
|
118
158
|
<span class="summary_signature">
|
119
159
|
|
120
|
-
<a href="#
|
160
|
+
<a href="#local_help_dir-instance_method" title="#local_help_dir (instance method)">#<strong>local_help_dir</strong> ⇒ Object </a>
|
121
161
|
|
122
162
|
|
123
163
|
|
@@ -125,21 +165,39 @@
|
|
125
165
|
|
126
166
|
|
127
167
|
|
168
|
+
|
169
|
+
|
170
|
+
|
128
171
|
|
129
172
|
|
130
173
|
|
131
174
|
|
132
175
|
|
133
176
|
|
134
|
-
<span class="summary_desc"><div class='inline'
|
177
|
+
<span class="summary_desc"><div class='inline'>
|
178
|
+
<p>Returns the value of attribute local_help_dir.</p>
|
179
|
+
</div></span>
|
135
180
|
|
136
181
|
</li>
|
137
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">
|
138
196
|
|
139
197
|
<li class="public ">
|
140
198
|
<span class="summary_signature">
|
141
199
|
|
142
|
-
<a href="#
|
200
|
+
<a href="#delete_help-instance_method" title="#delete_help (instance method)">#<strong>delete_help</strong>(file) ⇒ Object </a>
|
143
201
|
|
144
202
|
|
145
203
|
|
@@ -153,7 +211,9 @@
|
|
153
211
|
|
154
212
|
|
155
213
|
|
156
|
-
<span class="summary_desc"><div class='inline'
|
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>
|
157
217
|
|
158
218
|
</li>
|
159
219
|
|
@@ -275,7 +335,7 @@
|
|
275
335
|
<li class="public ">
|
276
336
|
<span class="summary_signature">
|
277
337
|
|
278
|
-
<a href="#
|
338
|
+
<a href="#load_conf-instance_method" title="#load_conf (instance method)">#<strong>load_conf</strong> ⇒ Object </a>
|
279
339
|
|
280
340
|
|
281
341
|
|
@@ -297,7 +357,7 @@
|
|
297
357
|
<li class="public ">
|
298
358
|
<span class="summary_signature">
|
299
359
|
|
300
|
-
<a href="#
|
360
|
+
<a href="#search_help-instance_method" title="#search_help (instance method)">#<strong>search_help</strong>(word) ⇒ Object </a>
|
301
361
|
|
302
362
|
|
303
363
|
|
@@ -319,7 +379,7 @@
|
|
319
379
|
<li class="public ">
|
320
380
|
<span class="summary_signature">
|
321
381
|
|
322
|
-
<a href="#
|
382
|
+
<a href="#set_editor-instance_method" title="#set_editor (instance method)">#<strong>set_editor</strong>(editor) ⇒ Object </a>
|
323
383
|
|
324
384
|
|
325
385
|
|
@@ -341,7 +401,29 @@
|
|
341
401
|
<li class="public ">
|
342
402
|
<span class="summary_signature">
|
343
403
|
|
344
|
-
<a href="#
|
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>
|
345
427
|
|
346
428
|
|
347
429
|
|
@@ -378,7 +460,7 @@
|
|
378
460
|
</h3><div class="docstring">
|
379
461
|
<div class="discussion">
|
380
462
|
|
381
|
-
<p>Returns a new instance of Control
|
463
|
+
<p>Returns a new instance of Control.</p>
|
382
464
|
|
383
465
|
|
384
466
|
</div>
|
@@ -392,23 +474,33 @@
|
|
392
474
|
<pre class="lines">
|
393
475
|
|
394
476
|
|
395
|
-
4
|
396
|
-
5
|
397
|
-
6
|
398
|
-
7
|
399
477
|
8
|
400
478
|
9
|
401
|
-
10
|
479
|
+
10
|
480
|
+
11
|
481
|
+
12
|
482
|
+
13
|
483
|
+
14
|
484
|
+
15
|
485
|
+
16
|
486
|
+
17
|
487
|
+
18
|
488
|
+
19</pre>
|
402
489
|
</td>
|
403
490
|
<td>
|
404
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
491
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 8</span>
|
405
492
|
|
406
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>
|
407
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>
|
408
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>
|
409
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>
|
410
|
-
<span class='
|
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
|
411
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>
|
412
504
|
<span class='kw'>end</span></pre>
|
413
505
|
</td>
|
414
506
|
</tr>
|
@@ -417,103 +509,183 @@
|
|
417
509
|
|
418
510
|
</div>
|
419
511
|
|
420
|
-
|
421
|
-
|
422
|
-
<h2>Instance Method Details</h2>
|
423
|
-
|
512
|
+
<div id="instance_attr_details" class="attr_details">
|
513
|
+
<h2>Instance Attribute Details</h2>
|
424
514
|
|
515
|
+
|
516
|
+
<span id="editor=-instance_method"></span>
|
425
517
|
<div class="method_details first">
|
426
|
-
<h3 class="signature first" id="
|
518
|
+
<h3 class="signature first" id="editor-instance_method">
|
427
519
|
|
428
|
-
#<strong>
|
520
|
+
#<strong>editor</strong> ⇒ <tt>Object</tt>
|
429
521
|
|
430
522
|
|
431
523
|
|
432
524
|
|
433
525
|
|
434
|
-
</h3><
|
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">
|
435
538
|
<tr>
|
436
539
|
<td>
|
437
540
|
<pre class="lines">
|
438
541
|
|
439
542
|
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
106
|
444
|
-
107
|
445
|
-
108
|
446
|
-
109
|
447
|
-
110
|
448
|
-
111
|
449
|
-
112
|
450
|
-
113
|
451
|
-
114
|
452
|
-
115</pre>
|
543
|
+
7
|
544
|
+
8
|
545
|
+
9</pre>
|
453
546
|
</td>
|
454
547
|
<td>
|
455
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
548
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 7</span>
|
456
549
|
|
457
|
-
<span class='kw'>def</span> <span class='id identifier
|
458
|
-
<span class='
|
459
|
-
<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'>?[Ynq] </span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_red'>red</span>
|
460
|
-
<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>
|
461
|
-
<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>
|
462
|
-
<span class='kw'>begin</span>
|
463
|
-
<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>
|
464
|
-
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_error'>error</span>
|
465
|
-
<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>
|
466
|
-
<span class='kw'>end</span>
|
467
|
-
<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='id identifier rubyid_exit'>exit</span>
|
468
|
-
<span class='kw'>end</span>
|
550
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_editor'>editor</span>
|
551
|
+
<span class='ivar'>@editor</span>
|
469
552
|
<span class='kw'>end</span></pre>
|
470
553
|
</td>
|
471
554
|
</tr>
|
472
555
|
</table>
|
473
556
|
</div>
|
474
557
|
|
558
|
+
|
559
|
+
<span id="local_help_dir=-instance_method"></span>
|
475
560
|
<div class="method_details ">
|
476
|
-
<h3 class="signature " id="
|
561
|
+
<h3 class="signature " id="local_help_dir-instance_method">
|
477
562
|
|
478
|
-
#<strong>
|
563
|
+
#<strong>local_help_dir</strong> ⇒ <tt>Object</tt>
|
479
564
|
|
480
565
|
|
481
566
|
|
482
567
|
|
483
568
|
|
484
|
-
</h3><
|
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">
|
485
581
|
<tr>
|
486
582
|
<td>
|
487
583
|
<pre class="lines">
|
488
584
|
|
489
585
|
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
56
|
494
|
-
57
|
495
|
-
58
|
496
|
-
59
|
497
|
-
60
|
498
|
-
61
|
499
|
-
62
|
500
|
-
63
|
501
|
-
64</pre>
|
586
|
+
7
|
587
|
+
8
|
588
|
+
9</pre>
|
502
589
|
</td>
|
503
590
|
<td>
|
504
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
505
|
-
|
506
|
-
<span class='kw'>def</span> <span class='id identifier
|
507
|
-
<span class='
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
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>
|
515
688
|
<span class='kw'>end</span>
|
516
|
-
<span class='id identifier rubyid_print'>print</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>
|
517
689
|
<span class='kw'>end</span></pre>
|
518
690
|
</td>
|
519
691
|
</tr>
|
@@ -535,23 +707,23 @@
|
|
535
707
|
<pre class="lines">
|
536
708
|
|
537
709
|
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
710
|
+
105
|
711
|
+
106
|
712
|
+
107
|
713
|
+
108
|
714
|
+
109
|
715
|
+
110
|
716
|
+
111
|
717
|
+
112
|
718
|
+
113</pre>
|
547
719
|
</td>
|
548
720
|
<td>
|
549
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
721
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 105</span>
|
550
722
|
|
551
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>
|
552
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>
|
553
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>
|
554
|
-
<span class='id identifier rubyid_system'>system</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>
|
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>
|
555
727
|
<span class='kw'>else</span>
|
556
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>
|
557
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>
|
@@ -577,22 +749,22 @@
|
|
577
749
|
<pre class="lines">
|
578
750
|
|
579
751
|
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
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>
|
593
765
|
</td>
|
594
766
|
<td>
|
595
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
767
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 115</span>
|
596
768
|
|
597
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>
|
598
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>
|
@@ -627,6 +799,17 @@
|
|
627
799
|
<pre class="lines">
|
628
800
|
|
629
801
|
|
802
|
+
55
|
803
|
+
56
|
804
|
+
57
|
805
|
+
58
|
806
|
+
59
|
807
|
+
60
|
808
|
+
61
|
809
|
+
62
|
810
|
+
63
|
811
|
+
64
|
812
|
+
65
|
630
813
|
66
|
631
814
|
67
|
632
815
|
68
|
@@ -634,26 +817,29 @@
|
|
634
817
|
70
|
635
818
|
71
|
636
819
|
72
|
637
|
-
73
|
638
|
-
74
|
639
|
-
75
|
640
|
-
76
|
641
|
-
77</pre>
|
820
|
+
73</pre>
|
642
821
|
</td>
|
643
822
|
<td>
|
644
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
823
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 55</span>
|
645
824
|
|
646
825
|
<span class='kw'>def</span> <span class='id identifier rubyid_list_all'>list_all</span>
|
647
|
-
<span class='id identifier
|
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>
|
648
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>
|
649
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>
|
650
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>
|
651
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>
|
652
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>
|
653
|
-
<span class='
|
654
|
-
|
655
|
-
<span class='
|
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>
|
656
841
|
<span class='kw'>end</span>
|
842
|
+
<span class='id identifier rubyid_output'>output</span>
|
657
843
|
<span class='kw'>end</span></pre>
|
658
844
|
</td>
|
659
845
|
</tr>
|
@@ -675,25 +861,37 @@
|
|
675
861
|
<pre class="lines">
|
676
862
|
|
677
863
|
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
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>
|
686
878
|
</td>
|
687
879
|
<td>
|
688
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
880
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 76</span>
|
689
881
|
|
690
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>
|
691
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>
|
692
|
-
<span class='
|
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>
|
693
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>
|
694
|
-
<span class='id identifier
|
695
|
-
<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>
|
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>
|
696
893
|
<span class='kw'>end</span>
|
894
|
+
<span class='id identifier rubyid_output'>output</span>
|
697
895
|
<span class='kw'>end</span></pre>
|
698
896
|
</td>
|
699
897
|
</tr>
|
@@ -701,9 +899,9 @@
|
|
701
899
|
</div>
|
702
900
|
|
703
901
|
<div class="method_details ">
|
704
|
-
<h3 class="signature " id="
|
902
|
+
<h3 class="signature " id="load_conf-instance_method">
|
705
903
|
|
706
|
-
#<strong>
|
904
|
+
#<strong>load_conf</strong> ⇒ <tt>Object</tt>
|
707
905
|
|
708
906
|
|
709
907
|
|
@@ -715,6 +913,8 @@
|
|
715
913
|
<pre class="lines">
|
716
914
|
|
717
915
|
|
916
|
+
30
|
917
|
+
31
|
718
918
|
32
|
719
919
|
33
|
720
920
|
34
|
@@ -728,18 +928,20 @@
|
|
728
928
|
42</pre>
|
729
929
|
</td>
|
730
930
|
<td>
|
731
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
732
|
-
|
733
|
-
<span class='kw'>def</span> <span class='id identifier
|
734
|
-
<span class='id identifier
|
735
|
-
<span class='
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
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>
|
741
944
|
<span class='kw'>end</span>
|
742
|
-
<span class='id identifier rubyid_o_key'>o_key</span>
|
743
945
|
<span class='kw'>end</span></pre>
|
744
946
|
</td>
|
745
947
|
</tr>
|
@@ -747,9 +949,9 @@
|
|
747
949
|
</div>
|
748
950
|
|
749
951
|
<div class="method_details ">
|
750
|
-
<h3 class="signature " id="
|
952
|
+
<h3 class="signature " id="search_help-instance_method">
|
751
953
|
|
752
|
-
#<strong>
|
954
|
+
#<strong>search_help</strong>(word) ⇒ <tt>Object</tt>
|
753
955
|
|
754
956
|
|
755
957
|
|
@@ -761,29 +963,17 @@
|
|
761
963
|
<pre class="lines">
|
762
964
|
|
763
965
|
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
16
|
769
|
-
17
|
770
|
-
18
|
771
|
-
19
|
772
|
-
20
|
773
|
-
21</pre>
|
966
|
+
164
|
967
|
+
165
|
968
|
+
166
|
969
|
+
167</pre>
|
774
970
|
</td>
|
775
971
|
<td>
|
776
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
972
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 164</span>
|
777
973
|
|
778
|
-
<span class='kw'>def</span> <span class='id identifier
|
779
|
-
<span class='
|
780
|
-
<span class='
|
781
|
-
<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>
|
782
|
-
<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>
|
783
|
-
<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>
|
784
|
-
<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>
|
785
|
-
<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>
|
786
|
-
<span class='rbrace'>}</span>
|
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>
|
787
977
|
<span class='kw'>end</span></pre>
|
788
978
|
</td>
|
789
979
|
</tr>
|
@@ -791,9 +981,9 @@
|
|
791
981
|
</div>
|
792
982
|
|
793
983
|
<div class="method_details ">
|
794
|
-
<h3 class="signature " id="
|
984
|
+
<h3 class="signature " id="set_editor-instance_method">
|
795
985
|
|
796
|
-
#<strong>
|
986
|
+
#<strong>set_editor</strong>(editor) ⇒ <tt>Object</tt>
|
797
987
|
|
798
988
|
|
799
989
|
|
@@ -805,25 +995,69 @@
|
|
805
995
|
<pre class="lines">
|
806
996
|
|
807
997
|
|
998
|
+
21
|
999
|
+
22
|
808
1000
|
23
|
809
1001
|
24
|
810
1002
|
25
|
811
1003
|
26
|
812
1004
|
27
|
813
|
-
28
|
814
|
-
29
|
815
|
-
30</pre>
|
1005
|
+
28</pre>
|
816
1006
|
</td>
|
817
1007
|
<td>
|
818
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
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
|
+
|
819
1028
|
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
<
|
825
|
-
|
826
|
-
|
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>
|
827
1061
|
<span class='kw'>end</span></pre>
|
828
1062
|
</td>
|
829
1063
|
</tr>
|
@@ -831,9 +1065,9 @@
|
|
831
1065
|
</div>
|
832
1066
|
|
833
1067
|
<div class="method_details ">
|
834
|
-
<h3 class="signature " id="
|
1068
|
+
<h3 class="signature " id="show_item-instance_method">
|
835
1069
|
|
836
|
-
#<strong>
|
1070
|
+
#<strong>show_item</strong>(file, item) ⇒ <tt>Object</tt>
|
837
1071
|
|
838
1072
|
|
839
1073
|
|
@@ -845,45 +1079,33 @@
|
|
845
1079
|
<pre class="lines">
|
846
1080
|
|
847
1081
|
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
129
|
861
|
-
130
|
862
|
-
131
|
863
|
-
132
|
864
|
-
133
|
865
|
-
134</pre>
|
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>
|
866
1094
|
</td>
|
867
1095
|
<td>
|
868
|
-
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line
|
1096
|
+
<pre class="code"><span class="info file"># File 'lib/my_help/my_help_controll.rb', line 92</span>
|
869
1097
|
|
870
|
-
<span class='kw'>def</span> <span class='id identifier
|
871
|
-
<span class='id identifier
|
872
|
-
<span class='id identifier
|
873
|
-
<span class='id identifier
|
874
|
-
<span class='id identifier
|
875
|
-
<span class='id identifier
|
876
|
-
<span class='kw'>
|
877
|
-
<span class='
|
878
|
-
</span><span class='comment'># system "scp #{@local_help_dir} tomoko_y@mini:~/our_help/member/tomoko"
|
879
|
-
</span><span class='comment'># else
|
880
|
-
</span> <span class='id identifier rubyid_system'>system</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>scp </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'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user_name'>user_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>@mini:~/our_help/member/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_directory_name'>directory_name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
881
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>後は,miniでgitにpushしてください.</span><span class='tstring_end'>"</span></span>
|
882
|
-
<span class='comment'># end
|
883
|
-
</span> <span class='kw'>else</span>
|
884
|
-
<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>
|
885
|
-
<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>
|
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>
|
886
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>
|
887
1109
|
<span class='kw'>end</span></pre>
|
888
1110
|
</td>
|
889
1111
|
</tr>
|
@@ -895,9 +1117,9 @@
|
|
895
1117
|
</div>
|
896
1118
|
|
897
1119
|
<div id="footer">
|
898
|
-
Generated on
|
1120
|
+
Generated on Thu Apr 1 16:20:44 2021 by
|
899
1121
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
900
|
-
0.9.
|
1122
|
+
0.9.26 (ruby-2.7.2).
|
901
1123
|
</div>
|
902
1124
|
|
903
1125
|
</div>
|