Created
March 16, 2011 15:39
-
-
Save kirel/872687 to your computer and use it in GitHub Desktop.
This file contains 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
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