Skip to content

Instantly share code, notes, and snippets.

@scrooloose
Created October 19, 2009 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save scrooloose/213779 to your computer and use it in GitHub Desktop.
Save scrooloose/213779 to your computer and use it in GitHub Desktop.
make Foo.methods more awesome
require 'rubygems'
require 'looksee/shortcuts'
module Kernel
alias_method :orig_methods, :methods
def methods(*args)
if caller.first =~ /\(irb\):\d+:in `irb_binding'/
lp(self, *args)
else
orig_methods
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment