summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genruby.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/genruby.rb b/tools/genruby.rb
index 76300c4..017b200 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -351,9 +351,10 @@ libs.each do |lib|
end
libs.each do |lib|
printf "\033[1;33mgenerate\033[0;0m %-50s\033[0;0m",lib[:outpath]
- outpath = File.join lib_path
- Dir.mkdir File.dirname(outpath) unless File.exists? File.dirname(outpath)
- open(File.join(outpath,lib[:outfile]),'w:utf-8') do |f|
+ outpath = File.join lib_path, lib[:outfile]
+ outdir = File.dirname outpath
+ Dir.mkdir outdir unless File.exists? outdir
+ open(File.join(outpath),'w:utf-8') do |f|
reqs = ( lib[:requires].nil? ? '' : lib[:requires].inject('') {|s,e| s+="\nrequire '#{e}'"})
f << HEADER.gsub(/MNAME/,lib[:modname]).sub(/MY_FCT_PREFIX/,lib[:prefix]).sub(/REQUIRES/,reqs)
f << "#{INDENT}#\n#{INDENT}ffi_lib '#{lib[:lib]}'"