Class: Cuprum::Cli::Integrations::Thor::Task

Inherits:
Thor
  • Object
show all
Extended by:
SleepingKingStudios::Tools::Toolbox::Subclass
Defined in:
lib/cuprum/cli/integrations/thor/task.rb

Overview

Thor task wrapping a Cuprum::Cli command.

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command_class, arguments = [], options = {}, config = {}) ⇒ Task

Returns a new instance of Task.

Parameters:

  • command_class (Class)

    the command to execute.

  • arguments (Array) (defaults to: [])

    the arguments passed by the Thor runtime.

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

    the options passed by the Thor runtime.

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

    additional configuration passed by the Thor runtime.



159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/cuprum/cli/integrations/thor/task.rb', line 159

def initialize(
  command_class,
  arguments = [],
  options   = {},
  config    = {},
  command_dependencies: {}
)
  super(arguments, options, config)

  @command_class = command_class
  @command_dependencies = command_dependencies
end

Instance Attribute Details

#command_classClass (readonly)

Returns the command to execute.

Returns:

  • (Class)

    the command to execute.



173
174
175
# File 'lib/cuprum/cli/integrations/thor/task.rb', line 173

def command_class
  @command_class
end

Class Method Details

.exit_on_failure?true

Ensures that the task exists with a non-zero status code on a failure.

Returns:

  • (true)


151
# File 'lib/cuprum/cli/integrations/thor/task.rb', line 151

def self.exit_on_failure? = true