Brilliant minds think alike. I had finally come to my
senses and realized that I wanted to eval the thing
as a string, so I coded something very similar:
puts eval('"' + template + '"')
At the moment, both idioms produce the same result:
Errors on the quotation marks embedded in the HTML.
So
Eric Armstrong wrote:
I'm reading a file into a string like this:
template = File.open("test.dwt").readlines.join
My hope was to interpolate the #{variables} in the
file with the values defined in the program. The
first attempt didn't work:
puts template
Nor did the second:
puts eval
I'm reading a file into a string like this:
template = File.open("test.dwt").readlines.join
My hope was to interpolate the #{variables} in the
file with the values defined in the program. The
first attempt didn't work:
puts template
Nor did the second:
puts eval(template)
So for me,