Skip to content

Commit 370f1c8

Browse files
justin808claude
andcommitted
Fix doctor rake task LoadError with excluded task_helpers
The doctor.rake task was trying to require "../../rakelib/task_helpers" but the rakelib directory is excluded from gem packaging in the gemspec. This caused LoadError when using the packaged gem. Changes: - Remove require_relative "../../rakelib/task_helpers" from doctor.rake - Remove include ReactOnRails::TaskHelpers (unused in the task) - Add test to ensure rake file loads without missing dependencies The doctor task functionality is preserved and works correctly without the excluded TaskHelpers module. Fixes the issue introduced in commit 27dba50 where doctor.rake was added with a reference to the excluded rakelib directory. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dcca723 commit 370f1c8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/tasks/doctor.rake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# frozen_string_literal: true
22

3-
require_relative "../../rakelib/task_helpers"
43
require_relative "../react_on_rails"
54
require_relative "../react_on_rails/doctor"
65

@@ -38,7 +37,6 @@ rescue LoadError
3837
end
3938

4039
namespace :react_on_rails do
41-
include ReactOnRails::TaskHelpers
4240

4341
desc "Diagnose React on Rails setup and configuration"
4442
task :doctor do

spec/lib/react_on_rails/doctor_rake_task_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
expect(Rake::Task.task_defined?("react_on_rails:doctor")).to be true
1717
end
1818

19+
it "can be loaded without requiring missing task_helpers" do
20+
# This test ensures the rake file doesn't try to require excluded files
21+
# that would cause LoadError in packaged gems
22+
expect { load rake_file }.not_to raise_error
23+
end
24+
1925
it "can be invoked without errors" do
2026
# Mock the Doctor class to avoid actual diagnosis
2127
doctor_instance = instance_double(ReactOnRails::Doctor)

0 commit comments

Comments
 (0)