Class: Rails::Command::NitroKitCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/rails/commands/nitro_kit/nitro_kit_command.rb

Instance Method Summary collapse

Instance Method Details

#doctorObject



7
8
9
10
11
12
13
14
15
# File 'lib/rails/commands/nitro_kit/nitro_kit_command.rb', line 7

def doctor
  checks = installation.checks
  checks.each do |check|
    color = { pass: :green, warn: :yellow, fail: :red }.fetch(check.status)
    say_status(check.status.to_s.upcase, "#{check.label}: #{check.detail}", color)
  end

  exit 1 if checks.any? { _1.status == :fail }
end

#promptObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rails/commands/nitro_kit/nitro_kit_command.rb', line 20

def prompt
  if options[:copy]
    command = installation.copy_prompt
    say "Copied the Nitro Kit 2 initialization prompt via #{command}."
  else
    say installation.prompt
  end
rescue RuntimeError => error
  say_error error.message
  exit 1
end