Class: Kitchen::LoginCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/login_command.rb

Overview

Value object to track a shell command that will be passed to Kernel.exec for execution.

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, arguments, options = {}) ⇒ LoginCommand

Constructs a new LoginCommand instance.

Parameters:

  • command (String)

    command

  • arguments (Array)

    array of arguments to the command

  • options (Hash) (defaults to: {})

    options hash, passed to ‘Kernel#exec`

See Also:



40
41
42
43
44
# File 'lib/kitchen/login_command.rb', line 40

def initialize(command, arguments, options = {})
  @command = command
  @arguments = Array(arguments)
  @options = options
end

Instance Attribute Details

#argumentsArray (readonly)

Returns array of arguments to the command.

Returns:

  • (Array)

    array of arguments to the command



29
30
31
# File 'lib/kitchen/login_command.rb', line 29

def arguments
  @arguments
end

#commandString (readonly)

Returns login command.

Returns:

  • (String)

    login command



26
27
28
# File 'lib/kitchen/login_command.rb', line 26

def command
  @command
end

#optionsHash (readonly)

Returns options hash, passed to ‘Kernel#exec`.

Returns:

  • (Hash)

    options hash, passed to ‘Kernel#exec`



32
33
34
# File 'lib/kitchen/login_command.rb', line 32

def options
  @options
end

Instance Method Details

#exec_argsObject



46
47
48
# File 'lib/kitchen/login_command.rb', line 46

def exec_args
  [command, *arguments, options]
end