Skip to content

Commit

Permalink
Merge pull request #2951 from bfontaine/s/ruby_platform/rbconfig
Browse files Browse the repository at this point in the history
OS: use RbConfig instead of RUBY_PLATFORM
  • Loading branch information
MikeMcQuaid authored Jul 27, 2017
2 parents 5b39768 + d6dd63d commit 0b78a7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Library/Homebrew/os.rb
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down

0 comments on commit 0b78a7f

Please sign in to comment.