Skip to content

Instantly share code, notes, and snippets.

@koko-u
Created May 14, 2011 23:22
Show Gist options
  • Save koko-u/972750 to your computer and use it in GitHub Desktop.
Save koko-u/972750 to your computer and use it in GitHub Desktop.
rails console で自動的に Hirb.enable する
require 'irb/completion'
require 'pp'
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:PROMPT][:CUSTUME] = {
:PROMPT_I => "%03n:>> ",
:PROMPT_N => "%03n:%i>",
:PROMPT_S => "%03n:>%l ",
:PROMPT_C => "%03n:>> ",
:RETURN => "=> %s\n"
}
IRB.conf[:PROMPT_MODE] = :CUSTUME
if defined? Rails::Console
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveResource::Base.logger = Logger.new(STDOUT)
if defined? Hirb
Hirb.enable
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment