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