From: Tim Becker Date: 2006-05-17T21:33:07+09:00 Subject: Re: Capturing stdout > ###do some magic to get the stdout from this point on into a string All you have to do is assign a different IO Object to the global $stdout variables and Kernel.puts will write to that IO object. The `real` standard out of the process will be available in the STDOUT constant, in case you need definate access to it, though you'd probably want to save a copy of the original value of $stdout, you never know... old_stdout=$stdout $stdout=File.new(...) # # Do a bunch of stuff that shouldn't log to the console # $stdout=old_stdout # everything back to normal... same applies to $stderr STDERR -tim