my_help 0.4.4 → 0.4.5

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
  SHA1:
3
- metadata.gz: e39311df22368bc26a3e013c3e11aee80f07ec0f
4
- data.tar.gz: 3bac2af4a06ab1576441731fcc7ce628ee695426
3
+ metadata.gz: 238646a581a8b9dde967b519cc3b427197360ef5
4
+ data.tar.gz: b5b1e3c5928c522a3ffad3e2d552978fbf42bf45
5
5
  SHA512:
6
- metadata.gz: b15b61e5e582900f7ee4c4279ba1937baaa13a8500ca2bf19b0d83d8b87bce781a460f6f256224ccaf4119c31851a73221f3b19678257859d6f780788bbffeb4
7
- data.tar.gz: a0961f686628e9e8ec8fbf60a81ab914783994211bcc32cbdde9ffde93ff4b96e10e7befa603d08b4fd5d0c2707a30496f7c38c24f5355becc12dcbbb74a3138
6
+ metadata.gz: 15b0dfcaa41f257f7c96e3b7d4a05a99947d65ac4af0836985aaf6543766be91110569f5fe6fd6947c00368298a685eb6e7423242ef3a49a2a2311fd6f9928c3
7
+ data.tar.gz: 3c5cef68ab442b6dd8fe0398eda9ca33b229718a834d3e114d5bf89e80bcd1b16601558e68d0b25ee6b5dcc7497043e31230f5d525463800657334b70b06e25b
data/.DS_Store CHANGED
Binary file
@@ -1,3 +1,3 @@
1
1
  module MyHelp
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
data/lib/my_help.rb CHANGED
@@ -4,6 +4,7 @@ require "yaml"
4
4
  require "fileutils"
5
5
  require "my_help/version"
6
6
  require "systemu"
7
+ require "colorize"
7
8
 
8
9
  module MyHelp
9
10
  class Command
@@ -39,8 +40,8 @@ module MyHelp
39
40
  }
40
41
  opt.on('-l', '--list', 'list specific helps'){list_helps}
41
42
  opt.on('-e NAME', '--edit NAME', 'edit NAME help(eg test_help)'){|file| edit_help(file)}
42
- opt.on('-i NAME', '--init NAME', 'initialize NAME help(eg test_help).'){|file| init_help(file)}
43
- opt.on('-m', '--make', 'make executables for all helps.'){make_help}
43
+ opt.on('-i NAME', '--init NAME', 'initialize NAME help(eg test_help)'){|file| init_help(file)}
44
+ opt.on('-m', '--make', 'make executables for all helps'){make_help}
44
45
  opt.on('-c', '--clean', 'clean up exe dir.'){clean_exe}
45
46
  opt.on('--install_local','install local after edit helps'){install_local}
46
47
  opt.on('--delete NAME','delete NAME help'){|file| delete_help(file)}
@@ -55,14 +56,26 @@ module MyHelp
55
56
 
56
57
  def delete_help(file)
57
58
  del_files=[]
58
- del_files << File.join(@local_help_dir,file)
59
- exe_dir=File.join(File.expand_path('../..',@default_help_dir),'exe')
60
- del_files << File.join(exe_dir,file)
61
- p del_files << File.join(exe_dir,short_name(file))
62
- print "Are you sure to delete these files?[yes]"
63
- if gets.chomp=='yes' then
64
- del_files.each{|file| FileUtils.rm(file,:verbose=>true)}
65
- end
59
+ del_files << File.join(@local_help_dir,file+'.yml')
60
+ exe_dir=File.join(File.expand_path('../..',@default_help_dir),'exe')
61
+ exe_0_dir='/usr/local/bin'
62
+ del_files << File.join(exe_dir,file)
63
+ del_files << File.join(exe_0_dir,file)
64
+ del_files << File.join(exe_dir,short_name(file))
65
+ del_files << File.join(exe_0_dir,short_name(file))
66
+ del_files.each{|file|
67
+ print "Are you sure to delete "+file.blue+"?[Ynq] ".red
68
+ case gets.chomp
69
+ when 'Y'
70
+ begin
71
+ FileUtils.rm(file,:verbose=>true)
72
+ rescue => error
73
+ puts error.to_s.red
74
+ end
75
+ when 'n' ; next
76
+ when 'q' ; exit
77
+ end
78
+ }
66
79
  end
67
80
 
68
81
  USER_INST_DIR="USER INSTALLATION DIRECTORY:"
@@ -151,13 +164,12 @@ module MyHelp
151
164
  begin
152
165
  help = YAML.load(File.read(file_path))
153
166
  rescue=> eval
154
- p eval
155
- print "\n YAML load error in #{file}."
156
- print " See the line shown above and revise by\n"
157
- print " emacs #{file_path}\n"
167
+ p eval.to_s.red
168
+ print "\n YAML load error in #{file}.".red
169
+ print " Revise it by "+"my_help --edit #{file}\n".red
158
170
  exit
159
171
  end
160
- print " #{file}\t:#{help[:head][0]}\n"
172
+ print " #{file}\t:#{help[:head][0]}\n".blue
161
173
  }
162
174
  end
163
175
  end
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.4.4
4
+ version: 0.4.5
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: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2017-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -261,7 +261,6 @@ files:
261
261
  - my_help_nasu/my_help_nasu/.DS_Store
262
262
  - my_help_nasu/my_help_nasu/my_help_nasu.001.jpeg
263
263
  - my_help_nasu/overview.hiki
264
- - tmp.txt
265
264
  homepage: https://github.com/daddygongon/my_help
266
265
  licenses:
267
266
  - MIT
data/tmp.txt DELETED
@@ -1,2 +0,0 @@
1
- 文字を打つ.文字を打つ.
2
-