From be3d6ffb513c621dd21d2fb1c6dfe8413918051f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 26 Feb 2012 15:11:51 +0100 Subject: tools/genruby.rb: manage subdirectories for native path --- tools/genruby.rb | 7 ++++--- 1 file 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]}'" -- cgit v1.1-2-g2b99