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

Allow for frozen string literals. #2352

Open
wants to merge 1 commit into
base: stable
from

Conversation

Projects
None yet
1 participant
@pat

pat commented Jul 22, 2017

These changes get the tests passing when `RUBYOPT="--enable-frozen-string-literal" is set for MRI 2.4.

  • There are no behaviour changes here - just modifications of string literal usage.
  • I've opted for dup over String.new - in other patches I've been submitting around this, some maintainers have expressed a strong preference for the former. I'm happy to switch my changes here to String.new though if you'd prefer that!
  • You're using an old version of rubocop, which is not frozen-string-literal friendly. Even with the latest versions, they're reliant on parser (which isn't, but there's a pending PR), which in turn is reliant on racc (which isn't, and there are some incomplete/forgotten PRs). This means enabling the RUBYOPT flag for MRI 2.4+ isn't going to be an option, unfortunately.
  • You're also using an old version of Yard - it should be frozen-string-literal friendly as of 0.9.6.
  • I haven't added the pragma comments at the top of all files - though I can do that if you'd like (as a separate PR).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment