Module: Polytrix::CLI::PerformCommand
- Included in:
- Polytrix::CLI
- Defined in:
- lib/polytrix/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 scenario subcommand.
Instance Method Details
#perform(task, command, args = nil, additional_options = {}) ⇒ Object
Perform a scenario subcommand.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/polytrix/cli.rb', line 20 def perform(task, command, args = nil, = {}) require "polytrix/command/#{command}" = { action: task, help: -> { help(task) }, test_dir: @test_dir, shell: shell }.merge() str_const = Thor::Util.camel_case(command) klass = ::Polytrix::Command.const_get(str_const) klass.new(args, , ).call end |