-
Notifications
You must be signed in to change notification settings - Fork 21
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
Handle frozen string deprecations from ruby 3.4.1 #545
Handle frozen string deprecations from ruby 3.4.1 #545
Conversation
👷 Deploy request for govuk-form-builder pending review.Visit the deploys page to approve it
|
427314d
to
14d039d
Compare
Hi @peteryates, Not sure if this is too early but, aside from the code coverage issue, it looks like this small change works and should remove the deprecation warnings we are seeing on our CI against ruby 3.4.1. |
Looks great, thanks @jsugarman! Left a comment but other than that happy to accept. |
OpenStruct has been deprecated in 3.4 and will been removed from ruby stdlib in 3.5. see [github issue](dependabot/dependabot-core#11163)
Add the frozen_string_literal to force failures then fix. `receiver.concat` will mutate the receiver which is deprecated in 3.4 and will error, by default, in ruby 3.5. `target.prepend('#')` will not mutate the prefix string.
14d039d
to
1b6f202
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.
Looks great!
Can we just update the supported versions in the README and the guide's supported versions page and we can get this merged 🙂
Noticed the badge for ruby was 3.2.6 so have amended inline with current latest patch level for 3.2.
I think that covers the supported version changes🤞. I also bumped ruby 3.2 to latest patch when i noticed the ruby badge already mentioned 3.2.6. |
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.
Amazing, thank you 🚀
Handle frozen string deprecations from ruby 3.4.1
receiver.concat
will mutate the receiver which is deprecated in 3.4 andwill error, by default, in ruby 3.5.
target.prepend('#')
will not mutate theprefix string, thereby avoiding the problem.
Identified on CI for consuming app
This adds the
frozen_string_literal: true
directive explicitly to cause the failure and then fixes.