5 TEMPLATE = 'templates/variant_template'
6 VARIANT_DIR = 'src/variants'
8 variant = ARGV.shift or exit
9 %w(h cpp).each do |ext|
10 File.open(TEMPLATE + ".#{ext}.erb") do |f|
11 template = ERB.new(f.read)
12 out = File.join(VARIANT_DIR, variant + ".#{ext}")
13 File.open(out, 'w') do |outfile|
14 outfile.write(template.result(binding))
16 puts "generated #{out}"