irb: save repl history
This enables history for `brew irb` sessions. It saves that history to the repository directory.
This commit is contained in:
parent
11a0ea1833
commit
6ab6d7c8ee
1
.gitignore
vendored
1
.gitignore
vendored
@ -194,6 +194,7 @@
|
|||||||
!/.dockerignore
|
!/.dockerignore
|
||||||
!/.editorconfig
|
!/.editorconfig
|
||||||
!/.gitignore
|
!/.gitignore
|
||||||
|
!/.irb_config
|
||||||
!/.yardopts
|
!/.yardopts
|
||||||
!/.vale.ini
|
!/.vale.ini
|
||||||
!/.shellcheckrc
|
!/.shellcheckrc
|
||||||
|
8
.irb_config
Normal file
8
.irb_config
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# 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"
|
@ -67,6 +67,8 @@ module Homebrew
|
|||||||
if args.pry?
|
if args.pry?
|
||||||
Pry.start
|
Pry.start
|
||||||
else
|
else
|
||||||
|
ENV["IRBRC"] = (HOMEBREW_REPOSITORY/".irb_config").to_s
|
||||||
|
|
||||||
IRB.start
|
IRB.start
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user