Skip to content

Rake task helpers and constants pollute the global namespace in host apps #58

Description

@kanejamison

Problem

setup.rake, add.rake, install.rake, and sample_data.rake define helper methods (add_route, generate_views, generate_controller, root_route_exists?, ...) with bare def inside namespace blocks — these land on Object in every host app that bundles the gem. Same for include Bunko::RakeHelpers and the top-level BUNKO_STANDARD_PAGES constant (sample_data.rake:7). Generic names like add_route invite collisions with host-app rake code or other gems.

Proposed solution

Move all helpers into Bunko::RakeHelpers (or per-task modules under it) as module_functions and call them fully qualified (Bunko::RakeHelpers.render_template(...)). Move BUNKO_STANDARD_PAGES into that module.

Acceptance criteria

  • No methods or constants defined at the top level by any shipped rake file.
  • test/tasks/ suite passes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrefactorStuff we should improve

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions