aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-04-25 17:53:43 +0100
committerMike McQuaid2016-05-08 16:51:22 +0100
commitddb576b582ddc801ac702566bacbc2f231fc86af (patch)
tree797a86d0cdd540a5f0b8ad3995abe43aea17f2b9 /Library/Homebrew/os.rb
parentc5520d0050e3a5a9050314daf643b298a5432d67 (diff)
downloadbrew-ddb576b582ddc801ac702566bacbc2f231fc86af.tar.bz2
Add support for testing generic OS.
If the environment variable HOMEBREW_TEST_GENERIC_OS is set ensure that neither Mac nor Linux-specific code is loaded. This allows easier testing of cross-platform code on OS X and will make it easier to port Homebrew to platforms other than OS X and Linux.
Diffstat (limited to 'Library/Homebrew/os.rb')
-rw-r--r--Library/Homebrew/os.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb
index b0d685fa4..63c86b7f4 100644
--- a/Library/Homebrew/os.rb
+++ b/Library/Homebrew/os.rb
@@ -1,6 +1,6 @@
module OS
def self.mac?
- /darwin/i === RUBY_PLATFORM
+ /darwin/i === RUBY_PLATFORM && !ENV["HOMEBREW_TEST_GENERIC_OS"]
end
def self.linux?
@@ -19,9 +19,5 @@ module OS
elsif OS.linux?
ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting"
PATH_OPEN = "xdg-open"
- # compatibility
- ::MACOS_FULL_VERSION = ::MACOS_VERSION = "0"
- else
- raise "Unknown operating system"
end
end