aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/input-method.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-04-28 17:06:43 +0900
committeraycabta <aycabta@gmail.com>2020-04-29 19:13:14 +0900
commit3864fbc6d85b834be4567fa1d5bd0dccc4dfd808 (patch)
treea1ce65277028a5179104bb826af9424bd5580c97 /lib/irb/input-method.rb
parent98a346d065cc981d60ec0e45f7f15ba7328b6ad6 (diff)
downloadruby-3864fbc6d85b834be4567fa1d5bd0dccc4dfd808.tar.gz
[ruby/irb] Check existence of rc files in irb_info command
https://github.com/ruby/irb/commit/cdbb9dfc9f
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r--lib/irb/input-method.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index 47fc5db84f..8f337e0eac 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -220,9 +220,11 @@ module IRB
# For debug message
def inspect
- inputrc_path = File.expand_path(ENV['INPUTRC'] || '~/.inputrc')
readline_impl = (defined?(Reline) && Readline == Reline) ? 'Reline' : 'ext/readline'
- "ReadlineInputMethod with #{readline_impl} #{Readline::VERSION} and #{inputrc_path}"
+ str = "ReadlineInputMethod with #{readline_impl} #{Readline::VERSION}"
+ inputrc_path = File.expand_path(ENV['INPUTRC'] || '~/.inputrc')
+ str += " and #{inputrc_path}" if File.exist?(inputrc_path)
+ str
end
end
rescue LoadError
@@ -323,12 +325,14 @@ module IRB
# For debug message
def inspect
config = Reline::Config.new
+ str = "ReidlineInputMethod with Reline #{Reline::VERSION}"
if config.respond_to?(:inputrc_path)
inputrc_path = config.inputrc_path
else
inputrc_path = File.expand_path(ENV['INPUTRC'] || '~/.inputrc')
end
- "ReidlineInputMethod with Reline #{Reline::VERSION} and #{inputrc_path}"
+ str += " and #{inputrc_path}" if File.exist?(inputrc_path)
+ str
end
end
end