Class: Cuprum::Cli::Integrations::Thor::Registry
- Parent Namespace
- Cuprum::Cli::Integrations::Thor
- Inherited Classes
- Cuprum::Cli::Registry
>
Object
- Defined In
- lib/cuprum/cli/integrations/thor/registry.rb
Table Of Contents
Overview
Registers CLI commands by name and adds as Thor tasks.
Back To Top
Instance Methods
#[](name) => Class, nil
- Inherited From
- Cuprum::Cli::Registry
Returns
- (Class, nil) — the command registered with the given name, if any.
#commands => Hash{String => Class}
- Inherited From
- Cuprum::Cli::Registry
Returns a copy of the commands registered with the registry.
Returns
- (Hash{String => Class}) — the registered commands.
#register(command, **config) => self
Also known as:
add
Registers the command with the registry.
Also registers a Thor task with compatible parameters and metadata.
Parameters
- command (Class) — the command class to register.
- config (Hash) — options for configuring the command.
Options Hash (config)
- arguments (Array) — arguments to pass to the command on
initialization.
- description (String) — the description for the command.
- full_description (String) — the full description for the
command.
- full_name (String) — the name under which to register the
command. Defaults to the value of command.full_name.
- options (Hash) — options to pass to the command on
initialization.
Returns
Raises
- (NameError) — if a command is already registered with that name.
Back To Top
Back to
Documentation |
Reference
|
Cuprum
|
Cuprum::Cli
|
Cuprum::Cli::Integrations
|
Cuprum::Cli::Integrations::Thor