Skip to content

Instantly share code, notes, and snippets.

@avsej
Created April 30, 2010 07:51
Show Gist options
  • Save avsej/384900 to your computer and use it in GitHub Desktop.
Save avsej/384900 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
require 'irb/completion'
require 'hirb'
# Hirb::View.enable
def change_log(stream)
ActiveRecord::Base.logger = Logger.new(stream)
ActiveRecord::Base.clear_active_connections!
end
def show_log
change_log(STDOUT)
end
def hide_log
change_log(nil)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment