diff --git a/.irb_config b/.irb_config deleted file mode 100644 index 6077437004..0000000000 --- a/.irb_config +++ /dev/null @@ -1,8 +0,0 @@ -# Note that we use a non-standard config file name to reduce -# name clashes with other IRB config files like `.irbrc`. - -require 'irb/completion' - -IRB.conf[:SAVE_HISTORY] = 100 -IRB.conf[:HISTORY_FILE] = "#{__dir__}/.irb_history" -IRB.conf[:IRB_NAME] = "brew" diff --git a/Library/Homebrew/brew_irbrc b/Library/Homebrew/brew_irbrc new file mode 100644 index 0000000000..e41311ada7 --- /dev/null +++ b/Library/Homebrew/brew_irbrc @@ -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" diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index dd1c6bf21e..0fef03e89a 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -65,13 +65,13 @@ module Homebrew 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