Class: Omnitest::Command::Base

Inherits:
Object
  • Object
show all
Includes:
Core::DefaultLogger, Omnitest::Core::FileSystem, Omnitest::Core::Logging
Defined in:
lib/omnitest/command.rb

Overview

rubocop:disable ClassLength

Direct Known Subclasses

List, ProjectAction, ScenarioAction, Show, Task, Test

Instance Method Summary collapse

Constructor Details

#initialize(action, cmd_args, cmd_options, options = {}) ⇒ Base

Contstructs a new Command object.

Parameters:

  • cmd_args (Array)

    remainder of the arguments from processed ARGV

  • cmd_options (Hash)

    hash of Thor options

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

    configuration options

Options Hash (options):

  • :action (String)

    action to take, usually corresponding to the subcommand name (default: ‘nil`)

  • :help (proc)

    a callable that displays help for the command

  • :test_dir (Config)

    a Config object (default: ‘nil`)

  • :loader (Loader)

    a Loader object (default: ‘nil`)

  • :shell (String)

    a Thor shell object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/omnitest/command.rb', line 23

def initialize(action, cmd_args, cmd_options, options = {})
  @action = action
  @args = cmd_args
  @options = cmd_options
  @help = options.fetch(:help, -> { 'No help provided' })
  @project_set_file = options.fetch('file', nil)
  @skeptic_file = options.fetch('skeptic', nil)
  @loader = options.fetch(:loader, nil)
  @shell = options.fetch(:shell)
  @queue = Queue.new
end