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
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