Module: Kitchen::Terraform::Configurable

Included in:
Driver::Terraform, Provisioner::Terraform, Verifier::Terraform
Defined in:
lib/kitchen/terraform/configurable.rb

Overview

Refinements to Kitchen::Configurable. This class implements the interface of Kitchen::Configurable which requires the following Reek suppressions: :reek:MissingSafeMethod { exclude: [ finalize_config! ] }

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(configurable_class) ⇒ self

A callback to define the plugin version which is invoked when this module is included in a plugin class.

Returns:

  • (self)


32
33
34
35
# File 'lib/kitchen/terraform/configurable.rb', line 32

def self.included(configurable_class)
  ::Kitchen::Terraform::Version.assign_plugin_version configurable_class: configurable_class
  self
end

Instance Method Details

#finalize_config!(instance) ⇒ self

#finalize_config! invokes the super implementation and then defines the workspace name and version requirement.

Parameters:

  • instance (Kitchen::Instance)

    an associated instance.

Returns:

  • (self)

Raises:

  • (Kitchen::ClientError)

    if the instance is nil.

See Also:

  • Configurable#finalize_config!


43
44
45
46
47
# File 'lib/kitchen/terraform/configurable.rb', line 43

def finalize_config!(instance)
  super instance
  self.version_requirement = ::Gem::Requirement.new ">= 0.11.4", "< 0.13.0"
  self.workspace_name = "kitchen-terraform-#{::Shellwords.escape instance.name}"
end