Last active
February 19, 2016 14:13
-
-
Save pjb3/9166610 to your computer and use it in GitHub Desktop.
Basic Ruby IRB config
This file contains hidden or 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 'irb/completion' | |
# History | |
#require 'irb/ext/save-history' #wirble does history | |
IRB.conf[:PROMPT_MODE] = :SIMPLE | |
IRB.conf[:SAVE_HISTORY] = 100 | |
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" | |
IRB.conf[:AUTO_INDENT] = true | |
# use HIRB if available | |
begin | |
require 'hirb' | |
Hirb::View.enable | |
rescue LoadError => err | |
#warn "No Hirb: #{err}" | |
end | |
# Log Rails and/or ActiveRecord to STDOUT | |
if defined?(Rails) && Rails.respond_to?(:logger=) | |
require 'logger' | |
Rails.logger = Logger.new(STDOUT) | |
end | |
if defined?(ActiveRecord) && ActiveRecord::Base.respond_to?(:logger=) | |
require 'logger' | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment