# encoding: utf-8 # copyright: 2015, Dominik Richter # author: Dominik Richter # author: Christoph Hartmann require 'inspec/log' module Inspec::DSL def require_controls(id, &block) opts = { profile_id: id, include_all: false, backend: @backend, conf: @conf, dependencies: @dependencies } ::Inspec::DSL.load_spec_files_for_profile(self, opts, &block) end def include_controls(id, &block) opts = { profile_id: id, include_all: true, backend: @backend, conf: @conf, dependencies: @dependencies } ::Inspec::DSL.load_spec_files_for_profile(self, opts, &block) end alias require_rules require_controls alias include_rules include_controls def self.load_spec_files_for_profile(bind_context, opts, &block) dependencies = opts[:dependencies] profile_id = opts[:profile_id] dep_entry = dependencies.list[profile_id] if dep_entry.nil? fail <