my_help 0.8.6 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/'../test'/.my_help/.my_help_conf.yml +2 -0
  3. data/'../test'/.my_help/emacs.org +50 -0
  4. data/{lib/templates → '../test'/.my_help}/org.org +0 -0
  5. data/{lib/templates → '../test'/.my_help}/todo.org +0 -0
  6. data/.gitignore +7 -0
  7. data/.my_help/example2.org +9 -0
  8. data/.rspec +1 -2
  9. data/.rspec_status +13 -0
  10. data/.yardoc/checksums +3 -3
  11. data/.yardoc/object_types +0 -0
  12. data/.yardoc/objects/root.dat +0 -0
  13. data/Gemfile +10 -5
  14. data/Gemfile.lock +61 -88
  15. data/README.org +35 -47
  16. data/Rakefile +25 -14
  17. data/doc/MyHelp/Control.html +443 -221
  18. data/doc/MyHelp.html +7 -7
  19. data/doc/OrgToYaml.html +12 -10
  20. data/doc/_index.html +7 -7
  21. data/doc/class_list.html +2 -2
  22. data/doc/css/style.css +3 -2
  23. data/doc/file.README.html +29 -29
  24. data/doc/file_list.html +2 -2
  25. data/doc/frames.html +2 -2
  26. data/doc/index.html +29 -29
  27. data/doc/js/app.js +14 -3
  28. data/doc/method_list.html +24 -8
  29. data/doc/top-level-namespace.html +6 -6
  30. data/docs/README.html +218 -0
  31. data/docs/README.org +202 -0
  32. data/docs/old_docs/16b_nasu.pdf +0 -0
  33. data/docs/old_docs/17b_oyagi.pdf +0 -0
  34. data/docs/old_docs/19b_okabata.pdf +0 -0
  35. data/docs/old_docs/19b_yamaguchi.pdf +0 -0
  36. data/docs/old_docs/features/delete.feature +7 -0
  37. data/docs/old_docs/features/edit.feature +7 -0
  38. data/docs/old_docs/features/list.feature +6 -0
  39. data/docs/old_docs/features/new.feature +7 -0
  40. data/docs/old_docs/features/step_definitions/delete_spec.rb +12 -0
  41. data/docs/old_docs/features/step_definitions/edit_spec.rb +14 -0
  42. data/docs/old_docs/features/step_definitions/list_spec.rb +10 -0
  43. data/docs/old_docs/features/step_definitions/new_spec.rb +12 -0
  44. data/docs/old_docs/features/support/env.rb +3 -0
  45. data/docs/old_docs/fukumori_symp/18_human_interface_fukumori_workshop.pdf +0 -0
  46. data/docs/old_docs/fukumori_symp/memo_perp_magician.pdf +0 -0
  47. 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
  48. data/exe/my_help +1 -142
  49. data/lib/my_help/cli.rb +106 -0
  50. data/lib/my_help/config.rb +70 -0
  51. data/lib/my_help/git_cli.rb +40 -0
  52. data/lib/my_help/init.rb +28 -0
  53. data/lib/my_help/list.rb +76 -0
  54. data/lib/my_help/md2hash.rb +54 -0
  55. data/lib/my_help/modify.rb +33 -0
  56. data/lib/my_help/org2hash.rb +45 -0
  57. data/lib/my_help/org2yml.rb +14 -14
  58. data/lib/my_help/version.rb +3 -1
  59. data/lib/my_help.rb +23 -7
  60. data/lib/templates/emacs.org +13 -14
  61. data/lib/templates/example.md +17 -0
  62. data/lib/templates/example.org +9 -0
  63. data/my_help.gemspec +26 -22
  64. data/tmp.txt +14 -0
  65. metadata +51 -25
  66. data/README.html +0 -443
  67. data/README.rdoc +0 -6
  68. data/bin/my_help_thor +0 -66
  69. data/exe/my_help_gli +0 -82
  70. data/lib/my_help/my_help_controll.rb +0 -222
  71. data/lib/my_help/tomo_help_controll.rb +0 -0
  72. data/lib/templates/help_template.org +0 -8
