Skip to content

Instantly share code, notes, and snippets.

@dogeth
Created May 29, 2010 06:36
Show Gist options
  • Save dogeth/418089 to your computer and use it in GitHub Desktop.
Save dogeth/418089 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'hirb'
Hirb::View.enable
if rails_env = ENV['RAILS_ENV']
rails_root = File.basename(Dir.pwd)
IRB.conf[:PROMPT] ||= {}
IRB.conf[:PROMPT][:RAILS] = {
:PROMPT_I => "#{rails_root}> ",
:PROMPT_S => "#{rails_root}* ",
:PROMPT_C => "#{rails_root}? ",
:RETURN => "=> %s\n"
}
IRB.conf[:PROMPT_MODE] = :RAILS
IRB.conf[:IRB_RC] = Proc.new do
ActiveRecord::Base.logger = Logger.new(STDOUT)
end
end
IRB.conf[:SAVE_HISTORY] = 10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment