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
|
end
|
||||||
|
|
||||||
def cat
|
def cat
|
||||||
case MacOS.version
|
version.to_sym
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def locate tool
|
def locate tool
|
||||||
|
@ -20,16 +20,20 @@ module MacOS
|
|||||||
super(Version.new(v))
|
super(Version.new(v))
|
||||||
end
|
end
|
||||||
|
|
||||||
def pretty_name
|
def to_sym
|
||||||
case @version
|
case @version
|
||||||
when "10.9" then "Mavericks"
|
when '10.9' then :mavericks
|
||||||
when "10.8" then "Mountain Lion"
|
when '10.8' then :mountain_lion
|
||||||
when "10.7" then "Lion"
|
when '10.7' then :lion
|
||||||
when "10.6" then "Snow Leopard"
|
when '10.6' then :snow_leopard
|
||||||
when "10.5" then "Leopard"
|
when '10.5' then :leopard
|
||||||
when "10.4" then "Tiger"
|
when '10.4' then :tiger
|
||||||
else @version
|
else :dunno
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pretty_name
|
||||||
|
to_sym.to_s.split('_').map(&:capitalize).join(' ')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user