Skip to content

Instantly share code, notes, and snippets.

@kirel
Created March 16, 2011 15:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirel/872687 to your computer and use it in GitHub Desktop.
Save kirel/872687 to your computer and use it in GitHub Desktop.
require "rubygems"
require "wirble"
require "pp"
require 'irb/completion'
require 'hirb'; extend Hirb::Console
Wirble.init
Wirble.colorize
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
# Use the simple prompt if possible.
IRB.conf[:PROMPT_MODE] = :SIMPLE if IRB.conf[:PROMPT_MODE] == :DEFAULT
def logger
@logger ||= Logger.new STDOUT
end
# Log to STDOUT if in Rails
if defined?(ActiveRecord)
require 'logger'
ActiveRecord::Base.logger = logger
end
if defined?(ActiveSupport::Benchmarkable)
include ActiveSupport::Benchmarkable
end
#load File.dirname(FILE) + '/.railsrc' if $0 == 'irb' && ENV['RAILS_ENV']
HASH = {
:bob => 'Marley', :mom => 'Barley',
:gods => 'Harley', :chris => 'Farley'} unless defined?(HASH)
ARRAY = HASH.keys unless defined?(ARRAY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment