my_help 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +59 -156
- data/Rakefile +3 -6
- data/hikis/README_en.hiki +100 -0
- data/hikis/README_ja.hiki +6 -1
- data/lib/my_help/version.rb +1 -1
- data/lib/my_help.rb +17 -0
- data/my_help.wiki/Home.md +6 -1
- data/my_help.wiki/README_en.md +102 -0
- data/my_help.wiki/README_ja.md +6 -1
- metadata +3 -9
- data/exe/#my_help# +0 -4
- data/exe/n_h +0 -4
- data/exe/new_help +0 -4
- data/lib/daddygongon/new_help +0 -24
- data/lib/emacs_help.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0721dfa53bb1f947e0b402a2ba25ecc64e8ae1ef
|
4
|
+
data.tar.gz: 42b4f7f2de674d2f25bc6ac875de1f38761b79c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 972c547476053f85b68fe8b8ad179152788a8166c6e9557eaca234d8ff5301c48c007f25aa22d346b67c3e33b85c4aef9092f523ea888006b654445aae6a8b8b
|
7
|
+
data.tar.gz: cdd523e517803fa58e531dba1bb629abf57e67043ca34c7d0672722590042924aa613996bf8ceebb7c0fc577afd6302ddb7fd02333680389b3bca90509562ce6
|
data/README.md
CHANGED
@@ -1,45 +1,53 @@
|
|
1
|
-
#
|
1
|
+
# Name
|
2
2
|
|
3
3
|
my_help
|
4
4
|
|
5
|
-
#
|
6
|
-
|
7
|
-
CUI(CLI)
|
8
|
-
|
9
|
-
#
|
10
|
-
CUI
|
11
|
-
|
12
|
-
|
13
|
-
-
|
14
|
-
|
15
|
-
|
16
|
-
-
|
17
|
-
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
-
|
28
|
-
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
5
|
+
# Summary
|
6
|
+
|
7
|
+
This gem makes and supplies user specific helps, emulating CUI(CLI) help usage.
|
8
|
+
|
9
|
+
# Target
|
10
|
+
A very novice of learning some specific operation, such as CUI, shell, or emacs,
|
11
|
+
has difficulty in remembering commands and grammers.
|
12
|
+
If he has a key, he can easily remember all, but no key brings nothing.
|
13
|
+
Especially a non-English-native has strong difficulty on the key rememebering.
|
14
|
+
The problems are,
|
15
|
+
|
16
|
+
- man(ual) is English
|
17
|
+
- man is heavily documented
|
18
|
+
- On web, search the same key word,
|
19
|
+
- and read the same URI repeatedly
|
20
|
+
- memo goes away somewhere...
|
21
|
+
|
22
|
+
# Specs
|
23
|
+
|
24
|
+
This gem aims to supply own help by gem environment.
|
25
|
+
Specs are,
|
26
|
+
- user makes his own help
|
27
|
+
- supplies a template
|
28
|
+
- same format, looks, operation, and hierarchy
|
29
|
+
- easily see, read
|
30
|
+
- supplies editing and install commands.
|
31
|
+
|
32
|
+
Wiki targets the whole engineer, my_help target the specific person.
|
33
|
+
Half of the wiki aim should be covered by my_help.
|
34
|
+
Making own manual is one of the best practices for remembering operations.
|
35
|
+
Memo applications are good, if you remember the key word.
|
36
|
+
my_help supplies the key for remembering the word.
|
37
|
+
|
38
|
+
# Usage
|
39
|
+
## Install
|
40
|
+
|
41
|
+
Different from the gem standard, fork and clone from Github.
|
37
42
|
```
|
38
|
-
|
43
|
+
github.com:daddygongon/my_help.git
|
39
44
|
```
|
40
|
-
|
45
|
+
The following operations are performed under 'bundle'.
|
46
|
+
The main reason of this disturbance is due the developer not to know the last command of 'rake install:local' from gem environment.
|
47
|
+
But the second reason is the on-going project to collect and supply the good helps for novices.
|
48
|
+
We are planning to achieve it by using 'pull request' of Github.
|
41
49
|
|
42
|
-
|
50
|
+
Supplied commands are
|
43
51
|
|
44
52
|
```
|
45
53
|
bob% bundle exec exe/my_help
|
@@ -50,7 +58,8 @@ Usage: my_help [options]
|
|
50
58
|
-i, --init NAME NAME(例:test_help)のtemplateを作成.
|
51
59
|
-m, --make make and install:local all helps.
|
52
60
|
```
|
53
|
-
|
61
|
+
|
62
|
+
At first, see the list of supplied helps by the option of -l.
|
54
63
|
|
55
64
|
```
|
56
65
|
bob% bundle exec exe/my_help -l
|
@@ -60,10 +69,12 @@ Specific help file:
|
|
60
69
|
emacs_help
|
61
70
|
test_help
|
62
71
|
```
|
63
|
-
|
72
|
+
emacs_help, e_h, test_help, t_h are ready to use.
|
73
|
+
Play them by a command such as 'bundle exec exe/e_h'.
|
64
74
|
|
65
|
-
##
|
66
|
-
|
75
|
+
## Make own help
|
76
|
+
The next step is making own help.
|
77
|
+
For this, -i NAME supplies new NAME help.
|
67
78
|
|
68
79
|
```
|
69
80
|
bob% bundle exec exe/my_help -i new_help
|
@@ -74,126 +85,18 @@ bob% bundle exec exe/my_help -i new_help
|
|
74
85
|
cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
75
86
|
/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon/new_help
|
76
87
|
```
|
77
|
-
|
88
|
+
it makes get ready the template of new_help in daddygongon dir.
|
89
|
+
Edit it by -e new_help.
|
90
|
+
Then -m make new_help and n_h in exe directory.
|
91
|
+
|
92
|
+
## Activate own help
|
93
|
+
For the last step, at the my_help directory, put the commands in as follows:
|
78
94
|
|
79
|
-
そのあと,my_helpのdirectoryで
|
80
95
|
```
|
81
96
|
git add -A
|
82
97
|
git commit -m 'add new help'
|
83
98
|
rake install:local
|
84
99
|
```
|
85
|
-
してください.
|
86
|
-
|
87
|
-
# userの独自helpの達成方法
|
88
|
-
(rake my_helpでやっていたが,今は,my_help -mに移行)
|
89
|
-
|
90
|
-
exe中のファイルをrakeで自動生成.
|
91
|
-
./lib/daddygongon/にそれらのdataを保存.以下ではその名前から
|
92
|
-
exe中に実行ファイルを自動生成させている.
|
93
|
-
```
|
94
|
-
lib/daddygongon/
|
95
|
-
└── emacs_help
|
96
|
-
|
97
|
-
exe
|
98
|
-
├── e_h
|
99
|
-
└── emacs_help
|
100
|
-
```
|
101
|
-
ということ.これは,
|
102
|
-
```
|
103
|
-
rake my_help
|
104
|
-
```
|
105
|
-
で実行される.これを
|
106
|
-
```
|
107
|
-
rake install:local
|
108
|
-
```
|
109
|
-
すれば必要とするhelpがlocalな環境で表示される.
|
110
|
-
|
111
|
-
たくさんの実行ファイルを/usr/loca/binに置くことになるので,
|
112
|
-
```
|
113
|
-
gem uninstall my_help
|
114
|
-
gem uninstall emacs_help
|
115
|
-
```
|
116
|
-
でそこをcleanにしておくことが望ましい.
|
117
100
|
|
118
|
-
|
119
|
-
|
120
|
-
in Rakefile
|
121
|
-
```
|
122
|
-
|
123
|
-
```ruby
|
124
|
-
desc "make own help from lib/daddygongon/files"
|
125
|
-
task :my_help do
|
126
|
-
exe_cont="#!/usr/bin/env ruby\n"
|
127
|
-
user_name = 'daddygongon'
|
128
|
-
p entries=Dir.entries(File.join('.','lib',user_name))[2..-1]
|
129
|
-
entries.each{|file|
|
130
|
-
p file
|
131
|
-
p file_name=file.split('_')
|
132
|
-
target_files = [file, file_name[0][0]+"_"+file_name[1][0]]
|
133
|
-
p cont_name = File.join('lib',user_name,file)
|
134
|
-
exe_cont << "require 'my_help'\n"
|
135
|
-
exe_cont << "help_file = File.expand_path(\"../../#{cont_name}\", __FILE__)\n"
|
136
|
-
exe_cont << "MyHelp::Command.run(help_file, ARGV)\n"
|
137
|
-
target_files.each{|name|
|
138
|
-
p ''
|
139
|
-
p target=File.join('exe',name)
|
140
|
-
File.open(target,'w'){|file|
|
141
|
-
print exe_cont
|
142
|
-
file.print exe_cont
|
143
|
-
}
|
144
|
-
FileUtils.chmod('a+x', target, :verbose => true)
|
145
|
-
}
|
146
|
-
}
|
147
|
-
end
|
148
|
-
```
|
149
|
-
|
150
|
-
実装方法は,emacs_helpに
|
151
|
-
|
152
|
-
1. yaml形式でdataを入れ,command.runの入力ファイルとする
|
153
|
-
1. hush形式でdataをいれ,それをrequireして使う
|
154
|
-
|
155
|
-
かのどちらかで実装.speedとかdebugを比較・検証する必要あり.
|
156
|
-
今の所,No.1の方を実装.No.2のためのhushデータは,
|
157
|
-
|
158
|
-
```ruby
|
159
|
-
require 'yaml'
|
160
|
-
require 'pp'
|
161
|
-
|
162
|
-
pp YAML.load(File.read(ARGV[0]))
|
163
|
-
```
|
164
|
-
|
165
|
-
```
|
166
|
-
ruby test.rb lib/daddygongon/emacs_help
|
167
|
-
```
|
168
|
-
|
169
|
-
で構築できる.実装してみて.
|
170
|
-
|
171
|
-
|
172
|
-
# どちらがいいか
|
173
|
-
Rubyで日本語が使えるから,optionsを日本語にしてみた.
|
174
|
-
```
|
175
|
-
Usage: eh [options]
|
176
|
-
-v, --version show program Version.
|
177
|
-
-c, --カーソル Cursor移動
|
178
|
-
-p, --ページ Page移動
|
179
|
-
-f, --ファイル File操作
|
180
|
-
-e, --編集 Edit操作
|
181
|
-
-w, --ウィンドウ Window操作
|
182
|
-
-b, --バッファ Buffer操作
|
183
|
-
-q, --終了 終了操作
|
184
|
-
```
|
185
|
-
半角,全角がoptparseでは適切に判断できない様で,表示があまり揃っていない.
|
186
|
-
しかし,初心者の振る舞いを見ているとわざわざ日本語に切り替えて打ち込むことは稀であり,
|
187
|
-
key wordをhelpで参照してshort optionで入力している.そこで,
|
188
|
-
```
|
189
|
-
Usage: eh [options]
|
190
|
-
-v, --version show program Version.
|
191
|
-
-c, --cursor カーソル移動
|
192
|
-
-p, --page ページ移動
|
193
|
-
-f, --file ファイル操作
|
194
|
-
-e, --edit 編集操作
|
195
|
-
-w, --window ウィンドウ操作
|
196
|
-
-b, --buffer バッファ操作
|
197
|
-
-q, --quit 終了操作
|
198
|
-
```
|
199
|
-
としたほうがいいと提案する.アンケートを実施してみてほしい.
|
101
|
+
That's it. You can use the new_help or short command of n_h on CUI.
|
102
|
+
If not, restart the terminal to load the bin path.
|
data/Rakefile
CHANGED
@@ -32,12 +32,9 @@ task :hiki2md do
|
|
32
32
|
}
|
33
33
|
readme_en="#{basename}.wiki/README_en.md"
|
34
34
|
readme_ja="#{basename}.wiki/README_ja.md"
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
FileUtils.cp(readme_ja,"./README.md",:verbose=>true)
|
39
|
-
FileUtils.cp(readme_ja,"#{basename}.wiki/Home.md",:verbose=>true)
|
40
|
-
end
|
35
|
+
FileUtils.cp(readme_en,"./README_en.md",:verbose=>true)
|
36
|
+
FileUtils.cp(readme_ja,"./README.md",:verbose=>true)
|
37
|
+
FileUtils.cp(readme_ja,"#{basename}.wiki/Home.md",:verbose=>true)
|
41
38
|
end
|
42
39
|
|
43
40
|
desc "transfer hikis/*.hiki to latex"
|
@@ -0,0 +1,100 @@
|
|
1
|
+
!Name
|
2
|
+
|
3
|
+
my_help
|
4
|
+
|
5
|
+
!Summary
|
6
|
+
|
7
|
+
This gem makes and supplies user specific helps, emulating CUI(CLI) help usage.
|
8
|
+
|
9
|
+
!Target
|
10
|
+
A very novice of learning some specific operation, such as CUI, shell, or emacs,
|
11
|
+
has difficulty in remembering commands and grammers.
|
12
|
+
If he has a key, he can easily remember all, but no key brings nothing.
|
13
|
+
Especially a non-English-native has strong difficulty on the key rememebering.
|
14
|
+
The problems are,
|
15
|
+
|
16
|
+
* man(ual) is English
|
17
|
+
* man is heavily documented
|
18
|
+
* On web, search the same key word,
|
19
|
+
* and read the same URI repeatedly
|
20
|
+
* memo goes away somewhere...
|
21
|
+
|
22
|
+
!Specs
|
23
|
+
|
24
|
+
This gem aims to supply own help by gem environment.
|
25
|
+
Specs are,
|
26
|
+
* user makes his own help
|
27
|
+
* supplies a template
|
28
|
+
** same format, looks, operation, and hierarchy
|
29
|
+
* easily see, read
|
30
|
+
* supplies editing and install commands.
|
31
|
+
|
32
|
+
Wiki targets the whole engineer, my_help target the specific person.
|
33
|
+
Half of the wiki aim should be covered by my_help.
|
34
|
+
Making own manual is one of the best practices for remembering operations.
|
35
|
+
Memo applications are good, if you remember the key word.
|
36
|
+
my_help supplies the key for remembering the word.
|
37
|
+
|
38
|
+
!Usage
|
39
|
+
!!Install
|
40
|
+
|
41
|
+
Different from the gem standard, fork and clone from Github.
|
42
|
+
github.com:daddygongon/my_help.git
|
43
|
+
The following operations are performed under 'bundle'.
|
44
|
+
The main reason of this disturbance is due the developer not to know the last command of 'rake install:local' from gem environment.
|
45
|
+
But the second reason is the on-going project to collect and supply the good helps for novices.
|
46
|
+
We are planning to achieve it by using 'pull request' of Github.
|
47
|
+
|
48
|
+
Supplied commands are
|
49
|
+
|
50
|
+
<<<
|
51
|
+
bob% bundle exec exe/my_help
|
52
|
+
Usage: my_help [options]
|
53
|
+
-v, --version show program Version.
|
54
|
+
-l, --list 個別(specific)ヘルプのList表示.
|
55
|
+
-e, --edit NAME NAME(例:test_help)をEdit編集.
|
56
|
+
-i, --init NAME NAME(例:test_help)のtemplateを作成.
|
57
|
+
-m, --make make and install:local all helps.
|
58
|
+
>>>
|
59
|
+
|
60
|
+
At first, see the list of supplied helps by the option of -l.
|
61
|
+
|
62
|
+
<<<
|
63
|
+
bob% bundle exec exe/my_help -l
|
64
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon"
|
65
|
+
["-l"]
|
66
|
+
Specific help file:
|
67
|
+
emacs_help
|
68
|
+
test_help
|
69
|
+
>>>
|
70
|
+
emacs_help, e_h, test_help, t_h are ready to use.
|
71
|
+
Play them by a command such as 'bundle exec exe/e_h'.
|
72
|
+
|
73
|
+
!!Make own help
|
74
|
+
The next step is making own help.
|
75
|
+
For this, -i NAME supplies new NAME help.
|
76
|
+
|
77
|
+
<<<
|
78
|
+
bob% bundle exec exe/my_help -i new_help
|
79
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon"
|
80
|
+
["-i", "new_help"]
|
81
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon/new_help"
|
82
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help"
|
83
|
+
cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
84
|
+
/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon/new_help
|
85
|
+
>>>
|
86
|
+
it makes get ready the template of new_help in daddygongon dir.
|
87
|
+
Edit it by -e new_help.
|
88
|
+
Then -m make new_help and n_h in exe directory.
|
89
|
+
|
90
|
+
!!Activate own help
|
91
|
+
For the last step, at the my_help directory, put the commands in as follows:
|
92
|
+
|
93
|
+
<<<
|
94
|
+
git add -A
|
95
|
+
git commit -m 'add new help'
|
96
|
+
rake install:local
|
97
|
+
>>>
|
98
|
+
|
99
|
+
That's it. You can use the new_help or short command of n_h on CUI.
|
100
|
+
If not, restart the terminal to load the bin path.
|
data/hikis/README_ja.hiki
CHANGED
@@ -47,6 +47,7 @@ Usage: my_help [options]
|
|
47
47
|
-e, --edit NAME NAME(例:test_help)をEdit編集.
|
48
48
|
-i, --init NAME NAME(例:test_help)のtemplateを作成.
|
49
49
|
-m, --make make and install:local all helps.
|
50
|
+
-c, --clean clean up exe dir.
|
50
51
|
>>>
|
51
52
|
です.まず,-lでdefaultで入っているリストを見てください.
|
52
53
|
|
@@ -74,7 +75,8 @@ cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
|
74
75
|
>>>
|
75
76
|
で,new_helpというtemplateが用意されます.-e new_helpで編集してください.そのあと,-mすると自動でnew_helpがexeディレクトリーに追加されます.
|
76
77
|
|
77
|
-
|
78
|
+
!!独自helpを使えるように
|
79
|
+
最後,my_helpのdirectoryで
|
78
80
|
<<<
|
79
81
|
git add -A
|
80
82
|
git commit -m 'add new help'
|
@@ -82,6 +84,9 @@ cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
|
82
84
|
>>>
|
83
85
|
してください.
|
84
86
|
|
87
|
+
これで終わり.new_helpや短縮形のn_hでhelpが使えます.
|
88
|
+
もし使えないときは,bin pathが通ってないので,terminalをnewしてください.
|
89
|
+
|
85
90
|
!userの独自helpの達成方法
|
86
91
|
(rake my_helpでやっていたが,今は,my_help -mに移行)
|
87
92
|
|
data/lib/my_help/version.rb
CHANGED
data/lib/my_help.rb
CHANGED
@@ -30,6 +30,7 @@ module MyHelp
|
|
30
30
|
opt.on('-e NAME', '--edit NAME', 'NAME(例:test_help)をEdit編集.'){|file| edit_help(file)}
|
31
31
|
opt.on('-i NAME', '--init NAME', 'NAME(例:test_help)のtemplateを作成.'){|file| init_help(file)}
|
32
32
|
opt.on('-m', '--make', 'make and install:local all helps.'){make_help}
|
33
|
+
opt.on('-c', '--clean', 'clean up exe dir.'){clean_exe}
|
33
34
|
end
|
34
35
|
begin
|
35
36
|
command_parser.parse!(@argv)
|
@@ -62,6 +63,22 @@ module MyHelp
|
|
62
63
|
}
|
63
64
|
end
|
64
65
|
|
66
|
+
def clean_exe
|
67
|
+
p entries=Dir.entries(@target_dir)[2..-1]
|
68
|
+
entries.each{|file|
|
69
|
+
p file
|
70
|
+
next if file[0]=='#' or file[-1]=='~'
|
71
|
+
p file_name=file.split('_')
|
72
|
+
target_files = [file, file_name[0][0]+"_"+file_name[1][0]]
|
73
|
+
target = File.join(@target_dir,file)
|
74
|
+
target_files.each{|name|
|
75
|
+
print "\n"
|
76
|
+
p target=File.join('exe',name)
|
77
|
+
FileUtils::Verbose.rm(target)
|
78
|
+
}
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
65
82
|
def init_help(file)
|
66
83
|
p target_help=File.join(@target_dir,file)
|
67
84
|
p template = File.join(File.dirname(@target_dir),'my_help','template_help')
|
data/my_help.wiki/Home.md
CHANGED
@@ -49,6 +49,7 @@ Usage: my_help [options]
|
|
49
49
|
-e, --edit NAME NAME(例:test_help)をEdit編集.
|
50
50
|
-i, --init NAME NAME(例:test_help)のtemplateを作成.
|
51
51
|
-m, --make make and install:local all helps.
|
52
|
+
-c, --clean clean up exe dir.
|
52
53
|
```
|
53
54
|
です.まず,-lでdefaultで入っているリストを見てください.
|
54
55
|
|
@@ -76,7 +77,8 @@ cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
|
76
77
|
```
|
77
78
|
で,new_helpというtemplateが用意されます.-e new_helpで編集してください.そのあと,-mすると自動でnew_helpがexeディレクトリーに追加されます.
|
78
79
|
|
79
|
-
|
80
|
+
## 独自helpを使えるように
|
81
|
+
最後,my_helpのdirectoryで
|
80
82
|
```
|
81
83
|
git add -A
|
82
84
|
git commit -m 'add new help'
|
@@ -84,6 +86,9 @@ cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
|
84
86
|
```
|
85
87
|
してください.
|
86
88
|
|
89
|
+
これで終わり.new_helpや短縮形のn_hでhelpが使えます.
|
90
|
+
もし使えないときは,bin pathが通ってないので,terminalをnewしてください.
|
91
|
+
|
87
92
|
# userの独自helpの達成方法
|
88
93
|
(rake my_helpでやっていたが,今は,my_help -mに移行)
|
89
94
|
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# Name
|
2
|
+
|
3
|
+
my_help
|
4
|
+
|
5
|
+
# Summary
|
6
|
+
|
7
|
+
This gem makes and supplies user specific helps, emulating CUI(CLI) help usage.
|
8
|
+
|
9
|
+
# Target
|
10
|
+
A very novice of learning some specific operation, such as CUI, shell, or emacs,
|
11
|
+
has difficulty in remembering commands and grammers.
|
12
|
+
If he has a key, he can easily remember all, but no key brings nothing.
|
13
|
+
Especially a non-English-native has strong difficulty on the key rememebering.
|
14
|
+
The problems are,
|
15
|
+
|
16
|
+
- man(ual) is English
|
17
|
+
- man is heavily documented
|
18
|
+
- On web, search the same key word,
|
19
|
+
- and read the same URI repeatedly
|
20
|
+
- memo goes away somewhere...
|
21
|
+
|
22
|
+
# Specs
|
23
|
+
|
24
|
+
This gem aims to supply own help by gem environment.
|
25
|
+
Specs are,
|
26
|
+
- user makes his own help
|
27
|
+
- supplies a template
|
28
|
+
- same format, looks, operation, and hierarchy
|
29
|
+
- easily see, read
|
30
|
+
- supplies editing and install commands.
|
31
|
+
|
32
|
+
Wiki targets the whole engineer, my_help target the specific person.
|
33
|
+
Half of the wiki aim should be covered by my_help.
|
34
|
+
Making own manual is one of the best practices for remembering operations.
|
35
|
+
Memo applications are good, if you remember the key word.
|
36
|
+
my_help supplies the key for remembering the word.
|
37
|
+
|
38
|
+
# Usage
|
39
|
+
## Install
|
40
|
+
|
41
|
+
Different from the gem standard, fork and clone from Github.
|
42
|
+
```
|
43
|
+
github.com:daddygongon/my_help.git
|
44
|
+
```
|
45
|
+
The following operations are performed under 'bundle'.
|
46
|
+
The main reason of this disturbance is due the developer not to know the last command of 'rake install:local' from gem environment.
|
47
|
+
But the second reason is the on-going project to collect and supply the good helps for novices.
|
48
|
+
We are planning to achieve it by using 'pull request' of Github.
|
49
|
+
|
50
|
+
Supplied commands are
|
51
|
+
|
52
|
+
```
|
53
|
+
bob% bundle exec exe/my_help
|
54
|
+
Usage: my_help [options]
|
55
|
+
-v, --version show program Version.
|
56
|
+
-l, --list 個別(specific)ヘルプのList表示.
|
57
|
+
-e, --edit NAME NAME(例:test_help)をEdit編集.
|
58
|
+
-i, --init NAME NAME(例:test_help)のtemplateを作成.
|
59
|
+
-m, --make make and install:local all helps.
|
60
|
+
```
|
61
|
+
|
62
|
+
At first, see the list of supplied helps by the option of -l.
|
63
|
+
|
64
|
+
```
|
65
|
+
bob% bundle exec exe/my_help -l
|
66
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon"
|
67
|
+
["-l"]
|
68
|
+
Specific help file:
|
69
|
+
emacs_help
|
70
|
+
test_help
|
71
|
+
```
|
72
|
+
emacs_help, e_h, test_help, t_h are ready to use.
|
73
|
+
Play them by a command such as 'bundle exec exe/e_h'.
|
74
|
+
|
75
|
+
## Make own help
|
76
|
+
The next step is making own help.
|
77
|
+
For this, -i NAME supplies new NAME help.
|
78
|
+
|
79
|
+
```
|
80
|
+
bob% bundle exec exe/my_help -i new_help
|
81
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon"
|
82
|
+
["-i", "new_help"]
|
83
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon/new_help"
|
84
|
+
"/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help"
|
85
|
+
cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
86
|
+
/usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/daddygongon/new_help
|
87
|
+
```
|
88
|
+
it makes get ready the template of new_help in daddygongon dir.
|
89
|
+
Edit it by -e new_help.
|
90
|
+
Then -m make new_help and n_h in exe directory.
|
91
|
+
|
92
|
+
## Activate own help
|
93
|
+
For the last step, at the my_help directory, put the commands in as follows:
|
94
|
+
|
95
|
+
```
|
96
|
+
git add -A
|
97
|
+
git commit -m 'add new help'
|
98
|
+
rake install:local
|
99
|
+
```
|
100
|
+
|
101
|
+
That's it. You can use the new_help or short command of n_h on CUI.
|
102
|
+
If not, restart the terminal to load the bin path.
|
data/my_help.wiki/README_ja.md
CHANGED
@@ -49,6 +49,7 @@ Usage: my_help [options]
|
|
49
49
|
-e, --edit NAME NAME(例:test_help)をEdit編集.
|
50
50
|
-i, --init NAME NAME(例:test_help)のtemplateを作成.
|
51
51
|
-m, --make make and install:local all helps.
|
52
|
+
-c, --clean clean up exe dir.
|
52
53
|
```
|
53
54
|
です.まず,-lでdefaultで入っているリストを見てください.
|
54
55
|
|
@@ -76,7 +77,8 @@ cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
|
76
77
|
```
|
77
78
|
で,new_helpというtemplateが用意されます.-e new_helpで編集してください.そのあと,-mすると自動でnew_helpがexeディレクトリーに追加されます.
|
78
79
|
|
79
|
-
|
80
|
+
## 独自helpを使えるように
|
81
|
+
最後,my_helpのdirectoryで
|
80
82
|
```
|
81
83
|
git add -A
|
82
84
|
git commit -m 'add new help'
|
@@ -84,6 +86,9 @@ cp /usr/local/lib/ruby/gems/2.2.0/gems/my_help-0.2.1/lib/my_help/template_help
|
|
84
86
|
```
|
85
87
|
してください.
|
86
88
|
|
89
|
+
これで終わり.new_helpや短縮形のn_hでhelpが使えます.
|
90
|
+
もし使えないときは,bin pathが通ってないので,terminalをnewしてください.
|
91
|
+
|
87
92
|
# userの独自helpの達成方法
|
88
93
|
(rake my_helpでやっていたが,今は,my_help -mに移行)
|
89
94
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_help
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shigeto R. Nishitani
|
@@ -112,12 +112,9 @@ description: Emulating CUI(CLI) help, an user makes and displays his own helps.
|
|
112
112
|
email:
|
113
113
|
- shigeto_nishitani@me.com
|
114
114
|
executables:
|
115
|
-
- "#my_help#"
|
116
115
|
- e_h
|
117
116
|
- emacs_help
|
118
117
|
- my_help
|
119
|
-
- n_h
|
120
|
-
- new_help
|
121
118
|
- t_h
|
122
119
|
- test_help
|
123
120
|
extensions: []
|
@@ -133,26 +130,23 @@ files:
|
|
133
130
|
- Rakefile
|
134
131
|
- bin/console
|
135
132
|
- bin/setup
|
136
|
-
- exe/#my_help#
|
137
133
|
- exe/e_h
|
138
134
|
- exe/emacs_help
|
139
135
|
- exe/my_help
|
140
|
-
- exe/n_h
|
141
|
-
- exe/new_help
|
142
136
|
- exe/t_h
|
143
137
|
- exe/test_help
|
138
|
+
- hikis/README_en.hiki
|
144
139
|
- hikis/README_ja.hiki
|
145
140
|
- latexes/handout_pre.tex
|
146
141
|
- lib/daddygongon/emacs_help
|
147
|
-
- lib/daddygongon/new_help
|
148
142
|
- lib/daddygongon/test_help
|
149
|
-
- lib/emacs_help.rb
|
150
143
|
- lib/my_help.rb
|
151
144
|
- lib/my_help/template_help
|
152
145
|
- lib/my_help/version.rb
|
153
146
|
- lib/specific_help.rb
|
154
147
|
- my_help.gemspec
|
155
148
|
- my_help.wiki/Home.md
|
149
|
+
- my_help.wiki/README_en.md
|
156
150
|
- my_help.wiki/README_ja.md
|
157
151
|
homepage: https://github.com/daddygongon/my_help
|
158
152
|
licenses:
|
data/exe/#my_help#
DELETED
data/exe/n_h
DELETED
data/exe/new_help
DELETED
data/lib/daddygongon/new_help
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
:head:
|
3
|
-
- "TODO: ヘルプ内容の概略.\n"
|
4
|
-
- " 常に表示される内容を記述.\n"
|
5
|
-
- " 下を参照して変更してください.\n"
|
6
|
-
:item:
|
7
|
-
:opts:
|
8
|
-
:short: "-i"
|
9
|
-
:long: "--item"
|
10
|
-
:desc: 単元(item)
|
11
|
-
:title: "\n単元\n"
|
12
|
-
:cont:
|
13
|
-
- c-f, move Forwrard, 前or右へ
|
14
|
-
- フォーマットは自由です. ','があるときは2文字下げ,ないときは4文字下げ
|
15
|
-
:item2:
|
16
|
-
:opts:
|
17
|
-
:short: "-j"
|
18
|
-
:long: "--item2"
|
19
|
-
:desc: 単元2(item2)
|
20
|
-
:title: "\n単元2\n"
|
21
|
-
:cont:
|
22
|
-
- c-f, move Forwrard, 前or右へ
|
23
|
-
- フォーマットは自由です.
|
24
|
-
|
data/lib/emacs_help.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require "optparse"
|
3
|
-
require "yaml"
|
4
|
-
require "emacs_help/version"
|
5
|
-
|
6
|
-
module EmacsHelp
|
7
|
-
class Command
|
8
|
-
|
9
|
-
def self.run(argv=[])
|
10
|
-
new(argv).execute
|
11
|
-
end
|
12
|
-
|
13
|
-
def initialize(argv=[])
|
14
|
-
@help_cont = YAML.load(File.read('lib/daddygongon/emacs_help'))
|
15
|
-
@help_cont[:head].each{|line| print line }
|
16
|
-
@argv = argv
|
17
|
-
end
|
18
|
-
|
19
|
-
def execute
|
20
|
-
@argv << '--help' if @argv.size==0
|
21
|
-
command_parser = OptionParser.new do |opt|
|
22
|
-
opt.on('-v', '--version','show program Version.') { |v|
|
23
|
-
opt.version = EmacsHelp::VERSION
|
24
|
-
puts opt.ver
|
25
|
-
}
|
26
|
-
@help_cont.each_pair{|key,val|
|
27
|
-
next if key==:head
|
28
|
-
opts = val[:opts]
|
29
|
-
opt.on(opts[:short],opts[:long],opts[:desc]) {disp_from_help_cont(key)}
|
30
|
-
}
|
31
|
-
end
|
32
|
-
begin
|
33
|
-
command_parser.parse!(@argv)
|
34
|
-
rescue=> eval
|
35
|
-
p eval
|
36
|
-
end
|
37
|
-
exit
|
38
|
-
end
|
39
|
-
|
40
|
-
def disp(lines)
|
41
|
-
lines.each{|line|
|
42
|
-
if line.include?(',')
|
43
|
-
puts " #{line}"
|
44
|
-
else
|
45
|
-
puts " #{line}"
|
46
|
-
end
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
def disp_from_help_cont(key_word)
|
51
|
-
items =@help_cont[key_word]
|
52
|
-
puts items[:title]
|
53
|
-
disp(items[:cont])
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|