Rakefile in my_help-0.2.0 vs Rakefile in my_help-0.2.1
- old
+ new
@@ -31,11 +31,11 @@
end
}
readme_en="#{basename}.wiki/README_en.md"
readme_ja="#{basename}.wiki/README_ja.md"
if File.exists?(readme_en)
- FileUtils.cp(readme_en,"./README.md",:verbose=>true)
+ FileUtils.cp(readme_en,"./README.md",:verbose=>true)
elsif File.exists?(readme_ja)
FileUtils.cp(readme_ja,"./README.md",:verbose=>true)
FileUtils.cp(readme_ja,"#{basename}.wiki/Home.md",:verbose=>true)
end
end
@@ -50,21 +50,23 @@
end
desc "make own help from lib/daddygongon/files"
task :my_help do
- exe_cont="#!/usr/bin/env ruby\n"
user_name = 'daddygongon'
p entries=Dir.entries(File.join('.','lib',user_name))[2..-1]
entries.each{|file|
p file
+ next if file[0]=='#' or file[-1]=='~'
+ exe_cont="#!/usr/bin/env ruby\n"
p file_name=file.split('_')
target_files = [file, file_name[0][0]+"_"+file_name[1][0]]
p cont_name = File.join('lib',user_name,file)
- exe_cont << "require 'my_help'\n"
- exe_cont << "MyHelp::Command.run('#{cont_name}', ARGV)\n"
+ exe_cont << "require 'specific_help'\n"
+ exe_cont << "help_file = File.expand_path(\"../../#{cont_name}\", __FILE__)\n"
+ exe_cont << "SpecificHelp::Command.run(help_file, ARGV)\n"
target_files.each{|name|
- p ''
+ print "\n"
p target=File.join('exe',name)
File.open(target,'w'){|file|
print exe_cont
file.print exe_cont
}