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.
This commit is contained in:
parent
88b762f784
commit
d6dd63d1a0
@ -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"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user