diff --git a/.gitignore b/.gitignore index 05579c2c259bb..1d380aeb76853 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 0000000000000..7fc78a971a958 --- /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 ab45c3a8a8a6c..d74cb36d472c2 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