Enable Frozen String Literal in production code#782
Open
Conversation
Collaborator
Author
|
I'm a little bit surprised about Wasn't expecting this to pass on Ruby < 3.0 🤔 No, this is not surprising at all. |
2bcee11 to
ac81a5a
Compare
ac81a5a to
0046d19
Compare
0046d19 to
a0aac9d
Compare
There was a problem hiding this comment.
Pull request overview
This pull request enables frozen string literals in all production code files by adding the # frozen_string_literal: true magic comment at the top of each Ruby file in the lib/ directory. This is a best practice in modern Ruby that improves performance and memory usage by preventing string literals from being modified.
Changes:
- Added
# frozen_string_literal: truecomment to all 18 Ruby files in thelib/directory - Removed redundant
.freezecall on a string literal inlib/rabl/helpers.rb(line 133) - Updated CHANGELOG.md to document the frozen string literal support
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/rabl.rb | Added frozen string literal pragma |
| lib/rabl/builder.rb | Added frozen string literal pragma |
| lib/rabl/cache_engine.rb | Added frozen string literal pragma |
| lib/rabl/configuration.rb | Added frozen string literal pragma |
| lib/rabl/digestor.rb | Added frozen string literal pragma |
| lib/rabl/digestor/rails3.rb | Added frozen string literal pragma |
| lib/rabl/digestor/rails41.rb | Added frozen string literal pragma |
| lib/rabl/digestor/rails5.rb | Added frozen string literal pragma |
| lib/rabl/engine.rb | Added frozen string literal pragma |
| lib/rabl/helpers.rb | Added frozen string literal pragma and removed redundant .freeze call |
| lib/rabl/multi_builder.rb | Added frozen string literal pragma |
| lib/rabl/partials.rb | Added frozen string literal pragma |
| lib/rabl/railtie.rb | Added frozen string literal pragma |
| lib/rabl/renderer.rb | Added frozen string literal pragma |
| lib/rabl/sources.rb | Added frozen string literal pragma |
| lib/rabl/template.rb | Added frozen string literal pragma |
| lib/rabl/tracker.rb | Added frozen string literal pragma |
| lib/rabl/version.rb | Added frozen string literal pragma |
| CHANGELOG.md | Added entry for version 0.18.0 documenting frozen string literal support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #780