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, I'm wondering how the heck I can do that.
For JRuby, I'll note that C Ruby implementation does
a good job of showing me what it thinks is wrong:
(eval):1: syntax error
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
^
(eval):2: syntax error
<html lang="en">
^
The issue is clearly that eval is looking for code to
execute, and I'm just plumb giving the wrong command.
But that was harder to see with the JRuby implementation:
:-1: (eval):0: syntax error,
expecting end-of-file '\n'
';' kCLASS kMODULE kDEF
(That's a pretty small thing, all things considered. As
I reread my Ruby books, I am astonished by how much work
had to be done to create an implementation. And I seem to
recall that C Ruby gave very similar error messages a year
or two ago. But I thought you'd like to know.)
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email