Class: Silas::Doctor

Inherits:
Object
  • Object
show all
Defined in:
lib/silas/doctor.rb

Overview

One command for every known first-run failure mode: provider key, queue adapter, model resolution, migrations, tool validation, the rescuer entry, cable adapter for live streaming, and auth wiring. Each check was already written somewhere in the codebase — this makes them reachable as bin/rails silas:doctor.

Defined Under Namespace

Classes: Check

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root:) ⇒ Doctor

Returns a new instance of Doctor.



15
16
17
# File 'lib/silas/doctor.rb', line 15

def initialize(root:)
  @root = Pathname(root)
end

Class Method Details

.run(root: Rails.root) ⇒ Object



13
# File 'lib/silas/doctor.rb', line 13

def self.run(root: Rails.root) = new(root: root).run

Instance Method Details

#runObject



19
20
21
22
23
24
# File 'lib/silas/doctor.rb', line 19

def run
  [
    provider_credentials, queue_adapter, model_resolution, migrations,
    agent_directory, rescuer_entry, streaming_cable, auth_wiring
  ].flatten.compact
end