Skip to content

Conversation

@jcouball
Copy link
Member

@jcouball jcouball commented Nov 11, 2025

This change actually merged by #844.

Summary

Refactored the monolithic 79-line Rakefile into a clean 15-line loader that dynamically imports task definitions from separate files in the tasks/ directory.

Changes

New Structure

  • Created tasks/ directory with 5 focused rake files:
    • tasks/test.rake - test execution tasks
    • tasks/rubocop.rake - RuboCop linting tasks
    • tasks/yard.rake - YARD documentation tasks
    • tasks/gem_tasks.rake - gem building and release tasks
    • tasks/test_gem.rake - gem sanity check task

Main Rakefile

  • Now loads all .rake files from tasks/ directory
  • Dynamically builds default task list based on available tasks
  • Reduced from 79 lines to 15 lines
  • Improved separation of concerns

Platform Logic

  • Moved platform-specific logic (JRuby/TruffleRuby check) into yard.rake where it belongs
  • Each task file now encapsulates its own requirements and constraints

Maintained Functionality

All original functionality is preserved:

  • ✅ Default tasks remain: test, rubocop, yard, yardstick:coverage, build
  • yardstick remains commented out of defaults (too many warnings)
  • ✅ All task descriptions and behavior unchanged
  • ✅ Platform-specific behavior preserved
  • ✅ All rake commands work identically

Benefits

  1. Better organization - Related tasks are grouped together
  2. Easier maintenance - Changes to specific task groups are isolated
  3. Improved readability - Main Rakefile is now simple and clear
  4. Separation of concerns - Each file has a single responsibility

Testing

rake -T  # All tasks available
rake --dry-run  # Confirms default task sequence
rake  # Successfully runs all default tasks

@jcouball jcouball closed this Nov 11, 2025
@jcouball jcouball deleted the refactor_rake branch November 11, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants