Class: Uniword::Plugin::CliCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/uniword/plugin/cli_command.rb

Overview

Base class for plugin-provided CLI commands. A plugin CLI command is a Thor subclass that the main CLI registers as a subcommand.

Subclasses declare subcommand_name (the name CLI users type) and description (shown in uniword help).

Class Method Summary collapse

Class Method Details

.descriptionString

Returns one-line description.

Returns:

  • (String)

    one-line description

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/uniword/plugin/cli_command.rb', line 19

def description
  raise NotImplementedError
end

.subcommand_nameSymbol

Returns subcommand name (e.g. :myplugin).

Returns:

  • (Symbol)

    subcommand name (e.g. :myplugin)

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/uniword/plugin/cli_command.rb', line 14

def subcommand_name
  raise NotImplementedError
end

.thor_classClass<Thor>

Returns the Thor subclass to register.

Returns:

  • (Class<Thor>)

    the Thor subclass to register

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/uniword/plugin/cli_command.rb', line 24

def thor_class
  raise NotImplementedError
end