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

The change made in 0.15.4 breaks httparty if frozen_string_literal is set to true #539

Closed
gator-mk opened this issue May 17, 2017 · 3 comments · Fixed by #540
Closed

The change made in 0.15.4 breaks httparty if frozen_string_literal is set to true #539

gator-mk opened this issue May 17, 2017 · 3 comments · Fixed by #540

Comments

@gator-mk
Copy link

The change made in 2f80938 breaks our builds because of the use of gsub!

RuntimeError:
       can't modify frozen String
     # ./vendor/bundle/ruby/2.3.0/gems/httparty-0.15.4/lib/httparty/parser.rb:105:in `gsub!'
     # ./vendor/bundle/ruby/2.3.0/gems/httparty-0.15.4/lib/httparty/parser.rb:105:in `parse'
     # ./vendor/bundle/ruby/2.3.0/gems/httparty-0.15.4/lib/httparty/parser.rb:67:in `call'
     # ./vendor/bundle/ruby/2.3.0/gems/httparty-0.15.4/lib/httparty/request.rb:383:in `parse_response'
     # ./vendor/bundle/ruby/2.3.0/gems/httparty-0.15.4/lib/httparty/request.rb:351:in `block in handle_response'
     # ./vendor/bundle/ruby/2.3.0/gems/httparty-0.15.4/lib/httparty/response.rb:25:in `parsed_response'
     # ./vendor/bundle/ruby/2.3.0/gems/httparty-0.15.4/lib/httparty/response.rb:88:in `method_missing'

We use Ruby 2.3.3 with the # frozen_string_literal: true magic comment in preparation for immutable strings in Ruby 3.0

@rsullivan00
Copy link
Contributor

Can you give this branch a try to verify it fixes your use case? #540

jnunemaker added a commit that referenced this issue May 18, 2017
[#539] Use non-destructive gsub, fix test stubbing
@jnunemaker
Copy link
Owner

Merged the PR. I'll wait up to a day to cut a new release to ensure that this fixes the problem.

@gator-mk
Copy link
Author

@rsullivan00 That does the trick. Thank you both 👍

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 a pull request may close this issue.

3 participants