From: uncutstone wu Date: 2006-05-18T04:10:08+09:00 Subject: Re: Capturing stdout Eric Hodel wrote: > On May 17, 2006, at 5:26 AM, Mark Volkmann wrote: >>> $stdout = stdout >> >> # Add a write method to this string object. >> def dest.write(data); self << data; end > > How is this better than using StringIO? IMHO, by using StringIO, you pay for something useless in this case but maybe usefule anywhere else. I mean StringIO has many methods(e.g. read,close,rewind) besides write , but "def dest.write....." has just the function you want. You just pay for what you want. Isn't it better? Best regards, uncutstone -- Posted via http://www.ruby-forum.com/.