Skip to content

Instantly share code, notes, and snippets.

@jsmecham
Last active July 16, 2018 19:50
Show Gist options
  • Save jsmecham/7001275 to your computer and use it in GitHub Desktop.
Save jsmecham/7001275 to your computer and use it in GitHub Desktop.
# Save History ---------------------------------------------------------------
require "irb/ext/save-history"
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irbhistory"
# Awesome Print --------------------------------------------------------------
begin
require "awesome_print"
AwesomePrint.irb!
rescue LoadError => err
warn "Couldn't load Awesome Print: #{err}"
end
# Wirble ---------------------------------------------------------------------
begin
require "wirble"
Wirble.init
Wirble.colorize
rescue LoadError => err
warn "Couldn't load Wirble: #{err}"
end
# Bond -----------------------------------------------------------------------
begin
require "bond"
Bond.start readline: :ruby
rescue LoadError => err
warn "Couldn't load Bond: #{err}"
end
# Interactive Editor ---------------------------------------------------------
begin
require "interactive_editor"
rescue LoadError => err
warn "Couldn't load Interactive Editor: #{err}"
end
# Interesting Methods --------------------------------------------------------
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