my_help 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c85de893d1ac9d563a5de5fcd1ec127843e5a9c
4
- data.tar.gz: 2e852f2c0f9db2f5dc8e39c53a18a4abad832281
3
+ metadata.gz: de61e9adad0db138c4d95c42f55c97af928af92e
4
+ data.tar.gz: 7edc1a0e052ff7a02eb9bb989a5d9c2ec34fa5ac
5
5
  SHA512:
6
- metadata.gz: fcf3d32664f69135c8c59cdf360964e8cea96e6c0a74c02144a4e2a077a4c8d009a61779b4380266d92d6301f990702f764f8977dd89fa1418c7ae536ea3cae2
7
- data.tar.gz: b606ba8b83ba316b9011ca3d25a907096f166381c006f4cd5e9ab5dce40d10c5a175abdda76c228dbcb283975ad6a039a56a577c89ae34a8e1d461900e363a19
6
+ metadata.gz: 1a8d9ddf15544917402ea9f43d5bfdb7ffd2141d3499888b4e37cdaff7943851c133fd8d574ab358eb2449c957a276ddabc03188b2d68433a43e89515ae04502
7
+ data.tar.gz: 54b905efdb5a76474595de06c83db99216b3d94e4baeedb7356ec99dadbeb01f096248ca1e4050cbfaa8e73ec614c8da86b0670a1e28f3a57fd4e633b82b5fd2
data/exe/r_h ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'specific_help'
3
+ target_dir = File.join(ENV['HOME'],'.my_help')
4
+ help_file = File.join(target_dir,'ruby_help')
5
+ SpecificHelp::Command.run(help_file, ARGV)
data/exe/ruby_help ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'specific_help'
3
+ target_dir = File.join(ENV['HOME'],'.my_help')
4
+ help_file = File.join(target_dir,'ruby_help')
5
+ SpecificHelp::Command.run(help_file, ARGV)
@@ -0,0 +1,51 @@
1
+ <<<
2
+
3
+ 特殊キー操作
4
+ c-f, controlキーを押しながら 'f'
5
+ M-f, escキーを押した後一度離して'f'
6
+ 操作の中断c-g, 操作の取り消し(Undo) c-x u
7
+
8
+ カーソル移動cursor
9
+ c-f, move Forwrard, 前or右へ
10
+ c-b, move Backwrard, 後or左へ
11
+ c-a, go Ahead of line, 行頭へ
12
+ c-e, go End of line, 行末へ
13
+ c-n, move Next line, 次行へ
14
+ c-p, move Previous line, 前行へ
15
+
16
+ ページ移動page
17
+ c-v, move Vertical, 次のページへ
18
+ M-v, move reversive Vertical,前のページへ
19
+ c-l, centerise Line, 現在行を中心に
20
+ M-<, move Top of file, ファイルの先頭へ
21
+ M->, move Bottom of file, ファイルの最後尾へ
22
+
23
+ ファイル操作file
24
+ c-x c-f, Find file, ファイルを開く
25
+ c-x c-s, Save file, ファイルを保存
26
+ c-x c-w, Write file NAME, ファイルを別名で書き込む
27
+
28
+ 編集操作editor
29
+ c-d, Delete char, 一字削除
30
+ c-k, Kill line, 一行抹消,カット
31
+ c-y, Yank, ペースト
32
+ c-w, Kill region, 領域抹消,カット
33
+ 領域選択は,先頭or最後尾でc-spaceした後,最後尾or先頭へカーソル移動
34
+ c-s, forward incremental Search WORD, 前へWORDを検索
35
+ c-r, Reverse incremental search WORD, 後へWORDを検索
36
+ M-x query-replace WORD1 <ret> WORD2:対話的置換(y or nで可否選択)
37
+
38
+ ウィンドウ操作window
39
+ c-x 2, 2 windows, 二つに分割
40
+ c-x 1, 1 windows, 一つに戻す
41
+ c-x 3, 3rd window sep,縦線分割
42
+ c-x o, Other windows, 次の画面へ移動
43
+
44
+ バッファー操作buffer(すでにopenしてemacsにバッファーされたfile)
45
+ c-x b, show Buffer, バッファのリスト
46
+ c-x c-b, next Buffer, 次のバッファへ移動
47
+
48
+ 終了操作quit
49
+ c-x c-c, Quit emacs, ファイルを保存して終了
50
+ c-z, suspend emacs, 一時停止,fgで復活
51
+ >>>
@@ -0,0 +1,47 @@
1
+ !template_helpの出力結果
2
+
3
+ <<<
4
+ ヘルプのサンプル雛形.
5
+ headに常に表示される内容を記述.
6
+
7
+ 単元
8
+ c-f, move Forwrard, 前or右へ
9
+ フォーマットは自由です.
10
+
11
+ 単元2
12
+ c-f, move Forwrard, 前or右へ
13
+ フォーマットは自由です.
14
+ >>>
15
+
16
+ !template_helpの中身
17
+ helpの実態は~/.my_helpに保存されたYAML形式のfileです.書き方はコメントを参照ください.
18
+
19
+ <<< yaml
20
+ ---
21
+ #start header, which appears every time.
22
+ :head: #never change
23
+ - "ヘルプのサンプル雛形.\n" #describe the contents breafly.
24
+ - " headに常に表示される内容を記述.\n" #head '- ' is necessary
25
+
26
+ # start the first item
27
+ :item: #change snake word
28
+ :opts: #never change
29
+ :short: "-i" #change short option
30
+ :long: "--item" #change long option
31
+ :desc: 単元(item) #describe what for in help list
32
+ :title: "\n単元\n" #describe what for in each help
33
+ :cont: #the following lines are appeared.
34
+ - c-f, move Forwrard, 前or右へ #top ' - ' are necessary for yaml format
35
+ - フォーマットは自由です.
36
+
37
+ # start the second item... and so on.
38
+ :item2:
39
+ :opts:
40
+ :short: "-j"
41
+ :long: "--item2"
42
+ :desc: 単元2(item2)
43
+ :title: "\n単元2\n"
44
+ :cont:
45
+ - c-f, move Forwrard, 前or右へ
46
+ - フォーマットは自由です.
47
+ >>>
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  :head:
3
+ - "emacsのキーバインド\n"
3
4
  - "\n特殊キー操作\n"
4
5
  - " c-f, controlキーを押しながら 'f'\n"
5
6
  - " M-f, escキーを押した後一度離して'f'\n"
@@ -52,7 +53,7 @@
52
53
  :desc: Edit操作
53
54
  :title: |2-
54
55
 
55
- 編集操作editor
56
+ 編集操作edit
56
57
  :cont:
57
58
  - c-d, Delete char, 一字削除
58
59
  - c-k, Kill line, 一行抹消,カット
@@ -82,7 +83,7 @@
82
83
  :desc: Buffer操作
83
84
  :title: |2-
84
85
 
85
- バッファー操作buffer
86
+ バッファー操作buffer(すでにopenしてemacsにバッファーされたfile)
86
87
  :cont:
87
88
  - c-x b, show Buffer, バッファのリスト
88
89
  - c-x c-b, next Buffer, 次のバッファへ移動
@@ -1,17 +1,21 @@
1
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文字下げ
2
+ #start header, which appears every time.
3
+ :head: #never change
4
+ - "ヘルプのサンプル雛形.\n" #describe the contents breafly.
5
+ - " headに常に表示される内容を記述.\n" #head '- ' is necessary
6
+
7
+ # start the first item
8
+ :item: #change snake word
9
+ :opts: #never change
10
+ :short: "-i" #change short option
11
+ :long: "--item" #change long option
12
+ :desc: 単元(item) #describe what for in help list
13
+ :title: "\n単元\n" #describe what for in each help
14
+ :cont: #the following lines are appeared.
15
+ - c-f, move Forwrard, 前or右へ #top ' - ' are necessary for yaml format
16
+ - フォーマットは自由です.
17
+
18
+ # start the second item... and so on.
15
19
  :item2:
16
20
  :opts:
17
21
  :short: "-j"
@@ -1,3 +1,3 @@
1
1
  module MyHelp
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/my_help.rb CHANGED
@@ -4,6 +4,7 @@ require "yaml"
4
4
  require "fileutils"
5
5
  #require "emacs_help/version"
6
6
  require "my_help/version"
7
+ require "systemu"
7
8
  #require "emacs_help"
8
9
 
9
10
  module MyHelp
@@ -22,9 +23,8 @@ module MyHelp
22
23
 
23
24
  def set_help_dir_if_not_exists
24
25
  return if File::exists?(@target_dir)
25
- FileUtils.mkdir_p(@target_dir)
26
- helps =Dir.entries(@source_dir)
27
- helps[2..-1].each{|file|
26
+ FileUtils.mkdir_p(@target_dir, :verbose=>true)
27
+ Dir.entries(@source_dir).each{|file|
28
28
  file_path=File.join(@target_dir,file)
29
29
  next if File::exists?(file_path)
30
30
  FileUtils.cp((File.join(@source_dir,file)),@target_dir,:verbose=>true)
@@ -41,10 +41,9 @@ module MyHelp
41
41
  opt.on('-l', '--list', '個別(specific)ヘルプのList表示.'){list_helps}
42
42
  opt.on('-e NAME', '--edit NAME', 'NAME(例:test_help)をEdit編集.'){|file| edit_help(file)}
43
43
  opt.on('-i NAME', '--init NAME', 'NAME(例:test_help)のtemplateを作成.'){|file| init_help(file)}
44
- opt.on('-m', '--make', 'make and install:local all helps.'){make_help}
44
+ opt.on('-m', '--make', 'make executables for all helps.'){make_help}
45
45
  opt.on('-c', '--clean', 'clean up exe dir.'){clean_exe}
46
46
  opt.on('--install_local','install local after edit helps'){install_local}
47
- # opt.on('--initialize','initialize local help directory'){initialize_local}
48
47
  end
49
48
  begin
50
49
  command_parser.parse!(@argv)
@@ -55,8 +54,16 @@ module MyHelp
55
54
  end
56
55
 
57
56
  def install_local
58
- Dir.chdir(File.expand_path('../..',@target_dir))
59
- p Dir.pwd
57
+ Dir.chdir(File.expand_path('../..',@source_dir))
58
+ p pwd_dir = Dir.pwd
59
+ # check that the working dir should not the gem installed dir
60
+ inst_dir="USER INSTALLATION DIRECTORY:"
61
+ status, stdout, stderr = systemu "gem env|grep '#{inst_dir}'"
62
+ p system_inst_dir = stdout.split(': ')[1].chomp
63
+ if pwd_dir == system_inst_dir
64
+ "download my_help from github, and using bundle for edit helps"
65
+ exit
66
+ end
60
67
  system "git add -A"
61
68
  system "git commit -m 'update exe dirs'"
62
69
  system "Rake install:local"
@@ -95,6 +102,10 @@ module MyHelp
95
102
 
96
103
  def init_help(file)
97
104
  p target_help=File.join(@target_dir,file)
105
+ if File::exists?(target_help)
106
+ puts "File exists. rm it first to initialize it."
107
+ exit
108
+ end
98
109
  p template = File.join(File.dirname(@source_dir),'my_help','template_help')
99
110
  FileUtils::Verbose.cp(template,target_help)
100
111
  end
@@ -107,7 +118,10 @@ module MyHelp
107
118
  def list_helps
108
119
  print "Specific help file:\n"
109
120
  Dir.entries(@target_dir)[2..-1].each{|file|
110
- print " "+file+"\n"
121
+ next if file[0]=='#' or file[-1]=='~'
122
+ file_path=File.join(@target_dir,file)
123
+ help_cont = YAML.load(File.read(file_path))
124
+ print " #{file}\t:#{help_cont[:head][0][0..-1]}"
111
125
  }
112
126
  end
113
127
  end
data/lib/specific_help.rb CHANGED
@@ -40,15 +40,17 @@ module SpecificHelp
40
40
  end
41
41
 
42
42
  def to_hiki
43
- puts '>>>'
43
+ puts '<<<'
44
44
  @help_cont.each_pair{|key,val|
45
- p key,val
46
- # opts = val[:opts]
47
- # puts opts[:short].to_s,opts[:long].to_s,opts[:desc].to_s
48
- items =@help_cont[key]
49
- puts items[:title]
50
- disp(items[:cont])
45
+ if key==:head
46
+ disp(val)
47
+ else
48
+ items =@help_cont[key]
49
+ puts items[:title]
50
+ disp(items[:cont])
51
+ end
51
52
  }
53
+ puts '>>>'
52
54
  end
53
55
 
54
56
  def disp(lines)
data/my_help.gemspec CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "hiki2md"
35
35
  spec.add_development_dependency "mathjax-yard"
36
36
  spec.add_development_dependency "hiki2latex"
37
-
37
+ spec.add_dependency "systemu"
38
38
  end
@@ -0,0 +1,51 @@
1
+ ```
2
+
3
+ 特殊キー操作
4
+ c-f, controlキーを押しながら 'f'
5
+ M-f, escキーを押した後一度離して'f'
6
+ 操作の中断c-g, 操作の取り消し(Undo) c-x u
7
+
8
+ カーソル移動cursor
9
+ c-f, move Forwrard, 前or右へ
10
+ c-b, move Backwrard, 後or左へ
11
+ c-a, go Ahead of line, 行頭へ
12
+ c-e, go End of line, 行末へ
13
+ c-n, move Next line, 次行へ
14
+ c-p, move Previous line, 前行へ
15
+
16
+ ページ移動page
17
+ c-v, move Vertical, 次のページへ
18
+ M-v, move reversive Vertical,前のページへ
19
+ c-l, centerise Line, 現在行を中心に
20
+ M-<, move Top of file, ファイルの先頭へ
21
+ M->, move Bottom of file, ファイルの最後尾へ
22
+
23
+ ファイル操作file
24
+ c-x c-f, Find file, ファイルを開く
25
+ c-x c-s, Save file, ファイルを保存
26
+ c-x c-w, Write file NAME, ファイルを別名で書き込む
27
+
28
+ 編集操作editor
29
+ c-d, Delete char, 一字削除
30
+ c-k, Kill line, 一行抹消,カット
31
+ c-y, Yank, ペースト
32
+ c-w, Kill region, 領域抹消,カット
33
+ 領域選択は,先頭or最後尾でc-spaceした後,最後尾or先頭へカーソル移動
34
+ c-s, forward incremental Search WORD, 前へWORDを検索
35
+ c-r, Reverse incremental search WORD, 後へWORDを検索
36
+ M-x query-replace WORD1 <ret> WORD2:対話的置換(y or nで可否選択)
37
+
38
+ ウィンドウ操作window
39
+ c-x 2, 2 windows, 二つに分割
40
+ c-x 1, 1 windows, 一つに戻す
41
+ c-x 3, 3rd window sep,縦線分割
42
+ c-x o, Other windows, 次の画面へ移動
43
+
44
+ バッファー操作buffer(すでにopenしてemacsにバッファーされたfile)
45
+ c-x b, show Buffer, バッファのリスト
46
+ c-x c-b, next Buffer, 次のバッファへ移動
47
+
48
+ 終了操作quit
49
+ c-x c-c, Quit emacs, ファイルを保存して終了
50
+ c-z, suspend emacs, 一時停止,fgで復活
51
+ ```
@@ -0,0 +1,47 @@
1
+ # template_helpの出力結果
2
+
3
+ ```
4
+ ヘルプのサンプル雛形.
5
+ headに常に表示される内容を記述.
6
+
7
+ 単元
8
+ c-f, move Forwrard, 前or右へ
9
+ フォーマットは自由です.
10
+
11
+ 単元2
12
+ c-f, move Forwrard, 前or右へ
13
+ フォーマットは自由です.
14
+ ```
15
+
16
+ # template_helpの中身
17
+ helpの実態は~/.my_helpに保存されたYAML形式のfileです.書き方はコメントを参照ください.
18
+
19
+ ```yaml
20
+ ---
21
+ #start header, which appears every time.
22
+ :head: #never change
23
+ - "ヘルプのサンプル雛形.\n" #describe the contents breafly.
24
+ - " headに常に表示される内容を記述.\n" #head '- ' is necessary
25
+
26
+ # start the first item
27
+ :item: #change snake word
28
+ :opts: #never change
29
+ :short: "-i" #change short option
30
+ :long: "--item" #change long option
31
+ :desc: 単元(item) #describe what for in help list
32
+ :title: "\n単元\n" #describe what for in each help
33
+ :cont: #the following lines are appeared.
34
+ - c-f, move Forwrard, 前or右へ #top ' - ' are necessary for yaml format
35
+ - フォーマットは自由です.
36
+
37
+ # start the second item... and so on.
38
+ :item2:
39
+ :opts:
40
+ :short: "-j"
41
+ :long: "--item2"
42
+ :desc: 単元2(item2)
43
+ :title: "\n単元2\n"
44
+ :cont:
45
+ - c-f, move Forwrard, 前or右へ
46
+ - フォーマットは自由です.
47
+ ```
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_help
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shigeto R. Nishitani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-06 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: systemu
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: Emulating CUI(CLI) help, an user makes and displays his own helps.
112
126
  email:
113
127
  - shigeto_nishitani@me.com
@@ -117,6 +131,8 @@ executables:
117
131
  - m_h
118
132
  - member_help
119
133
  - my_help
134
+ - r_h
135
+ - ruby_help
120
136
  - t_h
121
137
  - test_help
122
138
  extensions: []
@@ -138,13 +154,16 @@ files:
138
154
  - exe/m_h
139
155
  - exe/member_help
140
156
  - exe/my_help
157
+ - exe/r_h
158
+ - exe/ruby_help
141
159
  - exe/t_h
142
160
  - exe/test_help
143
161
  - hikis/README_en.hiki
144
162
  - hikis/README_ja.hiki
163
+ - hikis/emacs_help.hiki
164
+ - hikis/test_help.hiki
145
165
  - latexes/handout_pre.tex
146
166
  - lib/daddygongon/emacs_help
147
- - lib/daddygongon/test_help
148
167
  - lib/my_help.rb
149
168
  - lib/my_help/template_help
150
169
  - lib/my_help/version.rb
@@ -153,6 +172,8 @@ files:
153
172
  - my_help.wiki/Home.md
154
173
  - my_help.wiki/README_en.md
155
174
  - my_help.wiki/README_ja.md
175
+ - my_help.wiki/emacs_help.md
176
+ - my_help.wiki/test_help.md
156
177
  homepage: https://github.com/daddygongon/my_help
157
178
  licenses:
158
179
  - MIT
@@ -1,39 +0,0 @@
1
- ---
2
- :head:
3
- - "人の名前を覚えるためのメモ\n"
4
- :senior:
5
- :opts:
6
- :short: "-4"
7
- :long: "--senior"
8
- :desc: 4回生
9
- :title: "\n4回生\n"
10
- :cont:
11
- - eringi, sakigits, narita, yamamoto, murakami, nasu, koki, yamane
12
- :junior:
13
- :opts:
14
- :short: "-j"
15
- :long: "--junior"
16
- :desc: 3回生
17
- :title: "\n3回生\n"
18
- :cont:
19
- - 栃木 琢冶 バイク,マグナ
20
- - 丸毛(marumo) 崇史(浅野) メルモちゃん,奈良香芝,サッカー観戦,リバプール
21
- - 辻 脩人(大崎) 大阪,塾のバイト,アニメ,
22
- - 宮下 優理(西谷) 熊本,ジャグリング
23
- - 和田 創熙souki(いのくち) 加古川,バイク,ninja250
24
- - 大八木 利治(北村) 嵐山,野球観戦,ラーメン(極鶏),テニス
25
- - 藤村 尚輝(巳波) 西宮,スマホゲーム
26
- - 影山 八哉(西谷) 川西,サッカー,漫画,ボード
27
- :ruby-kansai:
28
- :opts:
29
- :short: "-r"
30
- :long: "--ruby"
31
- :desc: ruby関西のメンツ
32
- :title: "\nruby関西のメンツ\n"
33
- :cont:
34
- - ひがきさん
35
- - 船原まさお (@steps107)
36
- - 小林慎治 京都大学 大学院情報学研究科EHR
37
- -
38
-
39
-