Class: Space::Core::CLI::List
- Inherits:
-
BaseCommand
- Object
- Dry::CLI::Command
- BaseCommand
- Space::Core::CLI::List
- Defined in:
- lib/space_core/cli/list.rb
Instance Method Summary collapse
Methods included from Helpers
#display_date, #handle_errors, #project_config, #render, #setup_terminal, #state, #store, #terminal
Instance Method Details
#call(**opts) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/space_core/cli/list.rb', line 7 def call(**opts) setup_terminal(**opts.slice(:color, :colors)) handle_errors do spaces = store.list if spaces.empty? terminal.say "No spaces found in #{terminal.path(project_config.spaces_dir)}" next end rows = spaces.map do |space| [space.status, display_date(space), space.title, terminal.path(space.path)] end terminal.say terminal.table(%w[Status Date Title Path], rows) CLI.record_outcome(Outcome.new(exit_code: 0)) end end |