From: Gregory Brown Date: 2007-08-13T07:26:24+09:00 Subject: Re: global_variable_set (like instance_variable_set) On 8/12/07, Thomas Hafner wrote: > "Gregory Brown" wrote/schrieb : > > > Are you looking to do this to test a codebase that writes to $stdout > > / $stderr? > > It's rather about using someone else's code. I'd prefer not to modify > it, because otherwise I had to merge every update. Gotcha. IMO, there is no need for the abstraction if it's limited to these two functions. You're only talking about a couple lines of code, and your need for this won't expand much over time, it seems. The helper is certainly useful though and I'd say if you wanted to use eval to shorten it up, go for it, as long as it's not exposed to user input. If you've got a C compiler, the ruby-inline solution is likely safer. That having been said, you don't want to create a Rube Goldberg machine. :) -greg