Skip to content

Instantly share code, notes, and snippets.

@xtoddx
Created January 15, 2009 14:57
Show Gist options
  • Save xtoddx/47425 to your computer and use it in GitHub Desktop.
Save xtoddx/47425 to your computer and use it in GitHub Desktop.
require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:SAVE_HISTORY] = 100
if ENV['RAILS_ENV']
rr = IRB.conf[:LOAD_MODULES].detect{|x| x =~ /environment$/}.gsub(/config\/environment$/, '')
IRB.conf[:HISTORY_FILE] = File.join(rr, '.irb_history')
else
IRB.conf[:HISTORY_FILE] = File.join(ENV['HOME'], '.irb_history')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment