my_help 1.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.yardoc/checksums +4 -4
  3. data/.yardoc/objects/root.dat +0 -0
  4. data/Gemfile.lock +1 -1
  5. data/README.org +84 -117
  6. data/README_j.org +143 -0
  7. data/Rakefile +20 -1
  8. data/development_memo.org +242 -0
  9. data/lib/my_help/cli.rb +7 -1
  10. data/lib/my_help/config.rb +1 -1
  11. data/lib/my_help/list.rb +5 -3
  12. data/lib/my_help/version.rb +1 -1
  13. data/lib/templates/example.org +3 -5
  14. metadata +4 -37
  15. data/README_en.org +0 -131
  16. data/doc/MyHelp/CLI.html +0 -749
  17. data/doc/MyHelp/Config.html +0 -693
  18. data/doc/MyHelp/Control.html +0 -1127
  19. data/doc/MyHelp/Error.html +0 -124
  20. data/doc/MyHelp/GetConfig.html +0 -196
  21. data/doc/MyHelp/Git.html +0 -291
  22. data/doc/MyHelp/Init.html +0 -449
  23. data/doc/MyHelp/List.html +0 -577
  24. data/doc/MyHelp/Md2Hash.html +0 -632
  25. data/doc/MyHelp/Modify.html +0 -393
  26. data/doc/MyHelp/Org2Hash.html +0 -542
  27. data/doc/MyHelp.html +0 -135
  28. data/doc/Org2Yaml.html +0 -497
  29. data/doc/OrgToYaml.html +0 -497
  30. data/doc/_index.html +0 -230
  31. data/doc/class_list.html +0 -51
  32. data/doc/css/common.css +0 -1
  33. data/doc/css/full_list.css +0 -58
  34. data/doc/css/style.css +0 -497
  35. data/doc/file.README.html +0 -181
  36. data/doc/file_list.html +0 -56
  37. data/doc/frames.html +0 -17
  38. data/doc/index.html +0 -181
  39. data/doc/js/app.js +0 -314
  40. data/doc/js/full_list.js +0 -216
  41. data/doc/js/jquery.js +0 -4
  42. data/doc/method_list.html +0 -451
  43. data/doc/top-level-namespace.html +0 -112
  44. data/pkg/my_help-0.8.6.gem +0 -0
  45. data/pkg/my_help-0.9.0.gem +0 -0
  46. data/pkg/my_help-1.0b.gem +0 -0
  47. data/pkg/my_help-1.0c.gem +0 -0
  48. data/pkg/my_help-1.1.gem +0 -0
  49. data/pkg/my_help-1.1a.gem +0 -0
data/lib/my_help/cli.rb CHANGED
@@ -13,10 +13,14 @@ module MyHelp
13
13
  end
14
14
  end
15
15
 
16
+ package_name 'my_help'
17
+ map "-v" => :version
18
+ map "--version" => :version
19
+
16
20
  desc "version", "show version"
17
21
 
18
22
  def version
19
- puts VERSION
23
+ print "my_help #{VERSION}"
20
24
  end
21
25
 
22
26
  desc "git [pull|push]", "git operations"
@@ -26,6 +30,7 @@ module MyHelp
26
30
 
27
31
  def init(*args)
28
32
  config = get_config # for using methods in Config
33
+
29
34
  #config.ask_default
30
35
  init = Init.new(config)
31
36
  raise "Local help dir exist." if init.help_dir_exist?
@@ -102,5 +107,6 @@ module MyHelp
102
107
  name = $stdin.gets.chomp
103
108
  puts("Hello #{name}.")
104
109
  end
110
+
105
111
  end
106
112
  end
