Grape::DSL::Helpers::ClassMethods#helpers modifies helper module
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
Hi, Grape::DSL::Helpers::ClassMethods#helpers evaluates helper methods in context of a given helper module, that leads to problems if that helper module is used anywhere else.
Example
helpers MyHelperModule do
def resource
...
end
end
now if I include MyHelperModule anywhere else, I'll have resource method, that I don't want to include
Update:
https://github.com/ruby-grape/grape/blob/master/lib/grape/dsl/helpers.rb#L31
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at lib/grape/dsl/helpers.rb around line 31 and inspect Grape::DSL::Helpers::ClassMethods#helpers. Reproduce the MyHelperModule example from the issue, then verify that using the helper through the DSL does not alter the module when it is included elsewhere.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100