# File lib/rgen/template_language/template_container.rb, line 110 def file(name, indentString=nil) old_output, @output = @output, OutputHandler.new(@indent, indentString || @parent.indentString) begin yield rescue Exception => e processAndRaise(e) end path = "" path += @output_path+"/" if @output_path dirname = File.dirname(path+name) FileUtils.makedirs(dirname) unless File.exist?(dirname) File.open(path+name,"wb") { |f| f.write(@output) } @output = old_output end