Skip to content

Instantly share code, notes, and snippets.

@jsmecham
Last active July 16, 2018 19:50
Show Gist options
  • Save jsmecham/7001275 to your computer and use it in GitHub Desktop.
Save jsmecham/7001275 to your computer and use it in GitHub Desktop.
# Save History -------------------------------------------------------
require "irb/ext/save-history"
IRB.conf[:SAVE_HISTORY] = 200
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
# Awesome Print ------------------------------------------------------
begin
require "awesome_print"
AwesomePrint.irb!
rescue LoadError => err
warn "Couldn't load Awesome Print: #{err}"
end
# Wirble --------------------------------------------------------------
begin
# load and initialize wirble
require "wirble"
Wirble.init
Wirble.colorize
rescue LoadError => err
warn "Couldn't load Wirble: #{err}"
end
# Bond ---------------------------------------------------------------
begin
require "bond"
Bond.start
rescue LoadError => err
warn "Couldn't load Bond: #{err}"
end
# Rails --------------------------------------------------------------
# Show log in Rails console
if defined? Rails
require 'logger'
if Rails.version =~ /^2\./ # Rails 2.3
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
else # Rails 3
ActiveRecord::Base.logger = Logger.new(STDOUT) if defined? ActiveRecord
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment