Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use prepend instead of include for helpers. Fixes #1213 #1214

Merged
merged 1 commit into from Mar 18, 2020

Conversation

@mwpastore
Copy link
Member

@mwpastore mwpastore commented Dec 7, 2016

No description provided.

@zzak
Copy link
Member

@zzak zzak commented Dec 25, 2016

See my comment on #1213

@mwpastore
Copy link
Member Author

@mwpastore mwpastore commented Dec 27, 2016

I did. 😄 This can wait. My only counterargument would be that there's never going to be a better time to break things, so if this makes sense, let's do it. The counterargument to that is that 2.0's already been in pre-release for ages and cramming things in at the end of the cycle isn't kosher. Anyway, I'm fine waiting, and if you are feeling like you'll never want to merge it, that's fine too.

@zzak
Copy link
Member

@zzak zzak commented Dec 28, 2016

@mwpastore Please wait 🙇

@zzak zzak added the feedback label Dec 28, 2016
@zzak zzak added this to the Beyond milestone Dec 28, 2016
@namusyaka namusyaka self-requested a review Mar 6, 2018
Copy link
Contributor

@namusyaka namusyaka left a comment

Sorry for the late reply, but thanks. This looks reasonable to me.
You should also work on sinatra-namespace.

@jkowens jkowens modified the milestones: Beyond, v2.1.0 Mar 18, 2020
@jkowens jkowens force-pushed the mwpastore:prepend-helpers branch from d55f238 to 8607e8a Mar 18, 2020
@jkowens jkowens merged commit 2db247d into sinatra:master Mar 18, 2020
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@baelter
Copy link
Contributor

@baelter baelter commented Oct 20, 2020

Ouch, this broke a lot of things. Helpers are not overloaded like before.

@aldentea
Copy link

@aldentea aldentea commented Oct 21, 2020

Yes. If a helper module uses included method, it doesn't work.

@jkowens
Copy link
Member

@jkowens jkowens commented Oct 23, 2020

Hm not good. @baelter / @aldentea would you be able to submit a PR with a failing test?

@baelter
Copy link
Contributor

@baelter baelter commented Oct 24, 2020

@jkowens
Here you go, this works in v2.0.8.1
#1655

@baelter
Copy link
Contributor

@baelter baelter commented Oct 24, 2020

Could use prepend(Module.new(&block)) instead of class_eval(&block) but then that does not play nice with alias_method. I don't think it's possible to combine prepend and alias_method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.