Last active
December 17, 2015 22:39
-
-
Save havenwood/5683196 to your computer and use it in GitHub Desktop.
Setup your .irbrc settings file to log irb sessions to ~/irb.log.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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