Class: Kitchen::Terraform::CommandFlag::PluginDir

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

Overview

PluginDir is the class of objects which control the location of the directory which contains plugin binaries.

Instance Method Summary collapse

Constructor Details

#initialize(pathname:) ⇒ Kitchen::Terraform::CommandFlag::PluginDir

#initialize prepares a new instance of the class.

Parameters:

  • pathname (String)

    the pathname of the directory.



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

def initialize(pathname:)
  self.pathname = pathname.to_s
end

Instance Method Details

#to_sString

Returns the plugin directory flag.

Returns:

  • (String)

    the plugin directory flag.



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

def to_s
  if pathname.empty?
    ""
  else
    "-plugin-dir=\"#{::Shellwords.shelljoin ::Shellwords.shellsplit pathname}\""
  end
end