How do I temporarily redirect stderr in Ruby?

I'd like to temporarily redirect stderr in a Ruby script for the duration of a block, ensuring that I reset it to its original value at the end of the block.

I had trouble finding how to do this in the ruby docs.

43
задан Andrew Grimm 7 April 2011 в 02:05
поделиться