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

Not compatible with frozen_string_literal: true #22

Closed
stex opened this issue Aug 20, 2017 · 2 comments
Closed

Not compatible with frozen_string_literal: true #22

stex opened this issue Aug 20, 2017 · 2 comments
Labels

Comments

@stex
Copy link

stex commented Aug 20, 2017

The gem in its current form is not compatible with frozen string literals as destructive methods like gsub! are used.

Here is an example:

# frozen_string_literal: true
FacebookAds::AdAccount.get('act_12345', 'name)

#=> RuntimeError: can't modify frozen String
#=> from .../gems/facebookads-0.2.10.0/lib/facebook_ads/session.rb:39:in `gsub!'

Immutable string literals will be the default in ruby 3, so it might be a good idea to already stop using destructive string methods.

Edit: It gets better as of course things like the following won't work either, as the result is already immutable without any additional magic comment:

FacebookAds::AdAccount.get(ENV['FB_AD_ACCOUNT_ID'], 'name)

It's generally bad practice to mutate an input parameter like this.

@stale
Copy link

stale bot commented Jan 14, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Jan 14, 2020
@stale
Copy link

stale bot commented Jan 21, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant