Class: Lyman::CLI::Commands::Doctor

Inherits:
Object
  • Object
show all
Defined in:
lib/lyman/cli/commands/doctor.rb

Overview

lyman doctor — smoke-tests a scaffolded project: manifest parses, every listed file exists (managed files note pristine/modified), and a subprocess runs the planted pipeline end to end against a stub transport (lib/lyman/cli/doctor_check.rb). See docs/design/ deployment.md ("Ruby without a type checker").

Constant Summary collapse

CHECK_SCRIPT =

doctor_check.rb is CLI machinery, not a planted artifact — it always ships from this gem's own tree, never from a fixture source_root (source_root exists so other commands can point at "a newer lyman release"; doctor has no such concept, it only checks what's here).

File.join(Registry::GEM_ROOT, "lib", "lyman", "cli", "doctor_check.rb")

Instance Method Summary collapse

Constructor Details

#initialize(thor, source_root:) ⇒ Doctor

Returns a new instance of Doctor.



18
19
20
21
# File 'lib/lyman/cli/commands/doctor.rb', line 18

def initialize(thor, source_root:)
  @thor = thor
  @source_root = source_root
end

Instance Method Details

#callObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/lyman/cli/commands/doctor.rb', line 23

def call
  project_root = Manifest.find!
  manifest = load_manifest(project_root)

  results = [!manifest.nil?]
  if manifest
    results << check_files(manifest, project_root)
    results << check_pipeline(project_root)
  end

  exit 1 unless results.all?
end