Skip to content

Instantly share code, notes, and snippets.

@squarism
Created March 17, 2011 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squarism/874563 to your computer and use it in GitHub Desktop.
Save squarism/874563 to your computer and use it in GitHub Desktop.
My current .irbrc
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