Timothy Bennett
3/21/2006 12:25:00 AM
On Mar 20, 2006, at 3:13 PM, Michael Hartl wrote:
> I've looked all over, but I can't figure out how to suppress the
> printing of evaluated expressions in irb. Ordinarily, this is no
> problem:
>
> irb(main):001:0> a = []
> => []
>
> But what if the thing returned is huge?
>
> irb(main):001:0> b = function_returning_something_huge
> <disaster>
>
In irb, enter `conf.return_format = ""` That'll turn off all
printing of evaluations in irb, which means you have to use `puts` if
you want to see any results, but it'll avoid your disasters.
You can add 2 methods to your .irbrc if you like, one that clears the
formatting with the line I gave, and one that sets it back to normal
(the default is "=> %s\n"), so that you can switch back and forth
between the two modes easily.
There may be a better solution, but this is all I came up with.
Still, I hope it helps.
Tim