my_help 1.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +1 -1
  4. data/.yardoc/checksums +11 -5
  5. data/.yardoc/object_types +0 -0
  6. data/.yardoc/objects/root.dat +0 -0
  7. data/Gemfile.lock +1 -1
  8. data/README.org +84 -117
  9. data/README_j.org +143 -0
  10. data/{docs/README.org → development_memo.org} +41 -1
  11. data/doc/MyHelp/CLI.html +749 -0
  12. data/doc/MyHelp/Config.html +693 -0
  13. data/doc/MyHelp/Error.html +124 -0
  14. data/doc/MyHelp/GetConfig.html +196 -0
  15. data/doc/MyHelp/Git.html +291 -0
  16. data/doc/MyHelp/Init.html +449 -0
  17. data/doc/MyHelp/List.html +577 -0
  18. data/doc/MyHelp/Md2Hash.html +632 -0
  19. data/doc/MyHelp/Modify.html +393 -0
  20. data/doc/MyHelp/Org2Hash.html +542 -0
  21. data/doc/MyHelp.html +10 -8
  22. data/doc/Org2Yaml.html +497 -0
  23. data/doc/_index.html +102 -7
  24. data/doc/class_list.html +1 -1
  25. data/doc/file.README.html +81 -412
  26. data/doc/frames.html +1 -1
  27. data/doc/index.html +81 -412
  28. data/doc/method_list.html +292 -36
  29. data/doc/top-level-namespace.html +5 -5
  30. data/lib/my_help/cli.rb +6 -1
  31. data/lib/my_help/version.rb +1 -1
  32. data/my_help.gemspec +1 -0
  33. metadata +17 -26
  34. data/'../test'/.my_help/.my_help_conf.yml +0 -2
  35. data/'../test'/.my_help/emacs.org +0 -50
  36. data/'../test'/.my_help/org.org +0 -64
  37. data/'../test'/.my_help/todo.org +0 -11
  38. data/README_en.org +0 -131
  39. data/docs/README.html +0 -218
  40. data/docs/old_docs/16b_nasu.pdf +0 -0
  41. data/docs/old_docs/17b_oyagi.pdf +0 -0
  42. data/docs/old_docs/19b_okabata.pdf +0 -0
  43. data/docs/old_docs/19b_yamaguchi.pdf +0 -0
  44. data/docs/old_docs/features/delete.feature +0 -7
  45. data/docs/old_docs/features/edit.feature +0 -7
  46. data/docs/old_docs/features/list.feature +0 -6
  47. data/docs/old_docs/features/new.feature +0 -7
  48. data/docs/old_docs/features/step_definitions/delete_spec.rb +0 -12
  49. data/docs/old_docs/features/step_definitions/edit_spec.rb +0 -14
  50. data/docs/old_docs/features/step_definitions/list_spec.rb +0 -10
  51. data/docs/old_docs/features/step_definitions/new_spec.rb +0 -12
  52. data/docs/old_docs/features/support/env.rb +0 -3
  53. data/docs/old_docs/fukumori_symp/18_human_interface_fukumori_workshop.pdf +0 -0
  54. data/docs/old_docs/fukumori_symp/memo_perp_magician.pdf +0 -0
  55. 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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 564753efc9cef4daea1c31839b464b39f24c74cb79e3ca1eac262dbbfe059018
4
- data.tar.gz: 73336ae571ed079bc34ac6b6bdf229ccca5e875e41ac668ff65998776f9ee2ac
3
+ metadata.gz: 4aea4b438a5be4715107a41097ff21fa7d35e8cebed822e9995594bc827c6305
4
+ data.tar.gz: b964ebdcc06a3e414d5535172a31b69018dbf1cb43db5641101c88f5457a4c91
5
5
  SHA512:
6
- metadata.gz: f43172b79ddc338021d83f8791088a45fd573a7c8b090d12b7e2f85708c1b9863c6866809fc49969995af6233bd4b2869b388c9cb7e4b7597466ba1007b8a65e
7
- data.tar.gz: 6886f5fd8276df5d4325e87c524c31fd236a6d0b45150571072b596c7b13abd7b6b4670d69d99deade5128348e30345c696e6c761074b9195ab0be1a0bea3006
6
+ metadata.gz: c6d3ce8dcdd71f8e01baecc483f56412791137ab455ba45750966321fb197f7941fd341720bedba55035a3c573d21fea1753d154977a2ddb7c44dfb8751694b0
7
+ data.tar.gz: 4fcb4b3440365f8364677a6b7aac6d06574cd781e89e277185b0eb54934d976b4df58da318e09c05686fbbe1fd93ca912f458c970d59bfb9445896f4f02568e0
data/.DS_Store ADDED
Binary file
data/.gitignore CHANGED
@@ -4,7 +4,7 @@
4
4
  /.yardoc
