mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
d626ca1e98
commit
842364792f
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue