diff --git a/.gitignore b/.gitignore index 05579c2c259bbb..1d380aeb76853e 100644 --- a/.gitignore +++ b/.gitignore @@ -194,6 +194,7 @@ !/.dockerignore !/.editorconfig !/.gitignore +!/.irb_config !/.yardopts !/.vale.ini !/.shellcheckrc diff --git a/.irb_config b/.irb_config new file mode 100644 index 00000000000000..7fc78a971a9588 --- /dev/null +++ b/.irb_config @@ -0,0 +1,11 @@ +# Not that we use a non-standard config file name to reduce +# name clashes with other IRB config files like `.irbrc`. + +require 'irb/completion' + +irb_history = (HOMEBREW_REPOSITORY/".irb_history") + +FileUtils.touch(irb_history) + +IRB.conf[:HISTORY_FILE] = irb_history.to_s +IRB.conf[:SAVE_HISTORY] = 100 diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 011202370308db..eabeb0943e1c3f 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -67,6 +67,8 @@ def irb if args.pry? Pry.start else + ENV["IRBRC"] = (HOMEBREW_REPOSITORY/".irb_config").to_s + IRB.start end end