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/subscription.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, FailParse, Root, Subscription, Util

Defined Under Namespace

Classes: Environment, FailParse, OptionParser, Root, Subscription, 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



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



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



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



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



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



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

def zombie?
  false
end