Module: Kitchen::Driver
- Defined in:
- lib/kitchen/driver.rb,
lib/kitchen/driver/base.rb,
lib/kitchen/driver/dummy.rb,
lib/kitchen/driver/proxy.rb,
lib/kitchen/driver/ssh_base.rb
Overview
A driver is responsible for carrying out the lifecycle activities of an instance, such as creating and destroying an instance.
Defined Under Namespace
Classes: Base, Dummy, Proxy, SSHBase
Constant Summary collapse
- DEFAULT_PLUGIN =
Default driver plugin to use
"dummy".freeze
Class Method Summary collapse
-
.for_plugin(plugin, config) ⇒ Driver::Base
Returns an instance of a driver given a plugin type string.
Class Method Details
.for_plugin(plugin, config) ⇒ Driver::Base
Returns an instance of a driver given a plugin type string.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/kitchen/driver.rb', line 37 def self.for_plugin(plugin, config) first_load = require("kitchen/driver/#{plugin}") str_const = Thor::Util.camel_case(plugin) klass = const_get(str_const) object = klass.new(config) object.verify_dependencies if first_load object rescue UserError raise rescue LoadError, NameError raise ClientError, "Could not load the '#{plugin}' driver from the load path." \ " Please ensure that your driver is installed as a gem or included" \ " in your Gemfile if using Bundler." end |