ruby / ruby/rake

`namespace` not only for tasks, but also for functions hermetization

Open
#279 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.5k
Forks
650
Avg merge
6m
Merged PRs (30d)
3

Description

It's a known fact, that ruby function defined in a namespace will be defined in a global scope rather than inside of a hermetized context. So ruby function defined in one namespace will be visible in another and it may be unintentionally overridden.

It would be nice if namespace could be a context for ruby functions as well as rake tasks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with Ruby functions defined in two separate namespace blocks and confirm that one can be visible from or override the other. Then trace how Rake handles namespace context for tasks and determine the equivalent behavior needed for functions. Done means functions defined in one namespace are hermetized from other namespaces without breaking existing task behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.