Skip to content

Instantly share code, notes, and snippets.

@amiel
Created April 28, 2009 18:35
Show Gist options
  • Save amiel/103310 to your computer and use it in GitHub Desktop.
Save amiel/103310 to your computer and use it in GitHub Desktop.
script_console_running = ENV.include?('RAILS_ENV') && IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers')
rails_running = ENV.include?('RAILS_ENV') && !(IRB.conf[:LOAD_MODULES] && IRB.conf[:LOAD_MODULES].include?('console_with_helpers'))
irb_standalone_running = !script_console_running && !rails_running
if script_console_running
require 'logger'
Object.const_set(:RAILS_DEFAULT_LOGGER, Logger.new(STDOUT))
end
IRB.conf[:SAVE_HISTORY] = 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment