2015-09-20 21:55:00 +00:00
|
|
|
# encoding: utf-8
|
2015-10-06 16:55:44 +00:00
|
|
|
# author: Dominik Richter
|
|
|
|
# author: Christoph Hartmann
|
2015-09-20 21:55:00 +00:00
|
|
|
|
2015-10-12 11:01:58 +00:00
|
|
|
class OS < Vulcano.resource(1)
|
|
|
|
name 'os'
|
2015-09-20 21:55:00 +00:00
|
|
|
|
2015-10-12 11:01:58 +00:00
|
|
|
# reuse helper methods from backend
|
|
|
|
%w{redhat? debian? suse? bsd? solaris? linux? unix? windows?}.each do |os_family|
|
|
|
|
define_method((os_family).to_sym) do
|
|
|
|
vulcano.backend.os.send(os_family)
|
2015-10-07 16:28:34 +00:00
|
|
|
end
|
2015-10-12 11:01:58 +00:00
|
|
|
end
|
2015-10-07 16:28:34 +00:00
|
|
|
|
2015-10-12 11:01:58 +00:00
|
|
|
def [](name)
|
|
|
|
vulcano.backend.os[name]
|
|
|
|
end
|
|
|
|
|
|
|
|
def to_s
|
|
|
|
'Operating System Detection'
|
2015-09-20 21:55:00 +00:00
|
|
|
end
|
|
|
|
end
|