From d6dd63d1a04cad16d2a6faa17a6d71e4baa8f95f Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Wed, 26 Jul 2017 22:26:29 +0200 Subject: [PATCH] OS: use RbConfig instead of RUBY_PLATFORM `RUBY_PLATFORM` is always `"java"` when running JRuby, no matter what is the underlying platform. See also https://github.com/pry/pry/issues/386. --- Library/Homebrew/os.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index dae8434070..1209028a73 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -1,12 +1,14 @@ +require "rbconfig" + module OS def self.mac? return false if ENV["HOMEBREW_TEST_GENERIC_OS"] - RUBY_PLATFORM.to_s.downcase.include? "darwin" + RbConfig::CONFIG["host_os"].include? "darwin" end def self.linux? return false if ENV["HOMEBREW_TEST_GENERIC_OS"] - RUBY_PLATFORM.to_s.downcase.include? "linux" + RbConfig::CONFIG["host_os"].include? "linux" end ::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]