Class: Evilution::CLI::Parser::CommandExtractor Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/cli/parser/command_extractor.rb

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.

Defined Under Namespace

Classes: Result

Constant Summary collapse

SIMPLE_COMMANDS =

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.

{
  "version" => :version,
  "init" => :init,
  "mcp" => :mcp,
  "subjects" => :subjects,
  "compare" => :compare
}.freeze
SESSION_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.

{
  "list" => :session_list,
  "show" => :session_show,
  "diff" => :session_diff,
  "gc" => :session_gc
}.freeze
RUN_ALIASES =

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.

%w[run mutate].freeze
TESTS_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.

{ "list" => :tests_list }.freeze
ENVIRONMENT_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.

{ "show" => :environment_show }.freeze
UTIL_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.

{ "mutation" => :util_mutation }.freeze
SUBCOMMAND_FAMILIES =

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.

{
  "session" => [SESSION_SUBCOMMANDS, "session", "list, show, diff, gc"],
  "tests" => [TESTS_SUBCOMMANDS, "tests", "list"],
  "environment" => [ENVIRONMENT_SUBCOMMANDS, "environment", "show"],
  "util" => [UTIL_SUBCOMMANDS, "util", "mutation"]
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CommandExtractor

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.

Returns a new instance of CommandExtractor.



38
39
40
41
42
# File 'lib/evilution/cli/parser/command_extractor.rb', line 38

def initialize(argv)
  @argv = argv.dup
  @command = :run
  @parse_error = nil
end

Class Method Details

.call(argv) ⇒ Object

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.



34
35
36
# File 'lib/evilution/cli/parser/command_extractor.rb', line 34

def self.call(argv)
  new(argv).call
end

Instance Method Details

#callObject

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.



44
45
46
47
# File 'lib/evilution/cli/parser/command_extractor.rb', line 44

def call
  extract
  Result.new(@command, @argv, @parse_error)
end