-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
parts.rb: Use a mutable string #70
Conversation
Supports --enable-frozen-string-literal.
I got curious https://ruby-doc.org/core-2.3.0/String.html#method-i-2B-40 I Think Ruby 2.0 should be gone, but maybe this is the feedback this needs? This library in Travis, was supporting (5 months ago build); Some quite old versions of Ruby. I saw someone make an interesting commit elsewhere which was to have Ruby 2.5 do something with frozen string literals. I Do not understand this in a robust way. Does this help? |
I think I slightly prefer |
Anything older than Ruby 2.3 we definitely don't care about. Anything older than Ruby 2.6 I'm okay with dropping if it's inconvenient. |
I got 2.5-3.0 working with some playing around on a less tired brain |
@olleolleolle will very likely have improvements to my takes on their code.
Now I have green and I understand this better, the only thing I'm a little upset about is that the library requires downstream consumers to Might there be patterns where we can receive the string, and only mutate within this library; so that read is safe. Otherwise it feels like |
@Lewiscowles1986 👋 Hi! The --enable-frozen-string-literal is a sort of "nod to the future" where Ruby strings may become immutable. https://freelancing-gods.com/2017/07/27/an-introduction-to-frozen-string-literals.html is a nice blog post where Pat, an activist for "frozen string literals" to happen, describes the feature a little. Nice to see you again, and I hope you had some fun! |
Description
Use an explicitly mutable string, to support
RUBYOPT=--enable-frozen-string-literal
I ran into it when trying to get support for that in octokit.rb, and into github-changelog-generator.
https://github.com/octokit/octokit.rb/pull/1354/checks?check_run_id=3298433252
Types of Changes
Testing
Would it be OK to add the RUBYOPT setting mentioned above to CI? Oh, we don't have a running CI, I logged #71.