Class: SpaceArchitect::CLI::Status

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
GlobalOptions, Helpers
Defined in:
lib/space_architect/cli/status.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(rest: [], **opts) ⇒ Object



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

def call(rest: [], **opts)
  setup_terminal(**opts.slice(:color, :colors))
  handle_errors do
    identifier, status_value = parse_status_args(Array(rest))
    render(store.find(identifier)) do |space|
      space.update_status(status_value)
      terminal.success "#{space.id} is #{space.status}"
      CLI.record_outcome(Outcome.new(exit_code: 0))
    end
  end
end