Skip to content

Instantly share code, notes, and snippets.

@jlsync
Created February 18, 2011 13:02
Show Gist options
  • Save jlsync/833623 to your computer and use it in GitHub Desktop.
Save jlsync/833623 to your computer and use it in GitHub Desktop.
# load libraries
require 'rubygems'
extras = []
failed = []
# Wirble is for colors in irb
begin
require 'wirble'
Wirble.init
Wirble.colorize
extras << "Wirble"
rescue LoadError
failed << "Wirble"
end
require 'irb/completion'
#begin
# require 'bond'
# Bond.start
# extras << "Bond"
#rescue LoadError
# failed << "AwesomePrint"
#end
begin
require 'ap'
alias pp ap
AwesomePrint.defaults = { :colors => { :array => :gray } }
extras << "AwesomePrint"
rescue LoadError
failed << "AwesomePrint"
end
# Hirb is for pretty tables with ActiveRecord
begin
require 'hirb'
Hirb.enable
extend Hirb::Console
extras << "Hirb"
rescue LoadError
failed << "Hirb"
end
# interactive editor for "vi" vim command.
begin
require 'interactive_editor'
extras << "interactive_editor"
rescue LoadError
failed << "interactive_editor"
end
puts "\e[1m\e[30mInitiated: #{extras.join(', ')}\e[0m" if extras.any?
puts "\e[31mFailed: #{failed.join(', ')}\e[0m" if failed.any?
# The local_methods is very handy
class Object
def local_methods
(methods - Object.instance_methods).sort
end
end
alias q exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment