Move MacOS modules under OS::Mac namespace

Closes Homebrew/homebrew#23138.
This commit is contained in:
Jack Nagel 2013-10-18 12:56:51 -05:00
parent 805472946b
commit 8887fe7606
4 changed files with 355 additions and 339 deletions

View File

@ -1,5 +1,7 @@
require 'hardware'
require 'os/mac/version'
require 'os/mac/xcode'
require 'os/mac/xquartz'
module OS
module Mac
@ -270,6 +272,3 @@ module OS
end
end
end
require 'os/mac/xcode'
require 'os/mac/xquartz'

View File

@ -1,6 +1,7 @@
require 'version'
module MacOS
module OS
module Mac
class Version < ::Version
SYMBOLS = {
:mavericks => '10.9',
@ -36,4 +37,5 @@ module MacOS
to_sym.to_s.split('_').map(&:capitalize).join(' ')
end
end
end
end

View File

@ -1,4 +1,7 @@
module MacOS::Xcode extend self
module OS
module Mac
module Xcode
extend self
V4_BUNDLE_ID = "com.apple.dt.Xcode"
V3_BUNDLE_ID = "com.apple.Xcode"
@ -153,9 +156,11 @@ module MacOS::Xcode extend self
%r{^/Applications/Xcode.app} === prefix
end
end
end
end
module CLT
extend self
module MacOS::CLT extend self
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI"
STANDALONE_PKG_PATH = Pathname.new("/Library/Developer/CommandLineTools")
@ -200,4 +205,6 @@ module MacOS::CLT extend self
return version if version
end
end
end
end
end

View File

@ -1,4 +1,8 @@
module MacOS::XQuartz extend self
module OS
module Mac
module XQuartz
extend self
FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11"
APPLE_BUNDLE_ID = "org.x.X11"
FORGE_PKG_ID = "org.macosforge.xquartz.pkg"
@ -83,9 +87,11 @@ module MacOS::XQuartz extend self
def installed?
!version.nil? && !prefix.nil?
end
end
end
module X11
extend self
module MacOS::X11 extend self
def prefix
MacOS::XQuartz.prefix
end
@ -128,4 +134,6 @@ module MacOS::X11 extend self
def use_sdk?
not (prefix.to_s == '/opt/X11' or MacOS::CLT.installed?)
end
end
end
end