Push MacOS.cat logic down into MacOS::Version

This commit is contained in:
Jack Nagel 2013-06-15 19:40:42 -05:00
parent 3cd1a0e696
commit 49c9097b07
2 changed files with 13 additions and 19 deletions

View File

@ -10,17 +10,7 @@ module MacOS extend self
end
def cat
case MacOS.version
when "10.8" then :mountain_lion
when "10.7" then :lion
when "10.6" then :snow_leopard
when "10.5" then :leopard
when "10.4" then :tiger
end
end
def pretty_name
MacOS.version.pretty_name
version.to_sym
end
def locate tool

View File

@ -20,16 +20,20 @@ module MacOS
super(Version.new(v))
end
def pretty_name
def to_sym
case @version
when "10.9" then "Mavericks"
when "10.8" then "Mountain Lion"
when "10.7" then "Lion"
when "10.6" then "Snow Leopard"
when "10.5" then "Leopard"
when "10.4" then "Tiger"
else @version
when '10.9' then :mavericks
when '10.8' then :mountain_lion
when '10.7' then :lion
when '10.6' then :snow_leopard
when '10.5' then :leopard
when '10.4' then :tiger
else :dunno
end
end
def pretty_name
to_sym.to_s.split('_').map(&:capitalize).join(' ')
end
end
end