Class: Kitchen::Driver::Exec

Inherits:
Base
  • Object
show all
Includes:
ShellOut
Defined in:
lib/kitchen/driver/exec.rb

Overview

Simple driver that runs commands locally. As with the proxy driver, this has no isolation in general.

Instance Attribute Summary

Attributes included from Configurable

#instance

Instance Method Summary collapse

Methods included from ShellOut

#run_command

Methods inherited from Base

#cache_directory, #doctor, #initialize, kitchen_driver_api_version, no_parallel_for, #package

Methods included from Logging

#banner, #debug, #error, #fatal, #info, #warn

Methods included from Configurable

#[], #bourne_shell?, #calculate_path, #config_keys, #diagnose, #diagnose_plugin, included, #name, #powershell_shell?, #remote_path_join, #unix_os?, #verify_dependencies, #windows_os?

Constructor Details

This class inherits a constructor from Kitchen::Driver::Base

Instance Method Details

#create(state) ⇒ Object

Creates an instance.

Parameters:

  • state (Hash)

    mutable instance and driver state

Raises:


45
46
47
48
# File 'lib/kitchen/driver/exec.rb', line 45

def create(state)
  super
  reset_instance(state)
end

#destroy(state) ⇒ Object

Destroys an instance.

Parameters:

  • state (Hash)

    mutable instance and driver state

Raises:


51
52
53
# File 'lib/kitchen/driver/exec.rb', line 51

def destroy(state)
  reset_instance(state)
end

#finalize_config!(instance) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Hack to force using the exec transport when using this driver. If someone comes up with a use case for using the driver with a different transport, please let us know.


38
39
40
41
42
# File 'lib/kitchen/driver/exec.rb', line 38

def finalize_config!(instance)
  super.tap do
    instance.transport = Kitchen::Transport::Exec.new
  end
end