Module: Kitchen::CLI::PerformCommand
- Included in:
- Kitchen::CLI, Driver
- Defined in:
- lib/kitchen/cli.rb
Overview
Common module to load and invoke a CLI-implementation agnostic command.
Instance Method Summary collapse
-
#perform(task, command, args = nil, additional_options = {}) ⇒ Object
Perform a CLI subcommand.
Instance Method Details
#perform(task, command, args = nil, additional_options = {}) ⇒ Object
Perform a CLI subcommand.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/kitchen/cli.rb', line 44 def perform(task, command, args = nil, = {}) require "kitchen/command/#{command}" = { :action => task, :help => -> { help(task) }, :config => @config, :shell => shell }.merge() str_const = Thor::Util.camel_case(command) klass = ::Kitchen::Command.const_get(str_const) klass.new(args, , ).call end |