Skip to content

Instantly share code, notes, and snippets.

@havenwood
Last active December 17, 2015 22:39
Show Gist options
  • Save havenwood/5683196 to your computer and use it in GitHub Desktop.
Save havenwood/5683196 to your computer and use it in GitHub Desktop.
Setup your .irbrc settings file to log irb sessions to ~/irb.log.
log_location = File.join ENV['HOME'], 'irb.log'
irbrc = File.join ENV['HOME'], '.irbrc'
irb_logging = %[
at_exit
open '#{log_location}', 'a' do |log|
log << Readline::HISTORY.to_a.join("\n")
end
end
]
open irbrc, 'a' do |conf|
conf << irb_logging
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment