summaryrefslogtreecommitdiff
path: root/lib/reline.rb
diff options
context:
space:
mode:
authorCharles Oliver Nutter <headius@headius.com>2019-07-27 14:18:39 +0800
committeraycabta <aycabta@gmail.com>2019-08-06 20:03:23 +0900
commit842364792f03f99f4347d7dbce2a7bd39d1fcc33 (patch)
treec22b2efe4c6d780bc7510e09f75d8885f9d415ab /lib/reline.rb
parentd626ca1e98d32b67987adb64637a15adf0c977f0 (diff)
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
Diffstat (limited to 'lib/reline.rb')
-rw-r--r--lib/reline.rb2
1 files changed, 1 insertions, 1 deletions
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