-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fixed a bug that overwrote existing self.extended method definitions. #324
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #324 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 179 183 +4
Branches 88 88
=========================================
+ Hits 179 183 +4 ☔ View full report in Codecov by Sentry. |
Thanks @alpaca-tc ! This looks great to me. Would you mind rebasing your branch on top of the latest |Method arguments|`Dry::Core`\* (1.0.1)|`Memery` (1.5.0)|
|--|--|--|
|`()` (none)|0.59x|3.65x|
|`(a)`|1.49x|8.38x|
|`(a, b)`|1.21x|6.55x|
|`(a:)`|1.43x|13.14x|
|`(a:, b:)`|1.20x|10.32x|
|`(a, b:)`|1.18x|10.10x|
|`(a, *args)`|0.79x|1.61x|
|`(a:, **kwargs)`|0.75x|1.97x|
|`(a, *args, b:, **kwargs)`|0.67x|1.37x|
|
0fadf03
to
718a584
Compare
Actually it looks like GitHub gives me permission to edit your branch so I'm just making those changes. Hope that's okay! |
instance = klass.new | ||
instance.extend(module_with_memo) | ||
|
||
expect(instance.instance_variable_get(:@extended_called)).to be(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @alpaca-tc thank you for this!
Can we add a test asserting, in addition to the fact that we call the previously defined Module#extended
, that we also are actually memoizing the call to no_args
? I suspect that was intended by maybe not finished?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added and force-pushed 👍
There is a hack that dynamically defines self.extended when memo_wise is called, but there was a bug that did not consider the case where an existing self.extended existed, so this has been fixed.
718a584
to
20fe5fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! LGTM
There is a hack that dynamically defines self.extended when memo_wise is called, but there was a bug that did not consider the case where an existing self.extended existed, so this has been fixed.
Before merging:
README.md
and update this PRCHANGELOG.md
, add an entry following Keep a Changelog guidelines with semantic versioning