lib/inspec/dsl.rb
# Support for Outer Profile DSL plugins
# This is called when an unknown method is encountered
# "bare" in a control file - outside of a control or describe block.
Support for Outer Profile DSL plugins
This is called when an unknown method is encountered
"bare" in a control file - outside of a control or describe block.
Support for Outer Profile DSL plugins This is called when an unknown method is encountered " bare " in a control file - outside of a control or describe block .
def method_missing(method_name, *arguments, &block)
    registry = Inspec::Plugin::V2::Registry.instance
    hook = registry.find_activators(plugin_type: :outer_profile_dsl, activator_name: method_name).first
    if hook
      hook.activate
      self.class.include(hook.implementation_class)
      send(method_name, *arguments, &block)
    else
      super
    end
  end
def method_missing ( method_name , * arguments , & block ) registry = Inspec :: Plugin :: V2 :: Registry . instance hook = registry . find_activators ( plugin_type : :outer_profile_dsl , activator_name : method_name ) . first if hook hook . activate self . class . include ( hook . implementation_class ) send ( method_name , * arguments , & block ) else super end end
Support for Outer Profile DSL plugins
This is called when an unknown method is encountered
"bare" in a control file - outside of a control or describe block.
Support for Outer Profile DSL plugins This is called when an unknown method is encountered " bare " in a control file - outside of a control or describe block .
# Check to see if there is a outer_profile_dsl plugin activator hook with the method name # OK, load the hook if it hasn't been already.  We'll then know a module, # which we can then inject into the context # Inject the module's methods into the context # implementation_class is the field name, but this is actually a module. # Now that the module is loaded, it defined one or more methods # (presumably the one we were looking for.) # We still haven't called it, so do so now.
method_name
arguments
block