ruby-changes:55960
From: Nobuyoshi <ko1@a...>
Date: Sun, 2 Jun 2019 22:58:42 +0900 (JST)
Subject: [ruby-changes:55960] Nobuyoshi Nakada: a1e6e45341 (trunk): Prefer $INPUTRC over the default in the home
https://git.ruby-lang.org/ruby.git/commit/?id=a1e6e45341 From a1e6e45341d70c608b7b5af98be0f234fd0072fb Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 2 Jun 2019 12:06:49 +0900 Subject: Prefer $INPUTRC over the default in the home Closes: https://github.com/ruby/ruby/pull/2222 diff --git a/lib/reline/config.rb b/lib/reline/config.rb index 6330f77..7c51535 100644 --- a/lib/reline/config.rb +++ b/lib/reline/config.rb @@ -3,7 +3,7 @@ require 'pathname' https://github.com/ruby/ruby/blob/trunk/lib/reline/config.rb#L3 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 https://github.com/ruby/ruby/blob/trunk/lib/reline/config.rb#L77 @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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/