my_help 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fbe3cc902e69de5a60eaeaa7d14dd022d9e62762c8a49614a196e1ee5140e7b
4
- data.tar.gz: 007a657cf27a611ff2283ad3d06646663623f87a42c4aff01386652b347efbcf
3
+ metadata.gz: be2722814aac663f8eee3f893e414655b4ff7ce165ef3bb6ed66f39701bad9e3
4
+ data.tar.gz: c1981f69301b87f72940108c6de17366cb28993ce2bcd46467cf336a2f9e3d77
5
5
  SHA512:
6
- metadata.gz: 29765172ae78544814be3103168a972456dbaf7db01a53b0587db7c90e6d9cf5352f3be5dd7a064b94e5c9450b55bab2dd5f988c8c50d2fe1eca5462c11e6582
7
- data.tar.gz: 45abc775d1b7099f640e52123ff6f851f338e8cb47b5a3645eb67a4ba059284238dc51cad0d371c6a2da875ed8a17dcf034fe74341b45925e4d7a7284de04e6d
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
@@ -31,13 +29,6 @@ module MyHelp
31
29
  def add_defaults
32
30
  puts "Adding defaults org files in .my_help"
33
31
  config = get_config
34
- if config[:template_dir] !=
35
- File.expand_path("../templates", __dir__)
36
- puts "inconsistency for :template_dir"
37
- config.configure(:template_dir=>
38
- File.expand_path("../templates", __dir__))
39
- config.save_config
40
- end
41
32
  help_dir = options["help_dir"] || config[:local_help_dir]
42
33
  p current_orgs = Dir.glob(File.join(help_dir, "*.org")).
43
34
  map!{|f| File.basename(f)}
@@ -103,7 +94,7 @@ module MyHelp
103
94
  end
104
95
 
105
96
  desc "new [HELP]", "mk new HELP"
106
-
97
+ map "-n" => :new
107
98
  def new(*args)
108
99
  c = get_config
109
100
  help_name = args[0]
@@ -112,6 +103,21 @@ module MyHelp
112
103
  # puts res.stdout
113
104
  end
114
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
+
115
121
  desc "delete [HELP]", "delete HELP"
116
122
 
117
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.5"
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.5
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