Menu

Can now specify output files...

In a calling rbx script, you can now specify an output file that way in a Makefile you don't have to constantly redirect the output. For example:

#!/usr/local/bin/ruby -w
require "ruby-tmpl"

templates = ['examples.tmpl','faq.tmpl','index.tmpl',
'reference.tmpl','test-rbx.tmpl']

tmpl = Template.new
tmpl.munge_output = false
tmpl.path = "./tmpl"

templates.each do |file|
tmpl.file = file
html_file = file.sub(/\.tmpl\Z/, '.html')
tmpl.out_file = "./docs/" + html_file
$stdout.print "\t" + File.join(tmpl.path, file) + " -> " + tmpl.out_file + "\n"
tmpl.print()
end

Posted by Sean Chittenden 2001-07-30

Log in to post a comment.