-
Notifications
You must be signed in to change notification settings - Fork 142
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
Ruby 2.3 preparedness #335
Comments
One thing to consider is that we need to make sure the string coming back from a string filter is mutable. That would be an unexpected surprise for people. |
Instead of adding the pragma, why don't we |
On second thought, freezing every string is going to be super annoying. They are created in a variety of ways that are hard to grep for. You've got normal string literals, which can be delimited with That being said, I think we should benchmark our codebase against 2.3 with and without frozen strings. It might not make much of a difference. |
With 2.3 around the corner we need to make sure the code works. Right now all tests pass in 2.3 (run locally) and I don't see anything that should cause us problems. We need to make sure 2.3 is added to our Travis CI runs when it becomes available.
Ruby 2.3 is introducing a pragma to make all strings immutable by default. The though is that by Ruby 3 this will be standard. It works by adding
# frozen_string_literal: true
to the top of the file. Then all strings created using single or double quotes are immutable. If you need a mutable string it will need to be created usingString.new
.I would like to adopt the new pragma so that people using 2.3 can get the performance benefit and we're ready for Ruby 3 ahead of time. @tfausak thoughts?
The text was updated successfully, but these errors were encountered: