I only had time for a quicky, and here's the result (from my .irbrc):
These hacks are built on this dynamite gem called looksee that gives you a function similar to the various
methods
functions that exist in the ruby core, except the output contains more information and is designed for human readability. Compare these 2 screenshots:Without looksee
With looksee, and my hacks
I practically blew a load in my pants when I saw the output from looksee, since I've frequently been frustrated by the output of
methods
. However, the standard usage of looksee is lp someobject, :some => 'options'
and I don't really want to memorize another function call.
Enter the above code, which intercepts calls to
methods
. If the call is made directly from irb, it is forwarded on to looksee, otherwise the original methods
is called. This is handy as fuck when using irb for debugging and what not, but wont screw with code that uses the standard methods
function.
No comments:
Post a Comment