Class: Kitchen::Terraform::CommandFlag::VarFile

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/terraform/command_flag/var_file.rb

Overview

VarFile is the class of objects which control the locations of configuration variables files.

Instance Method Summary collapse

Constructor Details

#initialize(pathnames:) ⇒ Kitchen::Terraform::CommandFlag::VarFile

#initialize prepares a new instance of the class.

Parameters:

  • pathnames (Array[String])

    the pathnames.



28
29
30
# File 'lib/kitchen/terraform/command_flag/var_file.rb', line 28

def initialize(pathnames:)
  self.pathnames = pathnames
end

Instance Method Details

#to_sString

Returns the backend configuration flag.

Returns:

  • (String)

    the backend configuration flag.



33
34
35
36
37
# File 'lib/kitchen/terraform/command_flag/var_file.rb', line 33

def to_s
  pathnames.map do |path|
    "-var-file=\"#{::Shellwords.shelljoin ::Shellwords.shellsplit path}\""
  end.join " "
end