Last active
July 16, 2018 19:50
-
-
Save jsmecham/7001275 to your computer and use it in GitHub Desktop.
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
# | |
# 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