@@ -12,7 +12,7 @@ module MyHelp
12
12
  @config = {
13
13
  template_dir: File.expand_path("../templates", __dir__),
14
14
  local_help_dir: local_help_dir,
15
- conf_file: File.join(local_help_dir, ".my_help_conf.yml"),
15
+ conf_file: File.join(conf_path, ".my_help_conf.yml"),
16
16
  editor: ENV["EDITOR"] || "emacs",
17
17
  ext: ".org",
18
18
  verbose: false,
data/lib/my_help/list.rb CHANGED
@@ -8,7 +8,7 @@ module MyHelp
8
8
  def initialize(path = "", ext = ".org", layer = 1)
9
9
  @path = path
10
10
  @ext = ext
11
- p @layer = layer
11
+ @layer = layer
12
12
  end
13
13
 
14
14
  def list(help_options = "", level = 0)
@@ -34,8 +34,10 @@ module MyHelp
34
34
  Dir.glob(files).inject("") do |out, file|
35
35
  # p [out, file]
36
36
  help_info = read_help(file)
37
- out << "%10s: %s\n" % [help_info[:name],
38
- help_info[:items]["head"].split("\n")[0]]
37
+ head = help_info[:items]["head"] ?
38
+ help_info[:items]["head"].split("\n")[0] :
39
+ ''
40
+ out << "%10s: %s\n" % [help_info[:name], head]
39
41
  end
40
42
  end
41
43
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MyHelp
4
- VERSION = "1.2"
4
+ VERSION = "1.2.3"
5
5
  end
@@ -1,9 +1,7 @@
1
1
  #+STARTUP: indent nolineimages overview
2
- * head
3
- - help_title example
4
- * license
5
- - cc by Shigeto R. Nishitani, 2016-22
2
+ * head: help_title example
3
+ * license: cc by Shigeto R. Nishitani, 2016-23
6
4
  * a_item : item_short_description
7
5
  - content_a
8
6
  * b_item
9
- - content_b
7
+ - content_b
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: '1.2'
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shigeto R. Nishiani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-06 00:00:00.000000000 Z
11
+ date: 2023-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -104,36 +104,9 @@ files:
104
104
  - Gemfile.lock
105
105
  - LICENSE.txt
106
106
  - README.org
107
- - README_en.org
107
+ - README_j.org
108
108
  - Rakefile
109
- - doc/MyHelp.html
110
- - doc/MyHelp/CLI.html
111
- - doc/MyHelp/Config.html
112
- - doc/MyHelp/Control.html
113
- - doc/MyHelp/Error.html
114
- - doc/MyHelp/GetConfig.html
115
- - doc/MyHelp/Git.html
116
- - doc/MyHelp/Init.html
117
- - doc/MyHelp/List.html
118
- - doc/MyHelp/Md2Hash.html
119
- - doc/MyHelp/Modify.html
120
- - doc/MyHelp/Org2Hash.html
121
- - doc/Org2Yaml.html
122
- - doc/OrgToYaml.html
123
- - doc/_index.html
124
- - doc/class_list.html
125
- - doc/css/common.css
126
- - doc/css/full_list.css
127
- - doc/css/style.css
128
- - doc/file.README.html
129
- - doc/file_list.html
130
- - doc/frames.html
131
- - doc/index.html
132
- - doc/js/app.js
133
- - doc/js/full_list.js
134
- - doc/js/jquery.js
135
- - doc/method_list.html
136
- - doc/top-level-namespace.html
109
+ - development_memo.org
137
110
  - exe/my_help
138
111
  - lib/my_help.rb
139
112
  - lib/my_help/cli.rb
@@ -150,12 +123,6 @@ files:
150
123
  - lib/templates/example.md
151
124
  - lib/templates/example.org
152
125
  - my_help.gemspec
153
- - pkg/my_help-0.8.6.gem
154
- - pkg/my_help-0.9.0.gem
155
- - pkg/my_help-1.0b.gem
156
- - pkg/my_help-1.0c.gem
157
- - pkg/my_help-1.1.gem
158
- - pkg/my_help-1.1a.gem
159
126
  - tmp.txt
160
127
  homepage: https://github.com/daddygongon/my_help
161
128
  licenses:
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
-