Class: Cuprum::Cli::Integrations::Thor::Registry
- Defined in:
- lib/cuprum/cli/integrations/thor/registry.rb
Overview
Registers CLI commands by name and adds as Thor tasks.
Instance Method Summary collapse
-
#register(command, **config) ⇒ self
(also: #add)
Registers the command with the registry.
Methods inherited from Registry
Instance Method Details
#register(command, **config) ⇒ self Also known as: add
Registers the command with the registry.
Also registers a Thor task with compatible parameters and metadata.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cuprum/cli/integrations/thor/registry.rb', line 30 def register(command, **config) super.tap do name = config.fetch(:full_name, command.full_name) command = commands[name] Cuprum::Cli::Integrations::Thor::Task::Builder .new(command) .build(full_name: name) end end |