Skip to content

Instantly share code, notes, and snippets.

@jelder
Created May 14, 2013 21:26
Show Gist options
  • Save jelder/5579690 to your computer and use it in GitHub Desktop.
Save jelder/5579690 to your computer and use it in GitHub Desktop.
My ~/.irbrc
require 'rubygems'
require 'irb/completion'
require 'irb/ext/save-history'
# interactive editor: use vim from within irb
#begin
# require 'interactive_editor'
#rescue LoadError => err
# warn "Couldn't load interactive_editor: #{err}"
#end
# awesome print
begin
require 'awesome_print'
AwesomePrint.irb!
rescue LoadError => err
warn "Couldn't load awesome_print: #{err}"
end
# irb history
IRB.conf[:EVAL_HISTORY] = 1000
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = File::expand_path("~/.irbhistory")
class Object
def interesting_methods
case self.class
when Class
self.public_methods.sort - Object.public_methods
when Module
self.public_methods.sort - Module.public_methods
else
self.public_methods.sort - Object.new.public_methods
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment