Module: Packwerk::Commands
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/packwerk/commands.rb,
lib/packwerk/commands/base_command.rb,
lib/packwerk/commands/help_command.rb,
lib/packwerk/commands/init_command.rb,
lib/packwerk/commands/check_command.rb,
lib/packwerk/commands/uses_parse_run.rb,
lib/packwerk/commands/version_command.rb,
lib/packwerk/commands/validate_command.rb,
lib/packwerk/commands/lazy_loaded_entry.rb,
lib/packwerk/commands/update_todo_command.rb
Defined Under Namespace
Classes: BaseCommand, CheckCommand, HelpCommand, InitCommand, UpdateTodoCommand, ValidateCommand, VersionCommand
Class Method Summary collapse
-
.all ⇒ Object
: -> Array.
-
.for(name_or_alias) ⇒ Object
: (String name_or_alias) -> singleton(BaseCommand)?.
-
.register(name, aliases: []) ⇒ Object
: (String name, ?aliases: Array) -> void.
Class Method Details
.all ⇒ Object
: -> Array
32 33 34 |
# File 'lib/packwerk/commands.rb', line 32 def all registry.dup end |
.for(name_or_alias) ⇒ Object
: (String name_or_alias) -> singleton(BaseCommand)?
25 26 27 28 29 |
# File 'lib/packwerk/commands.rb', line 25 def for(name_or_alias) registry .find { |command| command.matches_command?(name_or_alias) } &.command_class end |
.register(name, aliases: []) ⇒ Object
: (String name, ?aliases: Array) -> void
20 21 22 |
# File 'lib/packwerk/commands.rb', line 20 def register(name, aliases: []) registry << LazyLoadedEntry.new(name, aliases: aliases) end |