M
Martin DeMello
Redirecting $stderr in irb doesn't work but redirecting
$DEFAULT_OUTPUT does. Can anyone explain why this happens? Also, is
there any clever way to run irb in a thread and then redirect
$DEFAULT_OUTPUT only for that thread?
$ irb
irb(main):001:0> require 'stringio'
=3D> true
irb(main):002:0> $stderr =3D StringIO.new
=3D> #<StringIO:0x9b87698>
irb(main):003:0> hello
NameError: undefined local variable or method `hello' for main:Object
=A0 =A0 =A0 =A0from (irb):3
=A0 =A0 =A0 =A0from /usr/bin/irb:12:in `<main>'
irb(main):004:0> $> =3D StringIO.new
irb(main):005:0> hello
irb(main):006:0>
(Sorry if you're seeing this twice, didn't get any response in
ruby-core so I'm forwarding to ruby-talk)
martin
$DEFAULT_OUTPUT does. Can anyone explain why this happens? Also, is
there any clever way to run irb in a thread and then redirect
$DEFAULT_OUTPUT only for that thread?
$ irb
irb(main):001:0> require 'stringio'
=3D> true
irb(main):002:0> $stderr =3D StringIO.new
=3D> #<StringIO:0x9b87698>
irb(main):003:0> hello
NameError: undefined local variable or method `hello' for main:Object
=A0 =A0 =A0 =A0from (irb):3
=A0 =A0 =A0 =A0from /usr/bin/irb:12:in `<main>'
irb(main):004:0> $> =3D StringIO.new
irb(main):005:0> hello
irb(main):006:0>
(Sorry if you're seeing this twice, didn't get any response in
ruby-core so I'm forwarding to ruby-talk)
martin