Class: Seams::CLI::List
- Inherits:
-
Object
- Object
- Seams::CLI::List
- Defined in:
- lib/seams/cli/list.rb
Overview
Implementation behind ‘bin/rails seams:list` — discovers every engine under engines/, looks up its registered events in Seams::EventRegistry, and prints a summary.
Constant Summary collapse
- DEFAULT_ENGINES_ROOT =
"engines"- MODULE_DECLARATION =
/\bmodule\s+([A-Z][A-Za-z0-9_]*)\b/
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(engines_root: DEFAULT_ENGINES_ROOT, output: $stdout) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(engines_root: DEFAULT_ENGINES_ROOT, output: $stdout) ⇒ List
Returns a new instance of List.
15 16 17 18 |
# File 'lib/seams/cli/list.rb', line 15 def initialize(engines_root: DEFAULT_ENGINES_ROOT, output: $stdout) @engines_root = engines_root @output = output end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/seams/cli/list.rb', line 20 def call engines = discover_engines @output.puts("seams: #{engines.size} engine(s) installed") if engines.empty? @output.puts(" (no engines — generate one with `bin/rails generate seams:engine <name>`)") return end engines.each { |engine| print_engine(engine) } end |