os/mac/xcode: fix Rubocop warnings.

This commit is contained in:
Mike McQuaid 2016-09-11 17:49:27 +01:00
parent 00f5aa81f2
commit 8271e35786

View File

@ -3,8 +3,8 @@ module OS
module Xcode
extend self
V4_BUNDLE_ID = "com.apple.dt.Xcode"
V3_BUNDLE_ID = "com.apple.Xcode"
V4_BUNDLE_ID = "com.apple.dt.Xcode".freeze
V3_BUNDLE_ID = "com.apple.Xcode".freeze
def latest_version
case MacOS.version
@ -104,7 +104,7 @@ module OS
#{prefix}/usr/bin/xcodebuild
#{which("xcodebuild")}
].uniq.each do |xcodebuild_path|
if File.executable? xcodebuild_path
next unless File.executable? xcodebuild_path
xcodebuild_output = Utils.popen_read(xcodebuild_path, "-version")
next unless $?.success?
@ -117,7 +117,6 @@ module OS
when "798.0" then return "2.5"
end
end
end
# The remaining logic provides a fake Xcode version for CLT-only
# systems. This behavior only exists because Homebrew used to assume
@ -167,11 +166,11 @@ module OS
module CLT
extend self
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI"
MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables"
MAVERICKS_NEW_PKG_ID = "com.apple.pkg.CLTools_Base" # obsolete
MAVERICKS_PKG_PATH = "/Library/Developer/CommandLineTools"
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo".freeze
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI".freeze
MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables".freeze
MAVERICKS_NEW_PKG_ID = "com.apple.pkg.CLTools_Base".freeze # obsolete
MAVERICKS_PKG_PATH = "/Library/Developer/CommandLineTools".freeze
# Returns true even if outdated tools are installed, e.g.
# tools from Xcode 4.x on 10.9