Class: Rails::Command::NitroKitCommand
- Inherits:
-
Base
- Object
- Base
- Rails::Command::NitroKitCommand
- Defined in:
- lib/rails/commands/nitro_kit/nitro_kit_command.rb
Instance Method Summary collapse
Instance Method Details
#doctor ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rails/commands/nitro_kit/nitro_kit_command.rb', line 10 def doctor checks = installation.checks if [:format] == "json" say JSON.pretty_generate(checks.map { { status: _1.status, label: _1.label, detail: _1.detail } }) else 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 end exit 1 if checks.any? { _1.status == :fail } end |
#prompt ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rails/commands/nitro_kit/nitro_kit_command.rb', line 27 def prompt if [: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. exit 1 end |