aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat
diff options
context:
space:
mode:
authorJack Nagel2012-07-09 14:58:34 -0500
committerJack Nagel2012-07-25 11:58:01 -0500
commit68fee2a11aa8215e686e9529f466c135716fd7ec (patch)
treef09fde24695f61f622dae5daba26fe12880ef2cf /Library/Homebrew/compat
parent7c80aae8446ebceb9b9d89b7469d9962251bf982 (diff)
downloadhomebrew-68fee2a11aa8215e686e9529f466c135716fd7ec.tar.bz2
Split Xcode and CLT methods into separate modules
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/compat')
-rw-r--r--Library/Homebrew/compat/compatibility.rb30
1 files changed, 28 insertions, 2 deletions
diff --git a/Library/Homebrew/compat/compatibility.rb b/Library/Homebrew/compat/compatibility.rb
index 879042fd4..e14909496 100644
--- a/Library/Homebrew/compat/compatibility.rb
+++ b/Library/Homebrew/compat/compatibility.rb
@@ -137,7 +137,7 @@ class FailsWithLLVM
# latest version we have tested against so we will switch to GCC and
# bump this integer when Xcode 4.3 is released. TODO do that!
if build.to_i >= 2336
- if MacOS.xcode_version < "4.2"
+ if MacOS::Xcode.version < "4.2"
opoo "Formula will not build with LLVM, using GCC"
ENV.gcc
else
@@ -156,7 +156,7 @@ class FailsWithLLVM
that we can update the formula accordingly. Thanks!
EOS
puts
- if MacOS.xcode_version < "4.2"
+ if MacOS::Xcode.version < "4.2"
puts "If it doesn't work you can: brew install --use-gcc"
else
puts "If it doesn't work you can try: brew install --use-clang"
@@ -164,3 +164,29 @@ class FailsWithLLVM
puts
end
end
+
+module MacOS extend self
+ def xcode_folder
+ Xcode.folder
+ end
+
+ def xcode_prefix
+ Xcode.prefix
+ end
+
+ def xcode_installed?
+ Xcode.installed?
+ end
+
+ def xcode_version
+ Xcode.version
+ end
+
+ def clt_installed?
+ CLT.installed?
+ end
+
+ def clt_version?
+ CLT.version
+ end
+end