Skip to content

Conversation

@moznion
Copy link

@moznion moznion commented Nov 6, 2025

Issue # (if available)

n/a

Description of changes

I encountered the following warning message in my application with Ruby 3.4.7:

/opt/bundle-cache/ruby/3.4.0/gems/symmetric-encryption-4.6.0/lib/symmetric_encryption/header.rb:11: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information)

The reason for this warning is that Ruby 3.4 has begun to issue warnings for string mutations.

ref:

String literals in files without a frozen_string_literal comment now emit a deprecation warning when they are mutated. These warnings can be enabled with -W:deprecated or by setting Warning[:deprecated] = true. To disable this change, you can run Ruby with the --disable-frozen-string-literal command line argument.

https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/

This pull request introduces support for frozen string literals as follows:

  • Add # frozen_string_literal: true to all Ruby files
  • Fix string mutations to ensure compatibility with frozen strings

This change improves memory efficiency and performance by making all string literals immutable by default, aligning with modern Ruby standards.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- Add frozen_string_literal: true to all Ruby files
- Fix string mutations to work with frozen strings

This change improves memory efficiency and performance by making
all string literals frozen by default, which is becoming the
standard in modern Ruby versions.

Signed-off-by: moznion <moznion@mail.moznion.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant