I have a file containing substituted variables (#{...}) and I would like to copy it into another file, with the variables substituted by their values.
Here’s what I have
file = File.open(@batch_file_name, "w+")
script=File.open("/runBatch.script","r")
script.each do |line|
file.puts(line)
end
But this is apparently not the right way to do that. Any suggestion ?
Instead of
#{...}in your file use ERB files.