Class: Parabot::Commands::Doctor

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/parabot/commands/doctor.rb

Instance Method Summary collapse

Instance Method Details

#call(file: nil, plain: false, project_root: nil) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/parabot/commands/doctor.rb', line 22

def call(file: nil, plain: false, project_root: nil, **)
  @plain_output = plain
  log("Running Parabot health check...", :health_check)

  begin
    # Load configuration
    config = Configuration.load(file, project_root)

    log("Configuration loaded successfully", :ok)
    validate_config_schema(config)

    log("Health check completed!", :success)
  rescue ConfigurationError => e
    log("Configuration error: #{e.message}", :error)
    exit 1
  rescue StandardError => e
    log("Unexpected error: #{e.message}", :fatal)
    exit 1
  end
end