From 842364792f03f99f4347d7dbce2a7bd39d1fcc33 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Sat, 27 Jul 2019 14:18:39 +0800 Subject: Use host_os from RbConfig to detect host OS. RUBY_PLATFORM on JRuby is always "java", so it will not reflect the host operating system. This regex appears to be the consensus way to detect Windows based on a search of Ruby code on Github: https://github.com/search?q=%2Fmswin%7Cmsys%7Cmingw%7Ccygwin%7Cbccwin%7Cwince%7Cemc%2F&type=Code --- lib/reline.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/reline.rb') diff --git a/lib/reline.rb b/lib/reline.rb index 5bb47d5d3f..aefcf7a5b5 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -14,7 +14,7 @@ module Reline FILENAME_COMPLETION_PROC = nil USERNAME_COMPLETION_PROC = nil - if RUBY_PLATFORM =~ /mswin|mingw/ + if RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/ IS_WINDOWS = true else IS_WINDOWS = false -- cgit v1.2.3