Last active
November 25, 2022 00:51
-
-
Save existentialmutt/387659d2593cdc71f8d85ffb35392bdc to your computer and use it in GitHub Desktop.
irbr - record irb history to the file of your choice
This file contains hidden or 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
#!/usr/bin/env ruby | |
# irbr (short for "IRB Recorder") | |
# | |
# Starts an IRB session and appends your history to the specified file | |
# or "scratch.rb" by default | |
# | |
# USAGE irbr.rb output.rb | |
require "irb" | |
file = ARGV.first || "scratch.rb" | |
IRB.conf[:HISTORY_FILE] = file | |
IRB.conf[:SAVE_HISTORY] = 10_000 | |
IRB.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment