diff options
| author | Jack Nagel | 2012-09-04 23:04:01 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-09-10 16:16:54 -0500 |
| commit | 59d5a246e7d7d86ee3535bc72a2fcef320ae6e90 (patch) | |
| tree | 9a965ff322d59d3ecb739185c626e7091be9fe92 /Library/Homebrew/macos.rb | |
| parent | 95b90837444fb1ceb834b414a265dce3f8216fb1 (diff) | |
| download | brew-59d5a246e7d7d86ee3535bc72a2fcef320ae6e90.tar.bz2 | |
Clean up MacOS version method usage
The MacOS.version? family of methods (other than "leopard?") are poorly
defined and lead to confusing code. Replace them in formulae with more
explicit comparisons.
"MacOS.version" is a special version object that can be compared to
numerics, symbols, and strings using the standard Ruby comparison
methods.
The old methods were moved to compat when the version comparison code
was merged, and they must remain there "forever", but they should not be
used in new code.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/macos.rb')
| -rw-r--r-- | Library/Homebrew/macos.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index a58f980b0..e186760b3 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -1,5 +1,7 @@ module MacOS extend self + # This can be compared to numerics, strings, or symbols + # using the standard Ruby Comparable methods. def version require 'version' MacOSVersion.new(MACOS_VERSION.to_s) @@ -221,7 +223,7 @@ module MacOS extend self def bottles_supported? # We support bottles on all versions of OS X except 32-bit Snow Leopard. - (Hardware.is_64_bit? or not MacOS.snow_leopard?) \ + (Hardware.is_64_bit? or not MacOS.version >= :snow_leopard) \ and HOMEBREW_PREFIX.to_s == '/usr/local' \ and HOMEBREW_CELLAR.to_s == '/usr/local/Cellar' \ end |
