-
Notifications
You must be signed in to change notification settings - Fork 106
Fix compatibility with power_assert 3.0 on older rubies #329
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
Conversation
power_assert 3.0 now use pattern matching: ruby/power_assert#57 This cause it to be half defined on Ruby 3.0 and older.
12b8dad to
4e4b510
Compare
|
Thanks! @tikkss Could you release a new version? |
|
Sure! I'll work on it in a few hours. |
|
Is there a reason why I confirmed this locally, skipping the |
It requires Ruby 3.1 but declares no `required_ruby_version`. Ref: test-unit/test-unit#329 (comment)
It would be preferable, unfortunately that ship has sailed. Now that |
|
Well, yeah. It's unfortunate that bundler will always land on 3.0.0 in case of conflict but that at least makes it more obvious that something is not entirely right once more time has passed and new versions have been released. I will open a PR. |
This is only documented in the Readme. 3.0.0 now depends on pattern matching, which is invalid syntax on 2.7. The `test-unit` gem depends on `power_assert` and tries to handle that by catching `SyntaxError`: https://github.com/test-unit/test-unit/blob/edfa50cf4fef5521f34dca1995c1c8f3efe77d7b/lib/test/unit/assertions.rb#L12-L18 That seems to have worked ok previously but now it leaves the `PowerAssert` module behind, among other things. `test-unit` cleans that up via test-unit/test-unit#329 but there are other side-effects it can do nothing about. For example, an undefined `new` method: > /Users/runner/hostedtoolcache/Ruby/2.7.8/arm64/lib/ruby/gems/2.7.0/gems/onigmo-0.1.0/lib/onigmo/node.rb:27:in `private_class_method': undefined method `new' for class `#<Class:Onigmo::Node>' (NameError) > Did you mean? next Now, bundler will always fall back to 3.0.0 even if this gets released as 3.0.0. But eventually it will help for future version bumps.
Maybe this would be a good case to yank that version since it causes known problems? (after releasing 3.0.1 or so with the proper |
|
I'm generally against yanking as it tend to cause even more issues. |
|
Yes, I hate yanking (as implemented). It causes problems for everyone that already upgraded and didn't have issues in the first place or already worked around it. At one point you were able to still install even yanked gems which would be fine for this but I understand why they changed it. "soft-yanking" for cases like this would be great, I never encountered one where the gem had to actually be removed completely. |
|
Maybe it's time for test-unit to stop depending on power_assert: ruby/power_assert#61 (comment) |
plain |
power_assert 3.0 now uses pattern matching: ruby/power_assert#57.
This causes it to be half defined on Ruby 3.0 and older.