Class: Ace::Overseer::CLI::Commands::Status

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
Support::Cli::Base
Defined in:
lib/ace/overseer/cli/commands/status.rb

Instance Method Summary collapse

Constructor Details

#initialize(collector: nil, config: nil) ⇒ Status

Returns a new instance of Status.



19
20
21
22
23
# File 'lib/ace/overseer/cli/commands/status.rb', line 19

def initialize(collector: nil, config: nil)
  super()
  @collector = collector || Organisms::StatusCollector.new
  @config = config
end

Instance Method Details

#call(format:, **options) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ace/overseer/cli/commands/status.rb', line 25

def call(format:, **options)
  Atoms::RepoGuard.ensure_repo!
  return if options[:quiet]

  if options[:watch] && format != "json"
    run_watch_loop(format, options)
  else
    run_once(format)
  end
rescue Interrupt
  nil
rescue => e
  raise Ace::Support::Cli::Error.new(e.message)
end