>>201
これだとどう?

def do_erb(in_file, out_file, bind)
 open(in_file) do |f|
  tmplate = ERB.new(f.read)
  open(out_file, "w") do |dest|
   dest.write(tmplate.result(bind))
  end
 end
end

def make_erb
 text = "Hello, World"
 do_erb "hoge.txt.erb", "hoge.txt", binding
end