feature: only_if for profiles added

Signed-off-by: Dominik Richter <dominik@vulcanosec.com>
This commit is contained in:
Dominik Richter 2015-06-21 18:07:35 +02:00
parent cceefa54cf
commit 5d5b945933

View file

@ -27,6 +27,7 @@ end
module Vulcano::DSL
def rule id, opts = {}, &block
return if @skip_profile
__register_rule Vulcano::Rule.new(id, opts, &block)
end
@ -34,6 +35,11 @@ module Vulcano::DSL
__unregister_rule id
end
def only_if &block
return unless block_given?
@skip_profile = !block.()
end
def require_rules id, &block
::Vulcano::DSL.load_spec_files_for_profile self, id, false, &block
end