From: Simon Strandgaard Date: 2004-02-10T20:50:02+09:00 Subject: Re: capture stderr On Tue, 10 Feb 2004 20:35:59 +0900, Tietew wrote: > On Tue, 10 Feb 2004 20:20:03 +0900 > In article > [capture stderr] > Simon Strandgaard wrote: > >> I want to temporarily capture stderr output. > > No need to reopen. Just assign StringIO. > > > require 'stringio' > > e = StringIO.new > $stderr = e > warn "hello" > $stderr = STDERR > > p e.string # => "hello\n" > Nice.. this indeed does the same job. Thanks. -- Simon Strandgaard