5
5
  /_yardoc/
6
6
  /coverage/
7
- /doc/
7
+ /docs/
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /vendor/
data/.yardoc/checksums CHANGED
@@ -1,5 +1,11 @@
1
- lib/my_help.rb ced6dd68eb7342dc65e8c8506359cb9a18f37fde
2
- lib/my_help/org2yml.rb 0246f80ac2e821e5778aff8395dabbd6fbedc1d6
3
- lib/my_help/version.rb 8107e9718a720a9369e085771ab7c04ecb5bb8dc
4
- lib/my_help/my_help_controll.rb ccf627da5074e19887d379130df76b0b3db845a2
5
- lib/my_help/tomo_help_controll.rb da39a3ee5e6b4b0d3255bfef95601890afd80709
1
+ lib/my_help.rb 7539f0f58056d44d38352f868bfea4d6fb63a9ee
2
+ lib/my_help/cli.rb 8cd7468e74ef89e8a9ee83e5e780b70b6e2874c4
3
+ lib/my_help/init.rb ac83b0cbfd9394278da8e7bf83b089cb84e132e4
4
+ lib/my_help/list.rb 30d4be2eb41e623abeeb6914ab9907ced97ed722
5
+ lib/my_help/config.rb d7162fbe953828fc7e6a5aac89adf8678131068f
6
+ lib/my_help/modify.rb 17a00a9f1b4126d9c067a320b47639e5a5fec845
7
+ lib/my_help/git_cli.rb bb04396f0b9d54ecb13100fe5cde029f7dbb0ea7
8
+ lib/my_help/md2hash.rb 35ebd32d3f545b40cd9ebb1972dc60d53b58b22a
9
+ lib/my_help/org2yml.rb 334d0a7b648dc75b1d9504ec6d68937c70e96343
10
+ lib/my_help/version.rb e82ec18cc8f885ee6c9b6846c3813e1eb96981a9
11
+ lib/my_help/org2hash.rb 939fea903abb5247959d74e18afc8db30fb5f6c8
data/.yardoc/object_types CHANGED
Binary file
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- my_help (1.0c)
4
+ my_help (1.2.2)
5
5
  colorize
6
6
  command_line
7
7
  thor
data/README.org CHANGED
@@ -1,96 +1,80 @@
1
- # my_help
2
- #+AUTHOR: Shigeto R. Nishitani
3
- #+EMAIL: (concat "nishitani@kwansei.ac.jp")
4
- #+LANGUAGE: jp
5
- #+OPTIONS: H:4 toc:t num:2
6
- #+SETUPFILE: /Users/bob/.emacs.d/org-mode/theme-readtheorg.setup
7
- #+STARTUP: indent nolineimages
1
+ #+STARTUP: indent nolineimages content
8
2
  #+OPTIONS: ^:{}
