Skip to content

Instantly share code, notes, and snippets.

@jsmecham
Last active July 16, 2018 19:50
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 jsmecham/7001275 to your computer and use it in GitHub Desktop.
Save jsmecham/7001275 to your computer and use it in GitHub Desktop.
#
# Justin's IRB Configuration
#
# Support User Gems in Bundler-Managed Applications --------------------------
#
# if defined? ::Bundler
# user_gem_paths = Dir.glob("#{Gem.user_dir}/gems/*")
# user_gem_paths.each do |path|
# gem_path = "#{path}/lib"
# $LOAD_PATH << gem_path
# end
# end
# 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