2 def initialize(arguments)
6 # generate and write template
7 def generate template, file
8 if file.kind_of? String then # one file
9 write_template(file, ERB.new(load_template(template)).result(binding))
12 write_template(f, ERB.new(load_template(template)).result(binding))
18 def load_template(template)
19 file = File.dirname(__FILE__) + '/templates/' + template + '.rhtml'
20 return IO.readlines(file).join if File.file? file
24 def write_template(file, template)
25 f = File.new(file, File::CREAT|File::RDWR, 0755)