mirror of
https://github.com/inspec/inspec
synced 2024-11-15 01:17:08 +00:00
22 lines
439 B
Ruby
22 lines
439 B
Ruby
# encoding: utf-8
|
|
# author: Dominik Richter
|
|
# author: Christoph Hartmann
|
|
|
|
class OS < Inspec.resource(1)
|
|
name 'os'
|
|
|
|
# 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
|
|
inspec.backend.os.send(os_family)
|
|
end
|
|
end
|
|
|
|
def [](name)
|
|
inspec.backend.os[name]
|
|
end
|
|
|
|
def to_s
|
|
'Operating System Detection'
|
|
end
|
|
end
|