aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Fontaine2017-07-26 22:26:29 +0200
committerBaptiste Fontaine2017-07-26 22:26:30 +0200
commitd6dd63d1a04cad16d2a6faa17a6d71e4baa8f95f (patch)
tree71f683ec77dc58fa789d2b0c7648cbb292394dda
parent88b762f78447842a6187e0fda49c9493f029cbef (diff)
downloadbrew-d6dd63d1a04cad16d2a6faa17a6d71e4baa8f95f.tar.bz2
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.
-rw-r--r--Library/Homebrew/os.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb
index dae843407..1209028a7 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"]