Class: ReactOnRails::Doctor
- Inherits:
-
Object
- Object
- ReactOnRails::Doctor
- Includes:
- ConfigPathResolver
- 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"
Constants included from ConfigPathResolver
ConfigPathResolver::ALL_DEFAULT_CONFIG_CANDIDATES, ConfigPathResolver::RSPACK_DEFAULT_CONFIG_CANDIDATES, ConfigPathResolver::WEBPACK_DEFAULT_CONFIG_CANDIDATES
Instance Method Summary collapse
-
#initialize(verbose: false, fix: false) ⇒ Doctor
constructor
A new instance of Doctor.
- #run_diagnosis ⇒ Object
Constructor Details
#initialize(verbose: false, fix: false) ⇒ Doctor
Returns a new instance of Doctor.
57 58 59 60 61 62 63 |
# File 'lib/react_on_rails/doctor.rb', line 57 def initialize(verbose: false, fix: false) @verbose = verbose @fix = fix @checker = SystemChecker.new @test_output_path_strategy = :unknown @rails_environment_loaded = false end |
Instance Method Details
#run_diagnosis ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'lib/react_on_rails/doctor.rb', line 65 def run_diagnosis print_header run_all_checks print_summary print_recommendations if should_show_recommendations? exit_with_status end |