9
-
10
- * 概要
11
- :PROPERTIES:
12
- :CUSTOM_ID: 概要
13
- :END:
14
-
15
- CUI(CLA)ヘルプのUsage出力を真似て,user独自のhelpを作成・提供するgem.
16
-
17
-
18
- * (my_helpで解決しようとする)問題点
19
- :PROPERTIES:
20
- :CUSTOM_ID: my_helpで解決しようとする問題点
21
- :END:
22
-
23
- CUIやshell, 何かのプログラミング言語などを習得しようとする初心者は,
24
- commandや文法を覚えるのに苦労します.
25
- 少しのkey(とっかかり)があると思い出すんですが,
26
- うろ覚えでは間違えて路頭に迷います.
27
- 問題点は,
28
- + manは基本的に英語
29
- + manualでは重たい
30
- + いつもおなじことをwebで検索して
31
- + 同じとこ見ている
32
- + memoしても,どこへ置いたか忘れる
33
- などです.
34
-
35
- * 特徴
36
- :PROPERTIES:
37
- :CUSTOM_ID: 特徴
38
- :END:
39
-
40
- これらをCLAとして提供しようというのが,このgemの目的です.
41
- 仕様としては,
42
- - userが自分にあったmanを作成
43
- - 雛形を提供
44
- - おなじformat, looks, 操作, 階層構造
45
- - すぐに手が届く
46
- - それらを追加・修正・削除できる
47
-
48
- memoソフトでは,検索が必要となりますが,my_help
49
- key(記憶のとっかかり)を提供することが目的です.
50
- RPGでレベル上げとかアイテムを貯めるようにして,
51
- プログラミングでスキルを発展させてください.
52
-
53
- VSCodeやGithub Copilotではcodeの候補を挙げてくれますが,
54
- 物覚えの悪い作者は,人の名前をitem分けして,こそっと使っています.
55
-
56
- * 使用法
57
- :PROPERTIES:
58
- :CUSTOM_ID: 使用法
59
- :END:
60
- ** インストール
61
-
62
- : > gem install my_help
63
- です.
64
-
65
- ** 簡単な使用法
66
- :PROPERTIES:
67
- :CUSTOM_ID: 簡単な使用法
68
- :END:
69
-
70
- まずは,
71
- #+begin_src bash
3
+ * Name
4
+ - my_help :: manual like help for each user
5
+
6
+ * Summary
7
+ This gem makes and supplies user specific helps, emulating CUI(CLI) help
8
+ usage.
9
+
10
+ * Target
11
+ A very novice of learning a specific operation,
12
+ such as CUI, shell, or emacs,
13
+ has a difficulty in remembering commands and grammers.
14
+ Some simple `key' reminds all, but no key brings nothing.
15
+ Especially a non-English-native has a strong difficulty
16
+ on the key remembering.
17
+ The problems are,
18
+ - a man(ual) is in English
19
+ - a man is heavily documented
20
+ - On web, searching the same key word,
21
+ - and reading the same URI repeatedly
22
+ - but a memo goes away somewhere...
23
+
24
+ * Specs
25
+ This gem aims to supply own help by gem environment.
26
+ Specs are,
27
+ - user makes his own help
28
+ - supplies a template
29
+ - a same format, looks, operation, and hierarchy
30
+ - easily see, read
31
+ - supplies editing and install commands.
32
+
33
+ Wiki targets the whole engineer, my_help targets a specific person.
34
+ Half of the wiki aim should be covered by my_help.
35
+ Making own manual is one of the best practices for remembering operations.
36
+ Memo applications are good, if you remember the key word.
37
+ my_help supplies the key for remembering the word.
38
+
39
+ * Usage
40
+ ** Install
41
+
42
+ : $ gem install my_help
43
+
44
+ ** Simple Usage
45
+ At first, you can see the commands supplied by my_help.
46
+ #+begin_example
72
47
  > my_help
73
- Commands:
74
- my_help delete HELP # delete HELP
75
- my_help edit HELP # edit HELP
76
- my_help help [COMMAND] # Describe available commands or one specific command
77
- my_help list [HELP] [ITEM] # list all helps, specific HELP, or ITEM
78
- my_help new HELP # make new HELP
79
- my_help set_editor EDITOR_NAME # set editor to EDITOR_NAME
80
- my_help setup # set up the test database
81
- my_help version # show version
82
- #+end_src
83
- としてください.このlistにNAMEやITEMを加えて行くとわかると思います.
84
-
85
- #+begin_src bash
86
- > my_help list
87
- > my_help list emacs
88
- > my_help list emacs -f
89
- > my_help list emacs file
90
- #+end_src
91
- として動かしてみてください.
92
-
93
- #+begin_src bash
48
+ NAME
49
+ my_help - make own help and list.
50
+
51
+ SYNOPSIS
52
+ my_help [global options] command [command options] [arguments...]
53
+
54
+ VERSION
55
+ 0.7.0
56
+
57
+ GLOBAL OPTIONS
58
+ --help - Show this message
59
+ --version - Display the program version
60
+
61
+ COMMANDS
62
+ delete - delete HELP_NAME help
63
+ edit - edit HELP_NAME help
64
+ help - Shows a list of commands or help for one command
65
+ list - list all helps, specific HELP, or item
66
+ new - make new HELP_NAME
67
+ #+end_example
68
+
69
+ When you add HELP_NAME and item (-o)wo'
70
+
71
+ : my_help list
72
+ : my_help list emacs_help
73
+ : my_help list emacs_help -f
74
+ : my_help list emacs_help file
75
+
76
+
77
+ #+BEGIN_EXAMPLE
94
78
  - emacsのキーバインド
95
79
  -
96
80
  特殊キー操作
@@ -111,33 +95,16 @@ Commands:
111
95
  , query_replace : query_replace
112
96
  -r, ruby-mode : ruby-mode
113
97
  -d, dired : ファイラとして使う
114
- #+end_src
115
-
116
- ** my_helpがやっていること
117
- my_helpの個々のヘルプファイルは'~/.my_help'に置かれています.
118
- ヘルプファイルのフォーマットはEmacsのorg-modeです.
119
- これをEditorで叩いて編集したり,
120
- そこから情報を取り出したりしています.
121
- 単にファイル操作を集約しているだけなのですが,
122
- これが面倒で...
123
-
124
-
125
- ** 独自のhelpを作る方法
126
- 独自のhelpを作る方法です.まずは,
127
-
128
- : $ my_help new new_help
98
+ #+END_EXAMPLE
129
99
 
130
- で,new_helpというtemplateが用意されます.
131
- : $ my_help edit new_help
132
- で編集してください. Emacs org形式で,格納されています.
100
+ ** Make your own help
101
+ For making your new help, you can do tha as follows:
102
+ : my_help new new_help
133
103
 
134
- : $ my_help delete new_help
104
+ A templeate is compied, then you can edit as
105
+ : my_help edit new_help
106
+ The file is stored in emacs org mode.
135
107
 
136
- すると消されます.
137
- ** editorの変更
138
- : $ my_help set_editor vim
139
- でeditorを変更できます.codeとかは確認していますが,
140
- それ以外で動いたり,動かなかったりを報告してください.
108
+ You can delete if as follows:
109
+ : my_help delete new_help
141
110
 
142
- OS Xで'emacs'とした時にGUI版が立ち上がって嫌だという場合は,
143
- 'emacs -nw'として下さい.
data/README_j.org ADDED
@@ -0,0 +1,143 @@
1
+ # my_help
2
+ #+AUTHOR: Shigeto R. Nishitani
3
+ #+EMAIL: (concat "nishitani@kwansei.ac.jp")
4
+ #+LANGUAGE: jp
5
+ #+OPTIONS: H:4 toc:t num:2
6
+ #+SETUPFILE: /Users/bob/.emacs.d/org-mode/theme-readtheorg.setup
7
+ #+STARTUP: indent nolineimages
8
+ #+OPTIONS: ^:{}
9
+
10
+ * 概要
11
+ :PROPERTIES:
12
+ :CUSTOM_ID: 概要
13
+ :END:
14
+
15
+ CUI(CLA)ヘルプのUsage出力を真似て,user独自のhelpを作成・提供するgem.
16
+
17
+
18
+ * (my_helpで解決しようとする)問題点
19
+ :PROPERTIES:
20
+ :CUSTOM_ID: my_helpで解決しようとする問題点
21
+ :END:
22
+
23
+ CUIやshell, 何かのプログラミング言語などを習得しようとする初心者は,
24
+ commandや文法を覚えるのに苦労します.
25
+ 少しのkey(とっかかり)があると思い出すんですが,
26
+ うろ覚えでは間違えて路頭に迷います.
27
+ 問題点は,
28
+ + manは基本的に英語
29
+ + manualでは重たい
30
+ + いつもおなじことをwebで検索して
31
+ + 同じとこ見ている
32
+ + memoしても,どこへ置いたか忘れる
33
+ などです.
34
+
35
+ * 特徴
36
+ :PROPERTIES:
37
+ :CUSTOM_ID: 特徴
38
+ :END:
39
+
40
+ これらをCLAとして提供しようというのが,このgemの目的です.
41
+ 仕様としては,
42
+ - userが自分にあったmanを作成
43
+ - 雛形を提供
44
+ - おなじformat, looks, 操作, 階層構造
45
+ - すぐに手が届く
46
+ - それらを追加・修正・削除できる
47
+
48
+ memoソフトでは,検索が必要となりますが,my_helpは
49
+ key(記憶のとっかかり)を提供することが目的です.
50
+ RPGでレベル上げとかアイテムを貯めるようにして,
51
+ プログラミングでスキルを発展させてください.
52
+
53
+ VSCodeやGithub Copilotではcodeの候補を挙げてくれますが,
54
+ 物覚えの悪い作者は,人の名前をitem分けして,こそっと使っています.
55
+
56
+ * 使用法
57
+ :PROPERTIES:
58
+ :CUSTOM_ID: 使用法
59
+ :END:
60
+ ** インストール
61
+
62
+ : > gem install my_help
63
+ です.
64
+
65
+ ** 簡単な使用法
66
+ :PROPERTIES:
67
+ :CUSTOM_ID: 簡単な使用法
68
+ :END:
69
+
70
+ まずは,
71
+ #+begin_src bash
72
+ > my_help
73
+ Commands:
74
+ my_help delete HELP # delete HELP
75
+ my_help edit HELP # edit HELP
76
+ my_help help [COMMAND] # Describe available commands or one specific command
77
+ my_help list [HELP] [ITEM] # list all helps, specific HELP, or ITEM
78
+ my_help new HELP # make new HELP
79
+ my_help set_editor EDITOR_NAME # set editor to EDITOR_NAME
80
+ my_help setup # set up the test database
81
+ my_help version # show version
82
+ #+end_src
83
+ としてください.このlistにNAMEやITEMを加えて行くとわかると思います.
84
+
85
+ #+begin_src bash
86
+ > my_help list
87
+ > my_help list emacs
88
+ > my_help list emacs -f
89
+ > my_help list emacs file
90
+ #+end_src
91
+ として動かしてみてください.
92
+
93
+ #+begin_src bash
94
+ - emacsのキーバインド
95
+ -
96
+ 特殊キー操作
97
+ - C-f, controlキーを押しながら 'f'
98
+ - M-f, escキーを押した後一度離して'f'
99
+ - 操作の中断C-g, 操作の取り消し(Undo) C-x u
100
+ , head : head
101
+ , license : license
102
+ -c, cursor : cursor
103
+ -e, edit : edit
104
+ -s, short_cut : short_cut
105
+ -f, file : file
106
+ -q, quit : quit
107
+ -p, page : page
108
+ -w, window : window
109
+ -b, buffer : buffer
110
+ -m, mode : mode
111
+ , query_replace : query_replace
112
+ -r, ruby-mode : ruby-mode
113
+ -d, dired : ファイラとして使う
114
+ #+end_src
115
+
116
+ ** my_helpがやっていること
117
+ my_helpの個々のヘルプファイルは'~/.my_help'に置かれています.
118
+ ヘルプファイルのフォーマットはEmacsのorg-modeです.
119
+ これをEditorで叩いて編集したり,
120
+ そこから情報を取り出したりしています.
121
+ 単にファイル操作を集約しているだけなのですが,
122
+ これが面倒で...
123
+
124
+
125
+ ** 独自のhelpを作る方法
126
+ 独自のhelpを作る方法です.まずは,
127
+
128
+ : $ my_help new new_help
129
+
130
+ で,new_helpというtemplateが用意されます.
131
+ : $ my_help edit new_help
132
+ で編集してください. Emacs org形式で,格納されています.
133
+
134
+ : $ my_help delete new_help
135
+
136
+ すると消されます.
137
+ ** editorの変更
138
+ : $ my_help set_editor vim
139
+ でeditorを変更できます.codeとかは確認していますが,
140
+ それ以外で動いたり,動かなかったりを報告してください.
141
+
142
+ OS Xで'emacs'とした時にGUI版が立ち上がって嫌だという場合は,
143
+ 'emacs -nw'として下さい.
@@ -12,8 +12,48 @@
12
12
  #+TWITTER: off
13
13
  #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
14
14
 
15
+ * <2023-01-07 Sat> Thor
16
+ いくつかのaliasをThorで実現したい
17
+ - my_help -v
18
+ - my_help --version
19
+ という標準的なoption期待に答える.
20
+
21
+ - [[https://marsbased.com/blog/2020/04/27/building-ruby-cli-thor/][author token, aliases sample]]
22
+ - [[https://stackoverflow.com/questions/28504373/command-aliasing-in-thor][map]]
23
+ なんかの記述があったが,
24
+ - https://github.com/rails/thor/wiki
25
+ で解決.やっぱり原典ね.
26
+
27
+ あと,その後ろの方に,例文の引き方があって,
28
+ - https://gist.github.com/search?l=ruby&q=.thor
29
+ が便利なんがわかった.これは,使える.
30
+
31
+
15
32
  * <2023-01-06 Fri> get_configの置き場所
16
- thorのsubcommandを使って
33
+ Thorのsubcommandを使ってclassを分けたが,共通で利用する
34
+ get_configメソッドをどこに置くかで悩んだ.
35
+
36
+ 結局,
37
+ #+begin_src ruby
38
+ # git_cli.rb
39
+ Module MyHelp
40
+ Module GetConfig
41
+ Class Git < Thor
42
+ include GetConfig
43
+ ...
44
+ end
45
+ # cli.rb
46
+ Module MyHelp
47
+ Class CLI < Thor
48
+ include GetConfig
49
+ ...
50
+ end
51
+ # my_help.rb
52
+ require_relative "my_help/git_cli"
53
+ require_relative "my_help/cli"
54
+ #+end_src
55
+ としている.
56
+ 専用のModuleを作成して,includeするという方法.
17
57
  * <2023-01-05 Thu> cli directory指定
18
58
  ** directory指定
19
59
  テスト環境と本番環境でのhelp_dirあるいはconfig_dir指定の