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

Fails on frozen strings. #99

Open
beporter opened this issue Jan 20, 2022 · 0 comments
Open

Fails on frozen strings. #99

beporter opened this issue Jan 20, 2022 · 0 comments

Comments

@beporter
Copy link

[1] pry(main)> Phoner::Phone.parse('+1-309-456-7890'.freeze)
FrozenError: can't modify frozen String: "+1-309-456-7890"
from /bundler/ruby/2.7.0/gems/phone-1.2.3/lib/phone.rb:170:in `sub!'

This is on version 1.2.0.

parse() could probably call string.dup to create its own internal mutable copy of the input.

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

No branches or pull requests

1 participant