1
0
Fork 0
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:
Nobuyoshi Nakada 2019-06-02 12:06:49 +09:00 committed by aycabta
parent 4fda39fc87
commit a1e6e45341

View file

@ -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