Class: Julewire::Core::CLI::Doctor

Inherits:
Object
  • Object
show all
Defined in:
lib/julewire/core/cli/doctor.rb

Constant Summary collapse

FLAGS =
{
  "--color" => [:color, true],
  "--json" => %i[format json],
  "--no-color" => [:color, false],
  "--plain" => %i[theme plain],
  "--punk" => %i[theme punk],
  "--text" => %i[format text]
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(argv:, stdout:) ⇒ Doctor

Returns a new instance of Doctor.



18
19
20
21
# File 'lib/julewire/core/cli/doctor.rb', line 18

def initialize(argv:, stdout:)
  @argv = argv
  @stdout = stdout
end

Instance Method Details

#callObject



23
24
25
26
27
28
# File 'lib/julewire/core/cli/doctor.rb', line 23

def call
  options = doctor_options
  report = Julewire.doctor
  options.fetch(:format) == :json ? write_json(report) : write_text(report, options)
  0
end