diff options
Diffstat (limited to 'Library/Homebrew/macos.rb')
| -rw-r--r-- | Library/Homebrew/macos.rb | 22 | 
1 files changed, 14 insertions, 8 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index bb24d7a3c..5c475a72d 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -5,19 +5,25 @@ module MacOS extend self    # This can be compared to numerics, strings, or symbols    # using the standard Ruby Comparable methods.    def version -    Version.new(MACOS_VERSION) +    @version ||= Version.new(MACOS_VERSION)    end    def cat -    # PowerPC builds per processor, not per OS -    return Hardware::CPU.family if Hardware::CPU.type == :ppc +    @cat ||= uncached_cat +  end -    if version == :mountain_lion then :mountain_lion -    elsif version == :lion then :lion -    elsif version == :snow_leopard +  def uncached_cat +    case MacOS.version +    when 10.8 +      :mountain_lion +    when 10.7 +      :lion +    when 10.6        Hardware.is_64_bit? ? :snow_leopard : :snow_leopard_32 -    elsif version == :leopard then :leopard -    else nil +    when 10.5 +      :leopard +    else +      Hardware::CPU.family if Hardware::CPU.type == :ppc      end    end  | 
