mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Prefer $INPUTRC over the default in the home
Closes: https://github.com/ruby/ruby/pull/2222
This commit is contained in:
parent
4fda39fc87
commit
a1e6e45341
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@ require 'pathname'
|
|||
class Reline::Config
|
||||
attr_reader :test_mode
|
||||
|
||||
DEFAULT_PATH = Pathname.new(Dir.home).join('.inputrc')
|
||||
DEFAULT_PATH = '~/.inputrc'
|
||||
|
||||
VARIABLE_NAMES = %w{
|
||||
bind-tty-special-chars
|
||||
|
@ -77,8 +77,8 @@ class Reline::Config
|
|||
@key_actors[@keymap_label]
|
||||
end
|
||||
|
||||
def read(file = DEFAULT_PATH)
|
||||
file = ENV['INPUTRC'] if ENV['INPUTRC']
|
||||
def read(file = nil)
|
||||
file ||= File.expand_path(ENV['INPUTRC'] || DEFAULT_PATH)
|
||||
begin
|
||||
if file.respond_to?(:readlines)
|
||||
lines = file.readlines
|
||||
|
|
Loading…
Reference in a new issue