mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-16 22:06:43 -06:00
* convert existing Cask:: namespace to Hbc:: * move Homebrew-fork code under Hbc:: * move freestanding classes such as Tty and TopologicalHash under Hbc:: * recast HOMEBREW_CASK_ constants as HBC_ * modify our Homebrew Formula for backward compatibility * devscripts and dev docs
41 lines
933 B
Ruby
41 lines
933 B
Ruby
# originally from Homebrew
|
|
|
|
require 'rubygems'
|
|
|
|
module Hbc::MacOS
|
|
class Release
|
|
include Comparable
|
|
|
|
SYMBOLS = {
|
|
:yosemite => '10.10',
|
|
:mavericks => '10.9',
|
|
:mountain_lion => '10.8',
|
|
:lion => '10.7',
|
|
:snow_leopard => '10.6',
|
|
:leopard => '10.5',
|
|
:tiger => '10.4',
|
|
:panther => '10.3',
|
|
:jaguar => '10.2',
|
|
:puma => '10.1',
|
|
:cheetah => '10.0',
|
|
}
|
|
|
|
def initialize(release)
|
|
@release = Gem::Version.new(release)
|
|
end
|
|
|
|
def <=>(other)
|
|
v = Gem::Version.new(SYMBOLS.fetch(other, other.to_s))
|
|
@release <=> v
|
|
end
|
|
|
|
def to_sym
|
|
@inverted ||= SYMBOLS.invert
|
|
@inverted.fetch(@release.to_s, nil)
|
|
end
|
|
|
|
def to_s
|
|
@release.to_s
|
|
end
|
|
end
|
|
end
|