Class: Stable::Commands::List

Inherits:
Object
  • Object
show all
Defined in:
lib/stable/commands/list.rb

Overview

List command - displays all registered applications

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/stable/commands/list.rb', line 9

def call
  apps = Services::AppRegistry.all

  if apps.empty?
    puts 'No apps registered.'
    return
  end

  print_header

  apps.each do |app|
    # Determine status based on whether the app is actually running (port check)
    status = app_running?(app) ? 'running' : 'stopped'
    puts format_row(app, status)
  end
end