my_help 0.6.0 → 0.6.1

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: 839a696209b23c64ee3e55a4c2af4efa3079df43
4
- data.tar.gz: 3a23e3580942ed5eba481be1df105bc0c806cb41
3
+ metadata.gz: c13f6d7b2fd61e64e2722bde2a1c0f0d49aa59af
4
+ data.tar.gz: db0c737b6266ee5e8ffef2d2b2cddaad35c31140
5
5
  SHA512:
6
- metadata.gz: df1c06928b11be234f42fab1e875043547eeaa8db7f5ffa6c2979ac557f72fc826b656b3a4728de0b250ff44d3348d564aef4a826478157b093440fa29082b45
7
- data.tar.gz: 17a2637f6727e5bba3e9313a49944bda1b9f4e930b3a9710c39a3b3e34d382f101fb5ba6de62d1144b989a015b2be173da5ea49f0deabec1acac045f2266e01f
6
+ metadata.gz: 309261c3ecc2e6a86fa25fe890a122738150812006f8380c5a39d46beab18324ef3b16982425251ef60562e4f583704f28839986df1dfb37c128461d7a0527ff
7
+ data.tar.gz: 714e9fb5f2771eb1305d57b3eb61501a9e9149220c9f9966dab4770c8e5b8f4db5052d45ea9d7d249cfbe420ebad460bd7ee90bbc02a8903a4a34a886e5f0e2b
data/exe/m_t ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'specific_help'
3
+ help_file = File.join(ENV['HOME'],'.my_help','my_todo.org')
4
+ SpecificHelp::Command.run(help_file, ARGV)
data/exe/o_h ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'specific_help'
3
+ help_file = File.join(ENV['HOME'],'.my_help','org_help.org')
4
+ SpecificHelp::Command.run(help_file, ARGV)
@@ -1,3 +1,3 @@
1
1
  module MyHelp
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
data/lib/my_help.rb CHANGED
@@ -18,6 +18,7 @@ module MyHelp
18
18
  def initialize(argv=[])
19
19
  @argv = argv
20
20
  @template_dir = File.expand_path("../../lib/templates", __FILE__)
21
+ @exe_path = File.expand_path("../../exe", __FILE__)
21
22
  @local_help_dir = File.join(ENV['HOME'],'.my_help')
22
23
  set_help_dir_if_not_exists
23
24
  end
@@ -69,7 +70,7 @@ module MyHelp
69
70
  del_files=[]
70
71
  del_files << File.join(@local_help_dir,file+'.org')
71
72
  exe_dir=File.join(File.expand_path('../..',@template_dir),'exe')
72
- exe_0_dir='/usr/local/bin'
73
+ exe_0_dir= @exe_path
73
74
  del_files << File.join(exe_dir,file)
74
75
  del_files << File.join(exe_0_dir,file)
75
76
  del_files << File.join(exe_dir,short_name(file))
@@ -89,26 +90,17 @@ module MyHelp
89
90
  end
90
91
  end
91
92
 
92
- USER_INST_DIR="USER INSTALLATION DIRECTORY:"
93
- INST_DIR="INSTALLATION DIRECTORY:"
94
93
  def install_local
95
- Dir.chdir(File.expand_path('../..',@template_dir))
96
- p pwd_dir = Dir.pwd
97
- # check that the working dir should not the gem installed dir,
98
- # which destroys itself.
99
- status, stdout, stderr = systemu "gem env|grep '#{USER_INST_DIR}'"
100
- if stdout==""
101
- status, stdout, stderr = systemu "gem env|grep '#{INST_DIR}'"
102
- end
103
- p system_inst_dir = stdout.split(': ')[1].chomp
104
- if pwd_dir == system_inst_dir
105
- puts "Download my_help from github, and using bundle for edit helps\n"
106
- puts "Read README in detail.\n"
107
- exit
94
+ status, stdout = systemu 'gem env gemdir'
95
+ system_inst_dir = stdout.chomp
96
+ local_help_entries.each do |file|
97
+ title = file.split('.')[0]
98
+ [title, short_name(title)].each do |name|
99
+ source = File.join(@exe_path, name)
100
+ target = File.join(system_inst_dir, 'bin', name)
101
+ FileUtils.cp(source, target, verbose: true)
102
+ end
108
103
  end
