summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-26 15:11:51 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-26 15:11:51 +0100
commitbe3d6ffb513c621dd21d2fb1c6dfe8413918051f (patch)
tree081e6d6dae03f63a77e6061588c5750d10a2c712 /tools
parentdcbb12157601cfcfc24b1917963194b09c206df7 (diff)
downloadffi-efl-be3d6ffb513c621dd21d2fb1c6dfe8413918051f.zip
ffi-efl-be3d6ffb513c621dd21d2fb1c6dfe8413918051f.tar.gz
tools/genruby.rb: manage subdirectories for native path
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]}'"