Class: SpaceArchitect::CLI::Config::Show

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
GlobalOptions, Helpers
Defined in:
lib/space_architect/cli/config.rb

Instance Method Summary collapse

Methods included from Helpers

#display_date, #handle_errors, #project_config, #render, #setup_terminal, #state, #store, #terminal

Methods included from GlobalOptions

included

Instance Method Details

#call(**opts) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/space_architect/cli/config.rb', line 12

def call(**opts)
  setup_terminal(**opts.slice(:color, :colors))
  handle_errors do
    rows = SpaceArchitect::Config::EDITABLE_KEYS.map do |key|
      value = project_config.data[key]
      [key, value.nil? ? "" : value.to_s]
    end
    terminal.say terminal.table(%w[Key Value], rows)
    CLI.record_outcome(Outcome.new(exit_code: 0))
  end
end