my_help 1.2.4 → 1.2.6

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
  SHA256:
3
- metadata.gz: b06e8d56f23cc8689eb899e6482c86873b7292a05d892092ad1d3cef61ecd0e6
4
- data.tar.gz: c0f4996cd89f113485271ee619014a0c62dacc35b47c55df1bc4c521cd7c62d0
3
+ metadata.gz: be2722814aac663f8eee3f893e414655b4ff7ce165ef3bb6ed66f39701bad9e3
4
+ data.tar.gz: c1981f69301b87f72940108c6de17366cb28993ce2bcd46467cf336a2f9e3d77
5
5
  SHA512:
6
- metadata.gz: b8e622e00b261fdf8d38b339fc8ca7ee99dda24615a343ddf9f599fa021551bf82a8e919877690a48f38a8fcddbbc7f3ac605bc72862f38424c61245a7492b3a
7
- data.tar.gz: f269e589de9f3289786be4eb38fa6bd7b177d8cea8030a6b86ef339e2e17532b5be85706ffe707ef4b370b6b3841e9c81df7b302e9e2b6e029248c43a1777271
6
+ metadata.gz: 4602fc0552133a2886b66304aee211172f3b369a0032c0b7d5824ca27bc1ff3d5c4f2efbb645165406980ce15802dfaa1a0c7969f6dda8842e707ab34a10de45
7
+ data.tar.gz: a3b1adcce95d4c61255ca50390754d9e07328024e39b5e69f0d4d298ece483a9fff85db9dd3cb4f924849f807449d7cb8bdd4944ab3e306062ff59c3a4f56e18
data/lib/my_help/cli.rb CHANGED
@@ -15,8 +15,6 @@ module MyHelp
15
15
 
16
16
  package_name 'my_help'
17
17
  map "-v" => :version
18
- map "--version" => :version
19
-
20
18
  desc "version", "show version"
21
19
 
22
20
  def version
@@ -96,7 +94,7 @@ module MyHelp
96
94
  end
97
95
 
98
96
  desc "new [HELP]", "mk new HELP"
99
-
97
+ map "-n" => :new
100
98
  def new(*args)
101
99
  c = get_config
102
100
  help_name = args[0]
@@ -105,6 +103,21 @@ module MyHelp
105
103
  # puts res.stdout
106
104
  end
107
105
 
106
+ desc "place [TEMPLATE]", "place template on cwd"
107
+ map "-p" => :place
108
+ def place(*args)
109
+ config = get_config
110
+ p help_name = File.basename( (args[0] || 'template.org'),
111
+ '.org')
112
+ t_file = File.join('.', help_name+".org")
113
+ if File.exist?(t_file)
114
+ puts "File #{t_file} exists, set file_name."
115
+ else
116
+ FileUtils.cp(File.join(config[:template_dir],'template.org'),
117
+ t_file, verbose: true)
118
+ end
119
+ end
120
+
108
121
  desc "delete [HELP]", "delete HELP"
109
122
 
110
123
  def delete(*args)
@@ -21,8 +21,19 @@ module MyHelp
21
21
  configure_with(@config[:conf_file])
22
22
  # YAML.dump(@config, File.open(@config[:conf_file], 'w'))
23
23
  # no good for multiple testers.
24
+ check_template_dir
24
25
  end
25
26
 
27
+
28
+ def check_template_dir
29
+ temp_path = File.expand_path("../templates", __dir__)
30
+
31
+ if config[:template_dir] != temp_path
32
+ puts "inconsistency for :template_dir"
33
+ config[:template_dir]= temp_path
34
+ save_config
35
+ end
36
+ end
26
37
  # Configure through hash
27
38
  def configure(opts = nil)
28
39
  return if opts == nil
@@ -3,6 +3,7 @@ module MyHelp
3
3
  def get_config #(args)
4
4
  parent_help_dir = options["help_dir"] || ""
5
5
  parent_help_dir = ENV["HOME"] unless File.exist?(parent_help_dir)
6
+ # Forget necessity of these
6
7
  return Config.new(parent_help_dir)
7
8
  end
8
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MyHelp
4
- VERSION = "1.2.4"
4
+ VERSION = "1.2.6"
5
5
  end
@@ -9,33 +9,6 @@
9
9
   - c-g,操作を中断する
10
10
   - c-x u, 直前に行った操作を取り消す
11
11
  * license: cc by Kaede Ogawa & Shigeto R. Nishitani, 2024
12
- * basic
13
- ** 初期
14
- - emacs [FILE]
15
- ** 終了操作
16
- - c-x c-c, ファイルを保存して、Emacsを終了する
17
- - c-z, Emacsを一時停止する, fgで再開する
18
- ** カーソル移動
19
- - c-f, カーソルを1文字前に移動
20
- - c-b, カーソルを1文字後ろに移動
21
- - c-a, 行の先頭に移動
22
- - c-e, 行の末尾に移動
23
- - c-n, 次の行に移動
24
- - c-p, 前の行に移動
25
- - c-v, 次のページに移動
26
- - M-v, 前のページに移動
27
- - c-l, カーソル行を画面の中央に移動(2回目は画面の上端に、3回目は画面の下端に移動する)
28
- - M-<, ファイルの先頭に移動
29
- - M->, ファイルの末尾に移動
30
- ** 編集操作
31
- - c-d, カーソルの右側の1文字を削除
32
- - c-k, カーソル位置から行の末尾までの文字を削除
33
- - c-y, 直前に削除した文字を貼り付け
34
- - c-w, 選択された領域を削除
35
- - 領域選択は、先頭 or 最後尾で c-space した後、最後尾 or 先頭へカーソル移動
36
- - c-s, 前へ WORD を検索
37
- - c-r, 後へ WORD を検索
38
- - M-x query-replace WORD1 <ret> WORD2, 文字列の置換(y or n で可否選択)
39
12
  * カーソル移動
40
13
  - c-f, カーソルを1文字前に移動
41
14
  - c-b, カーソルを1文字後ろに移動
@@ -0,0 +1,9 @@
1
+ #+OPTIONS: ^:{}
2
+ #+STARTUP: indent nolineimages overview num
3
+ #+TITLE: template for org-file
4
+ #+AUTHOR: Shigeto R. Nishitani
5
+ #+EMAIL: (concat "shigeto_nishitani@mac.com")
6
+ #+LANGUAGE: jp
7
+ #+OPTIONS: H:4 toc:t num:2
8
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
9
+
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
4
+ version: 1.2.6
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: 2024-09-26 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -151,6 +151,7 @@ files:
151
151
  - lib/templates/example.org
152
152
  - lib/templates/my_help_j.org
153
153
  - lib/templates/org_j.org
154
+ - lib/templates/template.org
154
155
  - my_help.gemspec
155
156
  - my_help_install.org
156
157
  homepage: https://github.com/daddygongon/my_help