Skip to content

Commit

Permalink
Change history and config file dirs
Browse files Browse the repository at this point in the history
Now both REPL history is written to $HOME.
- Pry: $HOME/.brew_pry_history
- IRB: $HOME/.brew_irb_history

The IRB config file has also been moved to the
library directory.
  • Loading branch information
apainintheneck committed Mar 8, 2023
1 parent 9f7ab25 commit deabd4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 0 additions & 8 deletions .irb_config

This file was deleted.

9 changes: 9 additions & 0 deletions Library/Homebrew/brew_irbrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Note: that we use a non-standard config file name to reduce
# name clashes with other IRB config files like `.irbrc`.
# Note #2: This doesn't work with system Ruby for some reason.

require 'irb/completion'

IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{Dir.home}/.brew_irb_history"
IRB.conf[:IRB_NAME] = "brew"
4 changes: 2 additions & 2 deletions Library/Homebrew/dev-cmd/irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def irb
ohai "Interactive Homebrew Shell", "Example commands available with: `brew irb --examples`"
if args.pry?
Pry.config.should_load_rc = false # skip loading .pryrc
Pry.config.history_file = (HOMEBREW_REPOSITORY/".pry_history").to_s
Pry.config.history_file = "#{Dir.home}/.brew_pry_history"
Pry.config.memory_size = 100 # max lines to save to history file
Pry.config.prompt_name = "brew"

Pry.start
else
ENV["IRBRC"] = (HOMEBREW_REPOSITORY/".irb_config").to_s
ENV["IRBRC"] = (HOMEBREW_LIBRARY_PATH/"brew_irbrc").to_s

IRB.start
end
Expand Down

0 comments on commit deabd4a

Please sign in to comment.