Skip to content

Instantly share code, notes, and snippets.

@itskingori
Forked from pjb3/.irbrc
Created February 19, 2016 14:13
Show Gist options
  • Save itskingori/a9d63e8cac2c19a93956 to your computer and use it in GitHub Desktop.
Save itskingori/a9d63e8cac2c19a93956 to your computer and use it in GitHub Desktop.
Basic Ruby IRB config
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