Class: Mutant::CLI::Command Private

Inherits:
Object
  • Object
show all
Includes:
AbstractType
Defined in:
lib/mutant/cli/command.rb,
lib/mutant/cli/command/run.rb,
lib/mutant/cli/command/root.rb,
lib/mutant/cli/command/subscription.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

FailParse, Root, Run, Subscription

Defined Under Namespace

Classes: FailParse, OptionParser, Root, Run, Subscription

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)


40
41
42
# File 'lib/mutant/cli/command.rb', line 40

def self.command_name
  self::NAME
end

.parse(**attributes) ⇒ 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

Returns:



33
34
35
# File 'lib/mutant/cli/command.rb', line 33

def self.parse(**attributes)
  new(main: nil, parent: nil, **attributes).__send__(:parse)
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)


47
48
49
# File 'lib/mutant/cli/command.rb', line 47

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)


54
55
56
# File 'lib/mutant/cli/command.rb', line 54

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)


61
62
63
# File 'lib/mutant/cli/command.rb', line 61

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

#zombie?Bool

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.

Test if command needs to be executed in zombie environment

Returns:

  • (Bool)


68
69
70
# File 'lib/mutant/cli/command.rb', line 68

def zombie?
  instance_of?(Run)
end