data/README.html DELETED
@@ -1,443 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
5
- <head>
6
- <!-- 2019-04-26 金 12:47 -->
7
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1" />
9
- <title>my_help README</title>
10
- <meta name="generator" content="Org mode" />
11
- <meta name="author" content="Shigeto R. Nishitani" />
12
- <style type="text/css">
13
- <!--/*--><![CDATA[/*><!--*/
14
- .title { text-align: center;
15
- margin-bottom: .2em; }
16
- .subtitle { text-align: center;
17
- font-size: medium;
18
- font-weight: bold;
19
- margin-top:0; }
20
- .todo { font-family: monospace; color: red; }
21
- .done { font-family: monospace; color: green; }
22
- .priority { font-family: monospace; color: orange; }
23
- .tag { background-color: #eee; font-family: monospace;
24
- padding: 2px; font-size: 80%; font-weight: normal; }
25
- .timestamp { color: #bebebe; }
26
- .timestamp-kwd { color: #5f9ea0; }
27
- .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
28
- .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
29
- .org-center { margin-left: auto; margin-right: auto; text-align: center; }
30
- .underline { text-decoration: underline; }
31
- #postamble p, #preamble p { font-size: 90%; margin: .2em; }
32
- p.verse { margin-left: 3%; }
33
- pre {
34
- border: 1px solid #ccc;
35
- box-shadow: 3px 3px 3px #eee;
36
- padding: 8pt;
37
- font-family: monospace;
38
- overflow: auto;
39
- margin: 1.2em;
40
- }
41
- pre.src {
42
- position: relative;
43
- overflow: visible;
44
- padding-top: 1.2em;
45
- }
46
- pre.src:before {
47
- display: none;
48
- position: absolute;
49
- background-color: white;
50
- top: -10px;
51
- right: 10px;
52
- padding: 3px;
53
- border: 1px solid black;
54
- }
55
- pre.src:hover:before { display: inline;}
56
- /* Languages per Org manual */
57
- pre.src-asymptote:before { content: 'Asymptote'; }
58
- pre.src-awk:before { content: 'Awk'; }
59
- pre.src-C:before { content: 'C'; }
60
- /* pre.src-C++ doesn't work in CSS */
61
- pre.src-clojure:before { content: 'Clojure'; }
62
- pre.src-css:before { content: 'CSS'; }
63
- pre.src-D:before { content: 'D'; }
64
- pre.src-ditaa:before { content: 'ditaa'; }
65
- pre.src-dot:before { content: 'Graphviz'; }
66
- pre.src-calc:before { content: 'Emacs Calc'; }
67
- pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
68
- pre.src-fortran:before { content: 'Fortran'; }
69
- pre.src-gnuplot:before { content: 'gnuplot'; }
70
- pre.src-haskell:before { content: 'Haskell'; }
71
- pre.src-hledger:before { content: 'hledger'; }
72
- pre.src-java:before { content: 'Java'; }
73
- pre.src-js:before { content: 'Javascript'; }
74
- pre.src-latex:before { content: 'LaTeX'; }
75
- pre.src-ledger:before { content: 'Ledger'; }
76
- pre.src-lisp:before { content: 'Lisp'; }
77
- pre.src-lilypond:before { content: 'Lilypond'; }
78
- pre.src-lua:before { content: 'Lua'; }
79
- pre.src-matlab:before { content: 'MATLAB'; }
80
- pre.src-mscgen:before { content: 'Mscgen'; }
81
- pre.src-ocaml:before { content: 'Objective Caml'; }
82
- pre.src-octave:before { content: 'Octave'; }
83
- pre.src-org:before { content: 'Org mode'; }
84
- pre.src-oz:before { content: 'OZ'; }
85
- pre.src-plantuml:before { content: 'Plantuml'; }
86
- pre.src-processing:before { content: 'Processing.js'; }
87
- pre.src-python:before { content: 'Python'; }
88
- pre.src-R:before { content: 'R'; }
89
- pre.src-ruby:before { content: 'Ruby'; }
90
- pre.src-sass:before { content: 'Sass'; }
91
- pre.src-scheme:before { content: 'Scheme'; }
92
- pre.src-screen:before { content: 'Gnu Screen'; }
93
- pre.src-sed:before { content: 'Sed'; }
94
- pre.src-sh:before { content: 'shell'; }
95
- pre.src-sql:before { content: 'SQL'; }
96
- pre.src-sqlite:before { content: 'SQLite'; }
97
- /* additional languages in org.el's org-babel-load-languages alist */
98
- pre.src-forth:before { content: 'Forth'; }
99
- pre.src-io:before { content: 'IO'; }
100
- pre.src-J:before { content: 'J'; }
101
- pre.src-makefile:before { content: 'Makefile'; }
102
- pre.src-maxima:before { content: 'Maxima'; }
103
- pre.src-perl:before { content: 'Perl'; }
104
- pre.src-picolisp:before { content: 'Pico Lisp'; }
105
- pre.src-scala:before { content: 'Scala'; }
106
- pre.src-shell:before { content: 'Shell Script'; }
107
- pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
108
- /* additional language identifiers per "defun org-babel-execute"
109
- in ob-*.el */
110
- pre.src-cpp:before { content: 'C++'; }
111
- pre.src-abc:before { content: 'ABC'; }
112
- pre.src-coq:before { content: 'Coq'; }
113
- pre.src-groovy:before { content: 'Groovy'; }
114
- /* additional language identifiers from org-babel-shell-names in
115
- ob-shell.el: ob-shell is the only babel language using a lambda to put
116
- the execution function name together. */
117
- pre.src-bash:before { content: 'bash'; }
118
- pre.src-csh:before { content: 'csh'; }
119
- pre.src-ash:before { content: 'ash'; }
120
- pre.src-dash:before { content: 'dash'; }
121
- pre.src-ksh:before { content: 'ksh'; }
122
- pre.src-mksh:before { content: 'mksh'; }
123
- pre.src-posh:before { content: 'posh'; }
124
- /* Additional Emacs modes also supported by the LaTeX listings package */
125
- pre.src-ada:before { content: 'Ada'; }
126
- pre.src-asm:before { content: 'Assembler'; }
127
- pre.src-caml:before { content: 'Caml'; }
128
- pre.src-delphi:before { content: 'Delphi'; }
129
- pre.src-html:before { content: 'HTML'; }
130
- pre.src-idl:before { content: 'IDL'; }
131
- pre.src-mercury:before { content: 'Mercury'; }
132
- pre.src-metapost:before { content: 'MetaPost'; }
133
- pre.src-modula-2:before { content: 'Modula-2'; }
134
- pre.src-pascal:before { content: 'Pascal'; }
135
- pre.src-ps:before { content: 'PostScript'; }
136
- pre.src-prolog:before { content: 'Prolog'; }
137
- pre.src-simula:before { content: 'Simula'; }
138
- pre.src-tcl:before { content: 'tcl'; }
139
- pre.src-tex:before { content: 'TeX'; }
140
- pre.src-plain-tex:before { content: 'Plain TeX'; }
141
- pre.src-verilog:before { content: 'Verilog'; }
142
- pre.src-vhdl:before { content: 'VHDL'; }
143
- pre.src-xml:before { content: 'XML'; }
144
- pre.src-nxml:before { content: 'XML'; }
145
- /* add a generic configuration mode; LaTeX export needs an additional
146
- (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
147
- pre.src-conf:before { content: 'Configuration File'; }
148
-
149
- table { border-collapse:collapse; }
150
- caption.t-above { caption-side: top; }
151
- caption.t-bottom { caption-side: bottom; }
152
- td, th { vertical-align:top; }
153
- th.org-right { text-align: center; }
154
- th.org-left { text-align: center; }
155
- th.org-center { text-align: center; }
156
- td.org-right { text-align: right; }
157
- td.org-left { text-align: left; }
158
- td.org-center { text-align: center; }
159
- dt { font-weight: bold; }
160
- .footpara { display: inline; }
161
- .footdef { margin-bottom: 1em; }
162
- .figure { padding: 1em; }
163
- .figure p { text-align: center; }
164
- .inlinetask {
165
- padding: 10px;
166
- border: 2px solid gray;
167
- margin: 10px;
168
- background: #ffffcc;
169
- }
170
- #org-div-home-and-up
171
- { text-align: right; font-size: 70%; white-space: nowrap; }
172
- textarea { overflow-x: auto; }
173
- .linenr { font-size: smaller }
174
- .code-highlighted { background-color: #ffff00; }
175
- .org-info-js_info-navigation { border-style: none; }
176
- #org-info-js_console-label
177
- { font-size: 10px; font-weight: bold; white-space: nowrap; }
178
- .org-info-js_search-highlight
179
- { background-color: #ffff00; color: #000000; font-weight: bold; }
180
- .org-svg { width: 90%; }
181
- /*]]>*/-->
182
- </style>
183
- <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/styles/readtheorg/css/htmlize.css"/>
184
- <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/styles/readtheorg/css/readtheorg.css"/>
185
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
186
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
187
- <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/styles/lib/js/jquery.stickytableheaders.min.js"></script>
188
- <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/styles/readtheorg/js/readtheorg.js"></script>
189
- <script type="text/javascript">
190
- /*
191
- @licstart The following is the entire license notice for the
192
- JavaScript code in this tag.
193
-
194
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
195
-
196
- The JavaScript code in this tag is free software: you can
197
- redistribute it and/or modify it under the terms of the GNU
198
- General Public License (GNU GPL) as published by the Free Software
199
- Foundation, either version 3 of the License, or (at your option)
200
- any later version. The code is distributed WITHOUT ANY WARRANTY;
201
- without even the implied warranty of MERCHANTABILITY or FITNESS
202
- FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
203
-
204
- As additional permission under GNU GPL version 3 section 7, you
205
- may distribute non-source (e.g., minimized or compacted) forms of
206
- that code without the copy of the GNU GPL normally required by
207
- section 4, provided you include this license notice and a URL
208
- through which recipients can access the Corresponding Source.
209
-
210
-
211
- @licend The above is the entire license notice
212
- for the JavaScript code in this tag.
213
- */
214
- <!--/*--><![CDATA[/*><!--*/
215
- function CodeHighlightOn(elem, id)
216
- {
217
- var target = document.getElementById(id);
218
- if(null != target) {
219
- elem.cacheClassElem = elem.className;
220
- elem.cacheClassTarget = target.className;
221
- target.className = "code-highlighted";
222
- elem.className = "code-highlighted";
223
- }
224
- }
225
- function CodeHighlightOff(elem, id)
226
- {
227
- var target = document.getElementById(id);
228
- if(elem.cacheClassElem)
229
- elem.className = elem.cacheClassElem;
230
- if(elem.cacheClassTarget)
231
- target.className = elem.cacheClassTarget;
232
- }
233
- /*]]>*///-->
234
- </script>
235
- </head>
236
- <body>
237
- <div id="content">
238
- <h1 class="title">my_help README</h1>
239
- <div id="table-of-contents">
240
- <h2>Table of Contents</h2>
241
- <div id="text-table-of-contents">
242
- <ul>
243
- <li><a href="#概要">1. 概要</a></li>
244
- <li><a href="#my_helpで解決しようとする問題点">2. (my_helpで解決しようとする)問題点</a></li>
245
- <li><a href="#特徴">3. 特徴</a></li>
246
- <li><a href="#使用法">4. 使用法</a>
247
- <ul>
248
- <li><a href="#org3ddc9ea">4.1. インストール</a></li>
249
- <li><a href="#簡単な使用法">4.2. 簡単な使用法</a></li>
250
- <li><a href="#独自のhelpを作る方法">4.3. 独自のhelpを作る方法</a></li>
251
- </ul>
252
- </li>
253
- </ul>
254
- </div>
255
- </div>
256
-
257
- <div id="outline-container-orga76e8f5" class="outline-2">
258
- <h2 id="概要"><a id="orga76e8f5"></a><span class="section-number-2">1</span> 概要</h2>
259
- <div class="outline-text-2" id="text-概要">
260
- <p>
261
- CUI(CLA)ヘルプのUsage出力を真似て,user独自のhelpを作成・提供するgem.
262
- </p>
263
- </div>
264
- </div>
265
-
266
-
267
- <div id="outline-container-org230661d" class="outline-2">
268
- <h2 id="my_helpで解決しようとする問題点"><a id="org230661d"></a><span class="section-number-2">2</span> (my_helpで解決しようとする)問題点</h2>
269
- <div class="outline-text-2" id="text-my_helpで解決しようとする問題点">
270
- <p>
271
- CUIやshell, 何かのプログラミング言語などを習得しようとする初心者は,
272
- commandや文法を覚えるのに苦労します.少しのkey(とっかかり)があると
273
- 思い出すんですが,うろ覚えでは間違えて路頭に迷います.問題点は,
274
- </p>
275
- <ul class="org-ul">
276
- <li>manは基本的に英語</li>
277
- <li>manualでは重たい</li>
278
- <li>いつもおなじことをwebで検索して</li>
279
- <li>同じとこ見ている</li>
280
- <li>memoしても,どこへ置いたか忘れる</li>
281
- </ul>
282
- <p>
283
- などです.
284
- </p>
285
- </div>
286
- </div>
287
-
288
- <div id="outline-container-org63e30d5" class="outline-2">
289
- <h2 id="特徴"><a id="org63e30d5"></a><span class="section-number-2">3</span> 特徴</h2>
290
- <div class="outline-text-2" id="text-特徴">
291
- <p>
292
- これらをCLA環境として提供しようというのが,このgemの目的です.
293
- 仕様としては,
294
- </p>
295
- <ul class="org-ul">
296
- <li>userが自分にあったmanを作成</li>
297
- <li>雛形を提供</li>
298
- <li>おなじformat, looks, 操作, 階層構造</li>
299
- <li>すぐに手が届く</li>
300
- <li>それらを追加・修正・削除できる</li>
301
- </ul>
302
-
303
- <p>
304
- memoソフトでは,検索が必要となりますが,my_helpは
305
- key(記憶のとっかかり)を提供することが目的です.
306
- RPGでレベル上げとかアイテムを貯めるようにして,
307
- プログラミングでスキルを発展させてください.
308
- </p>
309
-
310
- <p>
311
- 物覚えの悪い作者は,人の名前をitem分けして,こそっと使っています.
312
- </p>
313
- </div>
314
- </div>
315
-
316
- <div id="outline-container-org03968c9" class="outline-2">
317
- <h2 id="使用法"><a id="org03968c9"></a><span class="section-number-2">4</span> 使用法</h2>
318
- <div class="outline-text-2" id="text-使用法">
319
- </div>
320
- <div id="outline-container-org3ddc9ea" class="outline-3">
321
- <h3 id="org3ddc9ea"><span class="section-number-3">4.1</span> インストール</h3>
322
- <div class="outline-text-3" id="text-4-1">
323
- <pre class="example">
324
- $ gem install my_help
325
-
326
- </pre>
327
- <p>
328
- です.
329
- </p>
330
- </div>
331
- </div>
332
-
333
- <div id="outline-container-org157ee1b" class="outline-3">
334
- <h3 id="簡単な使用法"><a id="org157ee1b"></a><span class="section-number-3">4.2</span> 簡単な使用法</h3>
335
- <div class="outline-text-3" id="text-簡単な使用法">
336
- <p>
337
- まずは,
338
- </p>
339
- <pre class="example">
340
- &gt; my_help
341
- NAME
342
- my_help - make own help and list.
343
-
344
- SYNOPSIS
345
- my_help [global options] command [command options] [arguments...]
346
-
347
- VERSION
348
- 0.7.0
349
-
350
- GLOBAL OPTIONS
351
- --help - Show this message
352
- --version - Display the program version
353
-
354
- COMMANDS
355
- delete - delete HELP_NAME help
356
- edit - edit HELP_NAME help
357
- help - Shows a list of commands or help for one command
358
- list - list all helps, specific HELP, or item
359
- new - make new HELP_NAME
360
- </pre>
361
- <p>
362
- としてください.このlistにargsやitemを加えて行くとわかると思います.
363
- </p>
364
-
365
- <pre class="example">
366
- my_help list
367
- my_help list emacs
368
- my_help list emacs -f
369
- my_help list emacs file
370
-
371
- </pre>
372
- <p>
373
- として動かしてみてください.
374
- </p>
375
-
376
-
377
- <pre class="example">
378
- - emacsのキーバインド
379
- -
380
- 特殊キー操作
381
- - C-f, controlキーを押しながら 'f'
382
- - M-f, escキーを押した後一度離して'f'
383
- - 操作の中断C-g, 操作の取り消し(Undo) C-x u
384
- , head : head
385
- , license : license
386
- -c, cursor : cursor
387
- -e, edit : edit
388
- -s, short_cut : short_cut
389
- -f, file : file
390
- -q, quit : quit
391
- -p, page : page
392
- -w, window : window
393
- -b, buffer : buffer
394
- -m, mode : mode
395
- , query_replace : query_replace
396
- -r, ruby-mode : ruby-mode
397
- -d, dired : ファイラとして使う
398
- </pre>
399
- </div>
400
- </div>
401
-
402
- <div id="outline-container-orgc3249b5" class="outline-3">
403
- <h3 id="独自のhelpを作る方法"><a id="orgc3249b5"></a><span class="section-number-3">4.3</span> 独自のhelpを作る方法</h3>
404
- <div class="outline-text-3" id="text-独自のhelpを作る方法">
405
- <p>
406
- さて,独自のhelpを作る方法です.まずは,
407
- </p>
408
-
409
- <pre class="example">
410
- my_help new new_help
411
-
412
- </pre>
413
-
414
- <p>
415
- で,new_helpというtemplateが用意されます.
416
- </p>
417
- <pre class="example">
418
- my_help edit new_help
419
-
420
- </pre>
421
- <p>
422
- で編集してください. emacs org形式で,格納されています.
423
- </p>
424
-
425
- <pre class="example">
426
- my_help delete new_help
427
-
428
- </pre>
429
-
430
- <p>
431
- すると消されます.
432
- </p>
433
- </div>
434
- </div>
435
- </div>
436
- </div>
437
- <div id="postamble" class="status">
438
- <p class="author">Author: Shigeto R. Nishitani</p>
439
- <p class="date">Created: 2019-04-26 金 12:47</p>
440
- <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
441
- </div>
442
- </body>
443
- </html>
data/README.rdoc DELETED
@@ -1,6 +0,0 @@
1
- = my_help
2
-
3
- Describe your project here
4
-
5
- :include:my_help.rdoc
6
-
data/bin/my_help_thor DELETED
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'thor'
3
- require 'my_help'
4
- require 'colorize'
5
- class MyCLI < Thor
6
- desc('setup', 'set up the test database')
7
- def setup(*args)
8
- $control = MyHelp::Control.new()
9
- end
10
-
11
- desc "list", "list all helps, specific HELP, or item"
12
- def list(*args)
13
- invoke :setup
14
- file = args[0]
15
- item = args[1]
16
- if file.nil?
17
- puts $control.list_all # list []
18
- elsif item.nil?
19
- begin
20
- puts $control.list_help(file) # list [file]
21
- rescue => e
22
- puts e.to_s.red
23
- end
24
- else
25
- begin
26
- puts $control.show_item(file, item) # list [file] [item]
27
- rescue => e
28
- puts e.to_s.red
29
- end
30
- end
31
- end
32
-
33
- desc "edit {help_name}", "edit HELP_NAME"
34
- def edit(help_name)
35
- invoke :setup
36
- $control.edit_help(help_name)
37
- end
38
-
39
- desc "new {help_name}", "make new HELP_NAME"
40
- def new(help_name)
41
- invoke :setup
42
- $control.init_help(help_name)
43
- end
44
-
45
- desc "delete {help_name}", "delete HELP_NAME"
46
- def delete(help_name)
47
- invoke :setup
48
- $control.delete_help(help_name)
49
- end
50
-
51
- desc "tomo_upload {help_name}", "tomo_upload HELP_NAME"
52
- def tomo_upload(help_name)
53
- invoke :setup
54
- $control.upload_help(help_name)
55
- end
56
-
57
- desc "search {find_char}", "search FIND_CHAR"
58
- def search(find_char)
59
- invoke :setup
60
- $control.search_help(find_char)
61
- end
62
- end
63
-
64
- MyCLI.start(ARGV)
65
-
66
-
data/exe/my_help_gli DELETED
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'gli'
3
- require 'my_help'
4
-
5
- include GLI::App
6
-
7
- program_desc 'make own help and list.'
8
-
9
- version MyHelp::VERSION
10
-
11
- subcommand_option_handling :normal
12
- arguments :strict
13
-
14
- desc 'list all helps, specific HELP, or item'
15
- arg_name 'HELP_NAME, ITEM'
16
- command :list do |c|
17
- c.action do |global_options,options,args|
18
- file, item = args
19
- if file.nil?
20
- $control.list_all
21
- elsif item.nil?
22
- $control.list_help(file)
23
- else
24
- $control.show_item(file, item)
25
- end
26
- end
27
- end
28
-
29
- desc 'edit HELP_NAME help'
30
- arg_name 'HELP_NAME'
31
- command :edit do |c|
32
- c.action do |global_options,options,args|
33
- $control.edit_help(args[0])
34
- end
35
- end
36
-
37
- desc 'make new HELP_NAME help'
38
- arg_name 'HELP_NAME'
39
- command :new do |c|
40
- c.action do |global_options,options,args|
41
- $control.init_help(args[0])
42
- end
43
- end
44
-
45
- desc 'delete HELP_NAME help'
46
- arg_name 'HELP_NAME'
47
- command :delete do |c|
48
- c.action do |global_options,options,args|
49
- $control.delete_help(args[0])
50
- end
51
- end
52
-
53
- desc 'tomo_upload HELP_NAME help'
54
- arg_name 'HELP_NAME'
55
- command :tomo_upload do |c|
56
- c.action do |global_options,options,args|
57
- $control.upload_help(args[0])
58
- end
59
- end
60
-
61
- desc 'search FIND_CHAR'
62
- arg_name = 'FIND_CHAR'
63
- command :search do |c|
64
- c.action do |global_options,options,args|
65
- $control.search_help(args[0])
66
- end
67
- end
68
-
69
-
70
- pre do |global,command,options,args|
71
- $control = MyHelp::Control.new()
72
- true
73
- end
74
-
75
- post do |global,command,options,args|
76
- end
77
-
78
- on_error do |exception|
79
- true
80
- end
81
-
82
- exit run(ARGV)