Avoid comparing MacOS.version to floats

This commit is contained in:
Jack Nagel 2013-10-22 20:47:37 -05:00
parent 6030695bee
commit df824a22a7
5 changed files with 9 additions and 9 deletions

View File

@ -193,7 +193,7 @@ end
def check_xcode_clt def check_xcode_clt
if MacOS::Xcode.installed? if MacOS::Xcode.installed?
__check_xcode_up_to_date __check_xcode_up_to_date
elsif MacOS.version >= 10.7 elsif MacOS.version >= "10.7"
__check_clt_up_to_date __check_clt_up_to_date
else <<-EOS.undent else <<-EOS.undent
Xcode not installed Xcode not installed
@ -225,7 +225,7 @@ def __check_clt_up_to_date
end end
def check_for_osx_gcc_installer def check_for_osx_gcc_installer
if (MacOS.version < 10.7 || MacOS::Xcode.version < "4.1") && \ if (MacOS.version < "10.7" || MacOS::Xcode.version < "4.1") && \
MacOS.clang_version == "2.1" then <<-EOS.undent MacOS.clang_version == "2.1" then <<-EOS.undent
You have osx-gcc-installer installed. You have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer, and it is known to cause Homebrew doesn't support osx-gcc-installer, and it is known to cause

View File

@ -33,21 +33,21 @@ module OS
end end
def leopard? def leopard?
version == 10.5 version == "10.5"
end end
def snow_leopard? def snow_leopard?
version >= 10.6 version >= "10.6"
end end
alias_method :snow_leopard_or_newer?, :snow_leopard? alias_method :snow_leopard_or_newer?, :snow_leopard?
def lion? def lion?
version >= 10.7 version >= "10.7"
end end
alias_method :lion_or_newer?, :lion? alias_method :lion_or_newer?, :lion?
def mountain_lion? def mountain_lion?
version >= 10.8 version >= "10.8"
end end
alias_method :mountain_lion_or_newer?, :mountain_lion? alias_method :mountain_lion_or_newer?, :mountain_lion?

View File

@ -30,7 +30,7 @@ module OS
when "10.9" then "5.0.1" when "10.9" then "5.0.1"
else else
# Default to newest known version of Xcode for unreleased OSX versions. # Default to newest known version of Xcode for unreleased OSX versions.
if MacOS.version > 10.9 if MacOS.version > "10.9"
"5.0.1" "5.0.1"
else else
raise "Mac OS X '#{MacOS.version}' is invalid" raise "Mac OS X '#{MacOS.version}' is invalid"

View File

@ -138,7 +138,7 @@ def curl *args
args = [HOMEBREW_CURL_ARGS, HOMEBREW_USER_AGENT, *args] args = [HOMEBREW_CURL_ARGS, HOMEBREW_USER_AGENT, *args]
# See https://github.com/mxcl/homebrew/issues/6103 # See https://github.com/mxcl/homebrew/issues/6103
args << "--insecure" if MacOS.version < 10.6 args << "--insecure" if MacOS.version < "10.6"
args << "--verbose" if ENV['HOMEBREW_CURL_VERBOSE'] args << "--verbose" if ENV['HOMEBREW_CURL_VERBOSE']
args << "--silent" unless $stdout.tty? args << "--silent" unless $stdout.tty?

View File

@ -35,7 +35,7 @@ case HOMEBREW_PREFIX.to_s when '/', '/usr'
# it may work, but I only see pain this route and don't want to support it # it may work, but I only see pain this route and don't want to support it
abort "Cowardly refusing to continue at this prefix: #{HOMEBREW_PREFIX}" abort "Cowardly refusing to continue at this prefix: #{HOMEBREW_PREFIX}"
end end
if OS.mac? and MacOS.version < 10.5 if OS.mac? and MacOS.version < "10.5"
abort <<-EOABORT.undent abort <<-EOABORT.undent
Homebrew requires Leopard or higher. For Tiger support, see: Homebrew requires Leopard or higher. For Tiger support, see:
https://github.com/mistydemeo/tigerbrew https://github.com/mistydemeo/tigerbrew