my_help 1.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.gitignore +1 -1
- data/.yardoc/checksums +11 -5
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile.lock +1 -1
- data/README.org +84 -117
- data/README_j.org +143 -0
- data/{docs/README.org → development_memo.org} +41 -1
- data/doc/MyHelp/CLI.html +749 -0
- data/doc/MyHelp/Config.html +693 -0
- data/doc/MyHelp/Error.html +124 -0
- data/doc/MyHelp/GetConfig.html +196 -0
- data/doc/MyHelp/Git.html +291 -0
- data/doc/MyHelp/Init.html +449 -0
- data/doc/MyHelp/List.html +577 -0
- data/doc/MyHelp/Md2Hash.html +632 -0
- data/doc/MyHelp/Modify.html +393 -0
- data/doc/MyHelp/Org2Hash.html +542 -0
- data/doc/MyHelp.html +10 -8
- data/doc/Org2Yaml.html +497 -0
- data/doc/_index.html +102 -7
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +81 -412
- data/doc/frames.html +1 -1
- data/doc/index.html +81 -412
- data/doc/method_list.html +292 -36
- data/doc/top-level-namespace.html +5 -5
- data/lib/my_help/cli.rb +6 -1
- data/lib/my_help/version.rb +1 -1
- data/my_help.gemspec +1 -0
- metadata +17 -26
- data/'../test'/.my_help/.my_help_conf.yml +0 -2
- data/'../test'/.my_help/emacs.org +0 -50
- data/'../test'/.my_help/org.org +0 -64
- data/'../test'/.my_help/todo.org +0 -11
- data/README_en.org +0 -131
- data/docs/README.html +0 -218
- 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 +0 -7
- data/docs/old_docs/features/edit.feature +0 -7
- data/docs/old_docs/features/list.feature +0 -6
- data/docs/old_docs/features/new.feature +0 -7
- data/docs/old_docs/features/step_definitions/delete_spec.rb +0 -12
- data/docs/old_docs/features/step_definitions/edit_spec.rb +0 -14
- data/docs/old_docs/features/step_definitions/list_spec.rb +0 -10
- data/docs/old_docs/features/step_definitions/new_spec.rb +0 -12
- data/docs/old_docs/features/support/env.rb +0 -3
- 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/'../test'/.my_help/org.org
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#+STARTUP: indent nolineimages
|
|
2
|
-
* head
|
|
3
|
-
- emacs org-modeのhelp
|
|
4
|
-
- [[http://akisute3.hatenablog.com/entry/2013/12/28/144918][org-mode による論文作成入門]]
|
|
5
|
-
- [[http://d.hatena.ne.jp/tamura70/20100209/org]]
|
|
6
|
-
- org-modeでc-h mでhelpがでる.
|
|
7
|
-
- https://orgmode.org/worg/org-tutorials/orgtutorial_dto.html
|
|
8
|
-
* license
|
|
9
|
-
- cc by Shigeto R. Nishitani, 2017
|
|
10
|
-
* item
|
|
11
|
-
- m-x org-mode
|
|
12
|
-
- emacs hogehoge.orgで起動
|
|
13
|
-
- - でitem追加
|
|
14
|
-
- * でitem追加
|
|
15
|
-
- #+STARTUP: indent nolineimages nofold
|
|
16
|
-
- #+TITLE: 格子欠陥について最近の研究から
|
|
17
|
-
- #+AUTHOR: 関西学院大学・理工学部・情報科学科 西谷滋人 2017
|
|
18
|
-
* key_bind
|
|
19
|
-
- tabでtoggle
|
|
20
|
-
- shift-tabで全部に対するtoggle
|
|
21
|
-
- shift-矢印でkeyを切り替え
|
|
22
|
-
- M-shift-<left, right>アウトラインのレベルをツリーごと移動
|
|
23
|
-
* convert
|
|
24
|
-
- #+OPTIONS: ^:{} でsub, superを抑制.
|
|
25
|
-
- markdown
|
|
26
|
-
1. in emacs, M-x org-md-export-as-markdown
|
|
27
|
-
2. pandoc -f markdown -t org -o tmp.md sample.org
|
|
28
|
-
3. 行の折り返し,M-x toggle-truncate-lines
|
|
29
|
-
- latex出力
|
|
30
|
-
1. c-c c-eでllを選択
|
|
31
|
-
2. 日本語と数式が混じる時には,$の前後に半角スペースを入れる
|
|
32
|
-
3. [[https://www-he.scphys.kyoto-u.ac.jp/member/shotakaha/dokuwiki/doku.php?id=toolbox:emacs:org:export:latex:start~]]
|
|
33
|
-
4. https://orgmode.org/worg/org-tutorials/org-latex-export.html
|
|
34
|
-
- beamer出力
|
|
35
|
-
1. c-c c-eでlbを選択
|
|
36
|
-
* list
|
|
37
|
-
- 項目- 子項目1
|
|
38
|
-
- 番号付き1. 2.
|
|
39
|
-
- 名前付き - 名前1 :: 内容1
|
|
40
|
-
* link
|
|
41
|
-
- [[file:./tmp/tmp.txt][Link to file]]
|
|
42
|
-
- [[link][name]]
|
|
43
|
-
- to edit, c-c c-l
|
|
44
|
-
- to open, c-c c-o
|
|
45
|
-
- org-return-follows-linkが設定されていたらRETでも開く
|
|
46
|
-
* todo
|
|
47
|
-
- c-c c-tでno_head->TODO->DONEをloop
|
|
48
|
-
- m-x agenda-modeでschedule操作可能コマンドを表示
|
|
49
|
-
* verb_and_source
|
|
50
|
-
- ': 'を頭に
|
|
51
|
-
- #+BEGIN_EXAMPLE...#+END_EXAMPLE
|
|
52
|
-
- #+BEGIN_QUOTE -- #+END_QUOTE
|
|
53
|
-
- #+BEGIN_SRC bash -- #+END_SRC
|
|
54
|
-
* date_and_time
|
|
55
|
-
- c-c .でカレンダーと日付表示<2018-03-14 Wed>
|
|
56
|
-
- +7とか-1を入力してreturnするとその日付が出力
|
|
57
|
-
- c-u c-c . で日付と時間の入力<2018-03-14 Wed 12:38>こんな感じ
|
|
58
|
-
* agenda
|
|
59
|
-
- (setq org-agenda-files (list "~/org/work.org"
|
|
60
|
-
"~/org/school.org"
|
|
61
|
-
"~/org/home.org"))
|
|
62
|
-
- C-c a t to enter the global todo list.
|
|
63
|
-
* move
|
|
64
|
-
- c-c c-u 上位のlevelへ
|
data/'../test'/.my_help/todo.org
DELETED
data/README_en.org
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
* Name
|
|
2
|
-
:PROPERTIES:
|
|
3
|
-
:CUSTOM_ID: name
|
|
4
|
-
:END:
|
|
5
|
-
|
|
6
|
-
my\_help
|
|
7
|
-
|
|
8
|
-
* Summary
|
|
9
|
-
:PROPERTIES:
|
|
10
|
-
:CUSTOM_ID: summary
|
|
11
|
-
:END:
|
|
12
|
-
|
|
13
|
-
This gem makes and supplies user specific helps, emulating CUI(CLI) help
|
|
14
|
-
usage.
|
|
15
|
-
|
|
16
|
-
* Target
|
|
17
|
-
:PROPERTIES:
|
|
18
|
-
:CUSTOM_ID: target
|
|
19
|
-
:END:
|
|
20
|
-
|
|
21
|
-
A very novice of learning some specific operation, such as CUI, shell,
|
|
22
|
-
or emacs, has difficulty in remembering commands and grammers. If he has
|
|
23
|
-
a key, he can easily remember all, but no key brings nothing. Especially
|
|
24
|
-
a non-English-native has strong difficulty on the key rememebering. The
|
|
25
|
-
problems are,
|
|
26
|
-
|
|
27
|
-
- man(ual) is English
|
|
28
|
-
- man is heavily documented
|
|
29
|
-
- On web, search the same key word,
|
|
30
|
-
- and read the same URI repeatedly
|
|
31
|
-
- memo goes away somewhere...
|
|
32
|
-
|
|
33
|
-
* Specs
|
|
34
|
-
:PROPERTIES:
|
|
35
|
-
:CUSTOM_ID: specs
|
|
36
|
-
:END:
|
|
37
|
-
|
|
38
|
-
This gem aims to supply own help by gem environment. Specs are, - user
|
|
39
|
-
makes his own help - supplies a template - same format, looks,
|
|
40
|
-
operation, and hierarchy - easily see, read - supplies editing and
|
|
41
|
-
install commands.
|
|
42
|
-
|
|
43
|
-
Wiki targets the whole engineer, my\_help target the specific person.
|
|
44
|
-
Half of the wiki aim should be covered by my\_help. Making own manual is
|
|
45
|
-
one of the best practices for remembering operations. Memo applications
|
|
46
|
-
are good, if you remember the key word. my\_help supplies the key for
|
|
47
|
-
remembering the word.
|
|
48
|
-
|
|
49
|
-
* Usage
|
|
50
|
-
:PROPERTIES:
|
|
51
|
-
:CUSTOM_ID: 使用法
|
|
52
|
-
:END:
|
|
53
|
-
** Install
|
|
54
|
-
|
|
55
|
-
: $ gem install my_help
|
|
56
|
-
|
|
57
|
-
** Simple Usage
|
|
58
|
-
:PROPERTIES:
|
|
59
|
-
:CUSTOM_ID: 簡単な使用法
|
|
60
|
-
:END:
|
|
61
|
-
|
|
62
|
-
At first, you can see the commands supplied by my_help.
|
|
63
|
-
#+begin_example
|
|
64
|
-
> my_help
|
|
65
|
-
NAME
|
|
66
|
-
my_help - make own help and list.
|
|
67
|
-
|
|
68
|
-
SYNOPSIS
|
|
69
|
-
my_help [global options] command [command options] [arguments...]
|
|
70
|
-
|
|
71
|
-
VERSION
|
|
72
|
-
0.7.0
|
|
73
|
-
|
|
74
|
-
GLOBAL OPTIONS
|
|
75
|
-
--help - Show this message
|
|
76
|
-
--version - Display the program version
|
|
77
|
-
|
|
78
|
-
COMMANDS
|
|
79
|
-
delete - delete HELP_NAME help
|
|
80
|
-
edit - edit HELP_NAME help
|
|
81
|
-
help - Shows a list of commands or help for one command
|
|
82
|
-
list - list all helps, specific HELP, or item
|
|
83
|
-
new - make new HELP_NAME
|
|
84
|
-
#+end_example
|
|
85
|
-
|
|
86
|
-
When you add HELP_NAME and item (-o)wo'
|
|
87
|
-
|
|
88
|
-
: my_help list
|
|
89
|
-
: my_help list emacs_help
|
|
90
|
-
: my_help list emacs_help -f
|
|
91
|
-
: my_help list emacs_help file
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
#+BEGIN_EXAMPLE
|
|
95
|
-
- emacsのキーバインド
|
|
96
|
-
-
|
|
97
|
-
特殊キー操作
|
|
98
|
-
- C-f, controlキーを押しながら 'f'
|
|
99
|
-
- M-f, escキーを押した後一度離して'f'
|
|
100
|
-
- 操作の中断C-g, 操作の取り消し(Undo) C-x u
|
|
101
|
-
, head : head
|
|
102
|
-
, license : license
|
|
103
|
-
-c, cursor : cursor
|
|
104
|
-
-e, edit : edit
|
|
105
|
-
-s, short_cut : short_cut
|
|
106
|
-
-f, file : file
|
|
107
|
-
-q, quit : quit
|
|
108
|
-
-p, page : page
|
|
109
|
-
-w, window : window
|
|
110
|
-
-b, buffer : buffer
|
|
111
|
-
-m, mode : mode
|
|
112
|
-
, query_replace : query_replace
|
|
113
|
-
-r, ruby-mode : ruby-mode
|
|
114
|
-
-d, dired : ファイラとして使う
|
|
115
|
-
#+END_EXAMPLE
|
|
116
|
-
|
|
117
|
-
** Make your own help
|
|
118
|
-
:PROPERTIES:
|
|
119
|
-
:CUSTOM_ID: 独自のhelpを作る方法
|
|
120
|
-
:END:
|
|
121
|
-
|
|
122
|
-
For making your new help, you can do tha as follows:
|
|
123
|
-
: my_help new new_help
|
|
124
|
-
|
|
125
|
-
A templeate is compied, then you can edit as
|
|
126
|
-
: my_help edit new_help
|
|
127
|
-
The file is stored in emacs org mode.
|
|
128
|
-
|
|
129
|
-
You can delete if as follows:
|
|
130
|
-
: my_help delete new_help
|
|
131
|
-
|
data/docs/README.html
DELETED
|
@@ -1,218 +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
|
-
<!-- 2023-01-05 Thu 15:58 -->
|
|
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 開発メモ</title>
|
|
10
|
-
<meta name="author" content="Shigeto R. Nishitani" />
|
|
11
|
-
<meta name="generator" content="Org Mode" />
|
|
12
|
-
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
|
|
13
|
-
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
|
|
14
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
|
15
|
-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
|
16
|
-
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
|
|
17
|
-
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<div id="content" class="content">
|
|
21
|
-
<h1 class="title">my_help 開発メモ</h1>
|
|
22
|
-
<div id="table-of-contents" role="doc-toc">
|
|
23
|
-
<h2>Table of Contents</h2>
|
|
24
|
-
<div id="text-table-of-contents" role="doc-toc">
|
|
25
|
-
<ul>
|
|
26
|
-
<li><a href="#orge4fa5d5">1. <span class="timestamp-wrapper"><span class="timestamp"><2022-12-15 Thu> </span></span> subcommand and options</a></li>
|
|
27
|
-
<li><a href="#org66ec027">2. <span class="timestamp-wrapper"><span class="timestamp"><2022-12-15 Thu> </span></span> rspecでerror</a>
|
|
28
|
-
<ul>
|
|
29
|
-
<li><a href="#orgab3a666">2.1. 解決!!</a></li>
|
|
30
|
-
</ul>
|
|
31
|
-
</li>
|
|
32
|
-
<li><a href="#org18dc25e">3. <span class="timestamp-wrapper"><span class="timestamp"><2021-10-18 Mon> </span></span> conf_pathの追加</a></li>
|
|
33
|
-
<li><a href="#org2aec50d">4. <span class="timestamp-wrapper"><span class="timestamp"><2021-11-08 Mon> </span></span> conf_pathをactivate</a></li>
|
|
34
|
-
<li><a href="#org20943ec">5. <span class="timestamp-wrapper"><span class="timestamp"><2021-11-08 Mon> </span></span> bundle exec exe/my_help editでエラー</a></li>
|
|
35
|
-
</ul>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div id="outline-container-orge4fa5d5" class="outline-2">
|
|
40
|
-
<h2 id="orge4fa5d5"><span class="section-number-2">1.</span> <span class="timestamp-wrapper"><span class="timestamp"><2022-12-15 Thu> </span></span> subcommand and options</h2>
|
|
41
|
-
<div class="outline-text-2" id="text-1">
|
|
42
|
-
<ul class="org-ul">
|
|
43
|
-
<li><a href="https://hawksnowlog.blogspot.com/2020/09/ruby-thor-tutorial.html#hello-thor">Ruby thor で CLI ツールの開発に入門してみる</a></li>
|
|
44
|
-
</ul>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<div id="outline-container-org66ec027" class="outline-2">
|
|
49
|
-
<h2 id="org66ec027"><span class="section-number-2">2.</span> <span class="timestamp-wrapper"><span class="timestamp"><2022-12-15 Thu> </span></span> rspecでerror</h2>
|
|
50
|
-
<div class="outline-text-2" id="text-2">
|
|
51
|
-
<p>
|
|
52
|
-
Arubaでrspecするとpwd directoryが/tmp/arubaになる?
|
|
53
|
-
そうすると今のままではrspecが通らなくなる.
|
|
54
|
-
example2.orgの置き場が不定.
|
|
55
|
-
spec側で強引に作るか...
|
|
56
|
-
</p>
|
|
57
|
-
|
|
58
|
-
<p>
|
|
59
|
-
それもsmartにしたいよね.
|
|
60
|
-
newでは後ろにoptionがあって,#{temp_dir}での作成とできるが,
|
|
61
|
-
これをその他のoptionsでやるのは難しそう.
|
|
62
|
-
</p>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div id="outline-container-orgab3a666" class="outline-3">
|
|
66
|
-
<h3 id="orgab3a666"><span class="section-number-3">2.1.</span> 解決!!</h3>
|
|
67
|
-
<div class="outline-text-3" id="text-2-1">
|
|
68
|
-
<p>
|
|
69
|
-
Arubaだけの問題なので,テストの時用にhelp_dirを
|
|
70
|
-
Thorのoptionとして引けるようにした.
|
|
71
|
-
</p>
|
|
72
|
-
<div class="org-src-container">
|
|
73
|
-
<pre class="src src-ruby"><span class="linenr"> 1: </span> desc <span style="color: #8b7355;">"list [HELP] [ITEM]"</span>, <span style="color: #8b7355;">"list helps"</span>
|
|
74
|
-
<span class="linenr"> 2: </span> option <span style="color: #6e8b3d;">:help_dir</span>, <span style="color: #6e8b3d;">:type</span> => <span style="color: #6e8b3d;">:string</span>
|
|
75
|
-
<span class="linenr"> 3: </span> <span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">use method_options [[https://github.com/rails/thor/wiki/Method-Options]]</span>
|
|
76
|
-
<span class="linenr"> 4: </span> <span style="color: #1c86ee;">def</span> <span style="color: #cd9b1d;">list</span>(*args)
|
|
77
|
-
<span class="linenr"> 5: </span> config = get_config(args).config
|
|
78
|
-
<span class="linenr"> 6: </span> help_dir = options[<span style="color: #8b7355;">"help_dir"</span>] || config[<span style="color: #6e8b3d;">:local_help_dir</span>]
|
|
79
|
-
<span class="linenr"> 7: </span> <span style="color: #cd6600;">puts</span> <span style="color: #00688b;">List</span>.new(help_dir,
|
|
80
|
-
<span class="linenr"> 8: </span> config[<span style="color: #6e8b3d;">:ext</span>]).list(*args.join(<span style="color: #8b7355;">" "</span>))
|
|
81
|
-
<span class="linenr"> 9: </span> <span style="color: #1c86ee;">end</span>
|
|
82
|
-
<span class="linenr">10: </span>...
|
|
83
|
-
<span class="linenr">11: </span> context <span style="color: #8b7355;">"list command"</span> <span style="color: #1c86ee;">do</span>
|
|
84
|
-
<span class="linenr">12: </span> temp_dir = <span style="color: #00688b;">Dir</span>.pwd
|
|
85
|
-
<span class="linenr">13: </span> let(<span style="color: #6e8b3d;">:help_name</span>) { <span style="color: #8b7355;">"example"</span> }
|
|
86
|
-
<span class="linenr">14: </span> let(<span style="color: #6e8b3d;">:help_dir</span>) { <span style="color: #00688b;">File</span>.join(temp_dir, <span style="color: #8b7355;">"lib"</span>, <span style="color: #8b7355;">"templates"</span>) }
|
|
87
|
-
<span class="linenr">15: </span>
|
|
88
|
-
<span class="linenr">16: </span> it <span style="color: #8b7355;">"list with name"</span> <span style="color: #1c86ee;">do</span>
|
|
89
|
-
<span class="linenr">17: </span> run_command(<span style="color: #8b7355;">"my_help list </span><span style="color: #2e8b57;">#{help_name}</span><span style="color: #8b7355;"> a_item --help_dir=</span><span style="color: #2e8b57;">#{help_dir}</span><span style="color: #8b7355;">"</span>)
|
|
90
|
-
<span class="linenr">18: </span> stop_all_commands
|
|
91
|
-
<span class="linenr">19: </span> expect(last_command_started).to have_output(<span style="color: #8b7355;">/a_item/</span>)
|
|
92
|
-
<span class="linenr">20: </span> <span style="color: #1c86ee;">end</span>
|
|
93
|
-
<span class="linenr">21: </span> <span style="color: #1c86ee;">end</span>
|
|
94
|
-
<span class="linenr">22: </span>
|
|
95
|
-
</pre>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<div id="outline-container-org18dc25e" class="outline-2">
|
|
102
|
-
<h2 id="org18dc25e"><span class="section-number-2">3.</span> <span class="timestamp-wrapper"><span class="timestamp"><2021-10-18 Mon> </span></span> conf_pathの追加</h2>
|
|
103
|
-
<div class="outline-text-2" id="text-3">
|
|
104
|
-
<p>
|
|
105
|
-
my_help.confの場所を指定するconf_pathをnewで指定できるようにする.
|
|
106
|
-
</p>
|
|
107
|
-
|
|
108
|
-
<div class="org-src-container">
|
|
109
|
-
<pre class="src src-diff"><span class="linenr"> 1: </span><span style="color: #22aa22; background-color: #ddffdd;">></span><span style="background-color: #ddffdd;"> git diff</span>
|
|
110
|
-
<span class="linenr"> 2: </span><span style="background-color: #d9d9d9;">--- </span><span style="background-color: #bfbfbf; font-weight: bold;">a/lib/my_help/my_help_controll.rb</span>
|
|
111
|
-
<span class="linenr"> 3: </span><span style="background-color: #d9d9d9;">+++ </span><span style="background-color: #bfbfbf; font-weight: bold;">b/lib/my_help/my_help_controll.rb</span>
|
|
112
|
-
<span class="linenr"> 4: </span><span style="background-color: #d9d9d9;">@@ -5,13 +5,14 @@</span><span style="background-color: #d9d9d9;"> require 'yaml'</span>
|
|
113
|
-
<span class="linenr"> 5: </span> module MyHelp
|
|
114
|
-
<span class="linenr"> 6: </span> class Control
|
|
115
|
-
<span class="linenr"> 7: </span> attr_accessor :local_help_dir, :editor
|
|
116
|
-
<span class="linenr"> 8: </span><span style="color: #aa2222; background-color: #ffdddd;">-</span><span style="background-color: #ffdddd;"> def initialize()</span>
|
|
117
|
-
<span class="linenr"> 9: </span><span style="color: #22aa22; background-color: #ddffdd;">+</span><span style="background-color: #ddffdd;"> def initialize(</span><span style="background-color: #aaffaa;">conf_path=nil</span><span style="background-color: #ddffdd;">)</span>
|
|
118
|
-
<span class="linenr">10: </span> # for configuration setups
|
|
119
|
-
<span class="linenr">11: </span> # see https://stackoverflow.com/questions/6233124/where-to-place-access-config-file-in-gem
|
|
120
|
-
<span class="linenr">12: </span><span style="color: #aa2222; background-color: #ffdddd;">-</span>
|
|
121
|
-
<span class="linenr">13: </span><span style="color: #22aa22; background-color: #ddffdd;">+</span><span style="background-color: #ddffdd;"> </span><span style="background-color: #aaffaa;">@conf_path = conf_path || ENV['HOME']</span>
|
|
122
|
-
<span class="linenr">14: </span> @template_dir = File.expand_path("../../templates", __FILE__)
|
|
123
|
-
<span class="linenr">15: </span> @exe_dir = File.expand_path("../../exe", __FILE__)
|
|
124
|
-
<span class="linenr">16: </span><span style="color: #aa2222; background-color: #ffdddd;">-</span><span style="background-color: #ffdddd;"> @local_help_dir = File.join(</span><span style="background-color: #ffbbbb;">ENV[</span><span style="background-color: #ffdddd;">'</span><span style="background-color: #ffbbbb;">HOME</span><span style="background-color: #ffdddd;">'</span><span style="background-color: #ffbbbb;">]</span><span style="background-color: #ffdddd;">,'.my_help')</span>
|
|
125
|
-
<span class="linenr">17: </span><span style="color: #22aa22; background-color: #ddffdd;">+</span><span style="background-color: #ddffdd;"> @local_help_dir = File.join(</span><span style="background-color: #aaffaa;">@conf_path,</span><span style="background-color: #ddffdd;"> '</span><span style="background-color: #aaffaa;">.my_help</span><span style="background-color: #ddffdd;">'</span><span style="background-color: #aaffaa;">)</span><span style="background-color: #aaffaa;">
|
|
126
|
-
<span class="linenr">18: </span></span><span style="color: #22aa22; background-color: #aaffaa;">+</span><span style="background-color: #aaffaa;"> @conf_file = File.join(@local_help_dir</span><span style="background-color: #ddffdd;">, '.my_help</span><span style="background-color: #aaffaa;">_conf.yml</span><span style="background-color: #ddffdd;">')</span>
|
|
127
|
-
<span class="linenr">19: </span> @editor = ENV['EDITOR'] || 'emacs' #'code', 'emacs' #'vim' #default editor
|
|
128
|
-
<span class="linenr">20: </span> # @mini_account = File
|
|
129
|
-
<span class="linenr">21: </span> set_help_dir_if_not_exists
|
|
130
|
-
<span class="linenr">22: </span><span style="background-color: #d9d9d9;">@@ -28,9 +29,6 @@</span><span style="background-color: #d9d9d9;"> module MyHelp</span>
|
|
131
|
-
<span class="linenr">23: </span> end
|
|
132
|
-
<span class="linenr">24: </span>
|
|
133
|
-
<span class="linenr">25: </span> def load_conf
|
|
134
|
-
<span class="linenr">26: </span><span style="color: #aa2222; background-color: #ffdddd;">-</span><span style="background-color: #ffdddd;"> file_name = '.my_help_conf.yml'</span>
|
|
135
|
-
<span class="linenr">27: </span><span style="color: #aa2222; background-color: #ffdddd;">-</span><span style="background-color: #ffdddd;"> # @conf_file = File.join(Dir.pwd, file_name)</span>
|
|
136
|
-
<span class="linenr">28: </span><span style="color: #aa2222; background-color: #ffdddd;">-</span><span style="background-color: #ffdddd;"> @conf_file = File.join(@local_help_dir, file_name)</span>
|
|
137
|
-
<span class="linenr">29: </span> begin
|
|
138
|
-
<span class="linenr">30: </span> conf = YAML.load_file(@conf_file)
|
|
139
|
-
<span class="linenr">31: </span> @editor = conf[:editor]
|
|
140
|
-
</pre>
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
<p>
|
|
144
|
-
変更箇所は次の通り.
|
|
145
|
-
</p>
|
|
146
|
-
<ul class="org-ul">
|
|
147
|
-
<li>initializeはconf_pathを受け取るが,指定されてない時はnil</li>
|
|
148
|
-
<li>これを@conf_pathに受け渡すが,defaultをENV['HOME']に指定</li>
|
|
149
|
-
<li>これでデフォルトのconfigurationを変更していく
|
|
150
|
-
やり方は,
|
|
151
|
-
<a href="https://stackoverflow.com/questions/6233124/where-to-place-access-config-file-in-gem">Where to place/access config file in gem?</a>
|
|
152
|
-
を参照する.</li>
|
|
153
|
-
</ul>
|
|
154
|
-
|
|
155
|
-
<p>
|
|
156
|
-
これによってTest::unitでのtest環境独自のmy_help環境を構築することが
|
|
157
|
-
できる.
|
|
158
|
-
</p>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
<div id="outline-container-org2aec50d" class="outline-2">
|
|
163
|
-
<h2 id="org2aec50d"><span class="section-number-2">4.</span> <span class="timestamp-wrapper"><span class="timestamp"><2021-11-08 Mon> </span></span> conf_pathをactivate</h2>
|
|
164
|
-
<div class="outline-text-2" id="text-4">
|
|
165
|
-
<p>
|
|
166
|
-
testが進んできたので,conf_pathをactivateした.
|
|
167
|
-
そのためのテストが必要かも.
|
|
168
|
-
</p>
|
|
169
|
-
|
|
170
|
-
<ol class="org-ol">
|
|
171
|
-
<li>ENV['HOME']で指定した時と...</li>
|
|
172
|
-
<li>pwdで何もない時のoptionsがどうなっている?</li>
|
|
173
|
-
</ol>
|
|
174
|
-
|
|
175
|
-
<div class="org-src-container">
|
|
176
|
-
<pre class="src src-yaml"><span style="color: #2e8b57;">config</span>:
|
|
177
|
-
<span style="color: #2e8b57;">:template_dir</span>: <span style="color: #8b7355;">"/Users/bob/git_hub/my_help/lib/templates"</span>
|
|
178
|
-
<span style="color: #2e8b57;">:local_help_dir</span>: <span style="color: #8b7355;">"/Users/bob/git_hub/my_help/test/.my_help"</span>
|
|
179
|
-
<span style="color: #2e8b57;">:conf_file</span>: <span style="color: #8b7355;">"/Users/bob/git_hub/my_help/test/.my_help/.my_help_conf.yml"</span>
|
|
180
|
-
<span style="color: #2e8b57;">:editor</span>: emacs
|
|
181
|
-
</pre>
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
<div id="outline-container-org20943ec" class="outline-2">
|
|
187
|
-
<h2 id="org20943ec"><span class="section-number-2">5.</span> <span class="timestamp-wrapper"><span class="timestamp"><2021-11-08 Mon> </span></span> bundle exec exe/my_help editでエラー</h2>
|
|
188
|
-
<div class="outline-text-2" id="text-5">
|
|
189
|
-
<div class="org-src-container">
|
|
190
|
-
<pre class="src src-shell">Could not find ffi-1.15.4<span style="color: #1c86ee;"> in</span> any of the sources
|
|
191
|
-
Run <span style="color: #ff00ff;">`bundle install`</span> to install missing gems.
|
|
192
|
-
</pre>
|
|
193
|
-
</div>
|
|
194
|
-
<p>
|
|
195
|
-
とのエラー.
|
|
196
|
-
なんだろう.
|
|
197
|
-
</p>
|
|
198
|
-
|
|
199
|
-
<p>
|
|
200
|
-
さらに,command_lineで呼ぶと,
|
|
201
|
-
</p>
|
|
202
|
-
<pre class="example">
|
|
203
|
-
emacs: standard input is not a tty
|
|
204
|
-
</pre>
|
|
205
|
-
|
|
206
|
-
<p>
|
|
207
|
-
というエラーが出る.これまたなんだろう???
|
|
208
|
-
</p>
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
<div id="postamble" class="status">
|
|
213
|
-
<p class="author">Author: Shigeto R. Nishitani</p>
|
|
214
|
-
<p class="date">Created: 2023-01-05 Thu 15:58</p>
|
|
215
|
-
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
|
|
216
|
-
</div>
|
|
217
|
-
</body>
|
|
218
|
-
</html>
|
data/docs/old_docs/16b_nasu.pdf
DELETED
|
Binary file
|
data/docs/old_docs/17b_oyagi.pdf
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Feature: helpの編集
|
|
2
|
-
|
|
3
|
-
Scenario: help を編集する.
|
|
4
|
-
Given `$ bundle exec bin/my_help_thor list`でnew_helpが存在しない.
|
|
5
|
-
When `$ bundle exec bin/my_help_thor new new_help`を実行する.
|
|
6
|
-
And `$ bundle exec bin/my_help_thor edit new_help`実行して、全ての記述を削除する.
|
|
7
|
-
Then ~/.my_help/new_help.orgが空ファイルである.
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Feature: helpの一覧表示
|
|
2
|
-
|
|
3
|
-
Scenario: help の一覧を表示する
|
|
4
|
-
Given `$ find ~/.my_help -name "*.org" | xargs head -n 1 | grep -v '#+STARTUP: indent nolineimages'`で確認できるhelpがファイルが~/.my_helpに存在する.
|
|
5
|
-
When `$ bundle exec bin/my_help_thor list`を実行する.
|
|
6
|
-
Then ~/.my_helpのファイル名相当の項目がlistに全て存在する.
|
|
Binary file
|
|
Binary file
|