Sha256: fbec68e823335f06240bbdb1c2753ee9753eb7630c8cebb1fbe610c588c0a043

Contents?: true

Size: 910 Bytes

Versions: 77

Compression:

Stored size: 910 Bytes

Contents

require "inspec/input_registry"

module Inspec
  # A mixin to provide implementations for the input() DSL methods
  module InputDslHelpers

    # Find or create an input, explicitly named by a profile ID and
    #  input name. Evaluate the input and return the value.
    # @param [String] Profile ID
    # @param [String] Input Name
    # @param [Hash] Input options - see input docs on website
    # @returns [Object] Input value
    def input_with_profile_id(profile_id, input_name, options)
      if options.empty?
        # Simply an access, no event here
        Inspec::InputRegistry.find_or_register_input(input_name, profile_id).value
      else
        options[:priority] = 20
        options[:provider] = :inline_control_code
        evt = Inspec::Input.infer_event(options)
        Inspec::InputRegistry.find_or_register_input(input_name, profile_id, event: evt).value
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 2 rubygems

Version Path
inspec-core-4.52.9 lib/inspec/input_dsl_helpers.rb
inspec-core-4.50.3 lib/inspec/input_dsl_helpers.rb
inspec-core-4.49.0 lib/inspec/input_dsl_helpers.rb
inspec-core-4.46.13 lib/inspec/input_dsl_helpers.rb
inspec-core-4.41.20 lib/inspec/input_dsl_helpers.rb
inspec-core-4.41.2 lib/inspec/input_dsl_helpers.rb
inspec-core-4.38.9 lib/inspec/input_dsl_helpers.rb
inspec-core-4.38.3 lib/inspec/input_dsl_helpers.rb
inspec-core-4.37.30 lib/inspec/input_dsl_helpers.rb
inspec-core-4.37.25 lib/inspec/input_dsl_helpers.rb
inspec-core-4.37.23 lib/inspec/input_dsl_helpers.rb
inspec-core-4.37.20 lib/inspec/input_dsl_helpers.rb
inspec-core-4.37.17 lib/inspec/input_dsl_helpers.rb
inspec-core-4.37.8 lib/inspec/input_dsl_helpers.rb
inspec-core-4.37.0 lib/inspec/input_dsl_helpers.rb
inspec-core-4.36.4 lib/inspec/input_dsl_helpers.rb
inspec-core-4.33.1 lib/inspec/input_dsl_helpers.rb
inspec-core-4.32.0 lib/inspec/input_dsl_helpers.rb
inspec-core-4.31.1 lib/inspec/input_dsl_helpers.rb
inspec-core-4.31.0 lib/inspec/input_dsl_helpers.rb