diff options
author | Charles Oliver Nutter <headius@headius.com> | 2019-07-27 14:18:39 +0800 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-08-06 20:03:23 +0900 |
commit | 842364792f03f99f4347d7dbce2a7bd39d1fcc33 (patch) | |
tree | c22b2efe4c6d780bc7510e09f75d8885f9d415ab /lib | |
parent | d626ca1e98d32b67987adb64637a15adf0c977f0 (diff) | |
download | ruby-842364792f03f99f4347d7dbce2a7bd39d1fcc33.tar.gz |
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')
-rw-r--r-- | lib/reline.rb | 2 |
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 |