Push MacOS.cat logic down into MacOS::Version
This commit is contained in:
parent
3cd1a0e696
commit
49c9097b07
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user