From: Jan Svitok Date: 2006-09-07T03:51:57+09:00 Subject: Re: How to take output of eval into a string? On 9/6/06, James Edward Gray II wrote: > >> b = eval("begin $stdout = StringIO.new; #{a}; $stdout.string; > ensure $stdout = STDOUT end") > > Hope that helps. It helped me at least. I was playing with ERuby (the C version), I wanted mainly to compare its speed to ERB, and this helped me to try this without recompilation. (FYI: for a simple template, eruby seems to take ~1/3 of the ERB time)