Class: Mutant::CLI::Command Private

Inherits:
Object
  • Object
show all
Includes:
Unparser::AbstractType
Defined in:
lib/mutant/cli/command.rb,
lib/mutant/cli/command/root.rb,
lib/mutant/cli/command/util.rb,
lib/mutant/cli/command/environment.rb,
lib/mutant/cli/command/environment/irb.rb,
lib/mutant/cli/command/environment/run.rb,
lib/mutant/cli/command/environment/show.rb,
lib/mutant/cli/command/environment/test.rb,
lib/mutant/cli/command/environment/subject.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

rubocop:disable Metrics/ClassLength

Direct Known Subclasses

Environment, Root, Util

Defined Under Namespace

Classes: Environment, OptionParser, Root, Util

Constant Summary collapse

OPTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

[].freeze
SUBCOMMANDS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

[].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.command_nameString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Command name

Returns:

  • (String)


44
45
46
# File 'lib/mutant/cli/command.rb', line 44

def self.command_name
  self::NAME
end

.parse(arguments:, parent_names: nil, print_profile: false, world:, zombie: false) ⇒ Command

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parse command

rubocop:disable Metrics/ParameterLists

Returns:



30
31
32
33
34
35
36
37
38
# File 'lib/mutant/cli/command.rb', line 30

def self.parse(arguments:, parent_names: nil, print_profile: false, world:, zombie: false)
  new(
    main:          nil,
    parent_names:,
    print_profile:,
    world:,
    zombie:
  ).__send__(:parse, arguments)
end

.short_descriptionString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Command short description

Returns:

  • (String)


51
52
53
# File 'lib/mutant/cli/command.rb', line 51

def self.short_description
  self::SHORT_DESCRIPTION
end

Instance Method Details

#callBool

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Execute the command, invoke its side effects

Returns:

  • (Bool)


58
59
60
# File 'lib/mutant/cli/command.rb', line 58

def call
  main ? main.call : execute
end

#full_nameString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Commands full name

Returns:

  • (String)


65
66
67
# File 'lib/mutant/cli/command.rb', line 65

def full_name
  [*parent_names, self.class.command_name].join(' ')
end