109
- system "git add -A"
110
- system "git commit -m 'update exe dirs'"
111
- system "Rake install:local"
112
104
  end
113
105
 
114
106
  def short_name(file)
@@ -125,21 +117,22 @@ require 'specific_help'
125
117
  help_file = File.join(ENV['HOME'],'.my_help','#{file}')
126
118
  SpecificHelp::Command.run(help_file, ARGV)
127
119
  EOS
128
- [title, short_name(title)].each{|name|
129
- p target=File.join('exe',name)
120
+ [title, short_name(title)].each do |name|
121
+ p target=File.join(@exe_path, name)
130
122
  File.open(target,'w'){|file| file.print exe_cont}
131
123
  FileUtils.chmod('a+x', target, :verbose => true)
132
- }
124
+ end
133
125
  }
134
126
  install_local
135
127
  end
136
128
 
137
129
  def clean_exe_dir
138
130
  local_help_entries.each{|file|
139
- next if ['emacs_help','e_h','my_help','my_todo'].include?(file)
131
+ next if ['emacs_help.org', 'my_help.org',
132
+ 'my_todo.org', 'org_help.org'].include?(file)
140
133
  file = File.basename(file,'.org')
141
134
  [file, short_name(file)].each{|name|
142
- p target=File.join('exe',name)
135
+ p target=File.join(@exe_path, name)
143
136
  begin
144
137
  FileUtils::Verbose.rm(target)
145
138
  rescue=> eval
@@ -152,7 +145,7 @@ EOS
152
145
  def init_help(file)
153
146
  p target_help=File.join(@local_help_dir,file+'.org')
154
147
  if File::exists?(target_help)
155
- puts "File exists. rm it first to initialize it."
148
+ puts "File exists. --delete it first to initialize it."
156
149
  exit
157
150
  end
158
151
  p template = File.join(@template_dir,'template_help.org')
data/my_help.gemspec CHANGED
@@ -29,11 +29,6 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_development_dependency "bundler", "~> 1.11"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
- # spec.add_development_dependency "minitest", "~> 5.0"
33
- # spec.add_development_dependency "yard"
34
- # spec.add_development_dependency "hiki2md"
35
- # spec.add_development_dependency "rspec", "~> 3.0"
36
- # spec.add_development_dependency "aruba", '~> 1.3.20'
37
32
  spec.add_dependency "systemu"
38
33
  spec.add_dependency "colorize"
39
34
  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.6.0
4
+ version: 0.6.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: 2018-04-05 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,8 +72,10 @@ email:
72
72
  executables:
73
73
  - e_h
74
74
  - emacs_help
75
+ - m_t
75
76
  - my_help
76
77
  - my_todo
78
+ - o_h
77
79
  - org_help
78
80
  extensions: []
79
81
  extra_rdoc_files: []
@@ -476,10 +478,11 @@ files:
476
478
  - docs/yagi/thor_task.ipynb
477
479
  - exe/e_h
478
480
  - exe/emacs_help
481
+ - exe/m_t
479
482
  - exe/my_help
480
483
  - exe/my_todo
484
+ - exe/o_h
481
485
  - exe/org_help
482
- - lib/.#my_help.rb
483
486
  - lib/emacs_help.rb
484
487
  - lib/my_help.rb
485
488
  - lib/my_help/org2yml.rb
data/lib/.#my_help.rb DELETED
@@ -1 +0,0 @@
1
- lib/bob@ShigetonoMacBook.local.98720