Module: Kitchen::Terraform::ConfigAttribute::Color Abstract

Extended by:
Kitchen::Terraform::ConfigAttributeCacher
Included in:
Driver::Terraform, Verifier::Terraform
Defined in:
lib/kitchen/terraform/config_attribute/color.rb

Overview

This module is abstract.

It must be included by plugin class in order to be used.

The :color configuration attribute is an optional boolean which toggles colored output from the Terraform Client commands.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Kitchen::Terraform::ConfigAttributeCacher

define_cache, extended

Class Method Details

.included(plugin_class) ⇒ void

This method returns an undefined value.

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

Parameters:

  • plugin_class (::Kitchen::Configurable)

    A plugin class.



33
34
35
36
37
38
39
40
# File 'lib/kitchen/terraform/config_attribute/color.rb', line 33

def self.included(plugin_class)
  ::Kitchen::Terraform::ConfigAttributeDefiner
    .new(
      attribute: self,
      schema: ::Kitchen::Terraform::ConfigSchemas::Boolean
    )
    .define plugin_class: plugin_class
end

.to_sym::Symbol

Returns the symbol corresponding to the attribute.

Returns:

  • (::Symbol)

    the symbol corresponding to the attribute.



43
44
45
# File 'lib/kitchen/terraform/config_attribute/color.rb', line 43

def self.to_sym
  :color
end

Instance Method Details

#config_color_default_valueBoolean

The default value depends on the presence of a terminal device associated with the Test Kitchen process.

Returns:

  • (Boolean)

    if a terminal device is associated then true; else false.

See Also:



53
54
55
# File 'lib/kitchen/terraform/config_attribute/color.rb', line 53

def config_color_default_value
  ::Kitchen.tty?
end