mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
improvement: expose os detector function in os resource
This commit is contained in:
parent
bcde1c6dc7
commit
55e09963c8
1 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,13 @@ module Vulcano::Resources
|
||||||
class OS < Vulcano.resource(1)
|
class OS < Vulcano.resource(1)
|
||||||
name 'os'
|
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
|
||||||
|
vulcano.backend.os.send(os_family)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def [](name)
|
def [](name)
|
||||||
vulcano.backend.os[name]
|
vulcano.backend.os[name]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue