Skip to content
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

Avoid modifying string literals #91

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

danielmorrison
Copy link
Contributor

I was running in an environment where strings are frozen by default (using RUBYOPT="--enable=frozen-string-literal") and was getting exceptions.

Switching to String.new avoids this issue, without changing functionality.

Before this PR, running tests using RUBYOPT="--enable=frozen-string-literal rake on this repo fails. After, it passes.

When used in an environment frozen string literals (for example: RUBYOPT="--enable=frozen-string-literal") modifying "" raises exceptions. This fixes that, by switching to String.new.
Copy link

@frederikspang frederikspang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We have applied same changes.

Any chance of getting this merged soon?

@thibaudgg thibaudgg merged commit 0aacc3c into guard:master Aug 29, 2022
@thibaudgg
Copy link
Member

Thanks for the PR, version 0.11.2 has been released.

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.

None yet

3 participants