Add support for inheriting hooks#191
Open
kaspermeyer wants to merge 3 commits intocollectiveidea:masterfrom
Open
Add support for inheriting hooks#191kaspermeyer wants to merge 3 commits intocollectiveidea:masterfrom
kaspermeyer wants to merge 3 commits intocollectiveidea:masterfrom
Conversation
|
Could you review this if you get a chance? @gaffneyc @danielmorrison |
|
This is really nice, and I'd support seeing this merged as well. |
Member
|
Sorry that it's taken so long to get eyes on this. I think this looks good and it's tentatively slated for 4.0 since it's a possible breaking change. No word on exactly when that will be but it's something I'm working toward as time permits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements support for inheriting hooks defined in ancestors.
A previous PR has also targeted this issue; however, that solution does not support hooks declared in ancestors at runtime. This solution does:
I had to move around the internals of the
Hooksmodule a bit to make this work, which might break things, should people attempt to mutate the values of#around_hooks,#before_hooksand#after_hooksin their applications. I hope this is acceptable if we target this fix for the next major version, which seems to be 4.0.Let me know if I'm missing anything.
Fixes: #114