Created
March 17, 2011 15:49
-
-
Save squarism/874563 to your computer and use it in GitHub Desktop.
My current .irbrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
# load wirble | |
require 'rubygems' | |
require 'wirble' | |
# start wirble (with color) | |
Wirble.init | |
Wirble.colorize | |
# customize the colors a bit | |
colors = Wirble::Colorize.colors.merge({ :string => :dark_gray }) | |
Wirble::Colorize.colors = colors | |
rescue LoadError => err | |
warn "Couldn't load wirble. That might be ok if you're using an RVM gemset. Otherwise, gem install wirble." | |
end | |
begin | |
require 'hirb' | |
Hirb.enable | |
rescue LoadError => err | |
warn "Couldn't load hirb. That might be ok if you're using an RVM gemset. Otherwise, gem install hirb." | |
end | |
IRB.conf[:PROMPT_MODE] = :SIMPLE | |
class Object | |
# Return only the methods not present on basic objects | |
def interesting_methods | |
if self.is_a? Class | |
(self.public_methods - Object.public_methods).sort | |
else | |
if self.is_a? Module | |
(self.public_methods - Module.public_methods).sort | |
else | |
(self.public_methods - Object.new.public_methods).sort | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment