Skip to content

Instantly share code, notes, and snippets.

Last active November 25, 2022 00:51
What would you like to do?
irbr - record irb history to the file of your choice
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment