-
Notifications
You must be signed in to change notification settings - Fork 26
Declare required_ruby_version to be Ruby 3.1
#61
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
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.
|
Thanks for reporting! For now, I'd prefer not to define I guess the following patch resolves the issue. I'll check it later. diff --git i/lib/power_assert.rb w/lib/power_assert.rb
index 8de209e..0be9b5d 100644
--- i/lib/power_assert.rb
+++ w/lib/power_assert.rb
@@ -17,6 +17,7 @@
raise LoadError, 'Fully compatible TracePoint API required'
end
+require 'power_assert/parser'
require 'power_assert/context'
require 'power_assert/configuration'
require 'power_assert/version' |
|
I don't entirely understand your reasoning. This gem does not work on older rubies, why allow installating it on them? By specifying it, older versions will be resolved that actually work on the ruby version that the user is running. It's true that practically
I'd still have to apply workarounds like @byroot did with ruby/json@2b8f853 or simply skip the gem entirely. |
|
If you are dead-set on not specifying it, an early return in the entrypoint like |
|
The lack of On 2.5: On 2.7:
I think most users of |
* See ruby/power_assert#61 * Same approach as ruby/irb#1135
This is only documented in the Readme.
3.0.0 now depends on pattern matching, which is (partially) invalid syntax on 2.7. The
test-unitgem depends onpower_assertand tries to handle that by catchingSyntaxError: 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 thePowerAssertmodule behind, among other things.test-unitcleans that up via test-unit/test-unit#329 but there are other side-effects it can do nothing about.For example, an undefined
newmethod: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.