Class: ReactOnRails::Doctor

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

Overview

rubocop:disable Metrics/ClassLength, Metrics/AbcSize

Constant Summary collapse

MESSAGE_COLORS =
{
  error: :red,
  warning: :yellow,
  success: :green,
  info: :blue
}.freeze
RSPEC_HELPER_FILES =
["spec/rails_helper.rb", "spec/spec_helper.rb"].freeze
MINITEST_HELPER_FILE =
"test/test_helper.rb"
DEFAULT_BUILD_TEST_COMMAND =
'config.build_test_command = "RAILS_ENV=test bin/shakapacker"'
DEFAULT_SHAKAPACKER_CONFIG_PATH =
"config/shakapacker.yml"

Instance Method Summary collapse

Constructor Details

#initialize(verbose: false, fix: false) ⇒ Doctor

Returns a new instance of Doctor.



54
55
56
57
58
59
# File 'lib/react_on_rails/doctor.rb', line 54

def initialize(verbose: false, fix: false)
  @verbose = verbose
  @fix = fix
  @checker = SystemChecker.new
  @test_output_path_strategy = :unknown
end

Instance Method Details

#run_diagnosisObject



61
62
63
64
65
66
67
68
# File 'lib/react_on_rails/doctor.rb', line 61

def run_diagnosis
  print_header
  run_all_checks
  print_summary
  print_recommendations if should_show_recommendations?

  exit_with_status
end