Skip to content

Avoid HTTParty deprecation warnings on #nil? - #21

Merged
monikaamalik merged 1 commit into
NeverBounce:masterfrom
undees:undees/avoid-httparty-deprecation-warning
Nov 13, 2025
Merged

Avoid HTTParty deprecation warnings on #nil?#21
monikaamalik merged 1 commit into
NeverBounce:masterfrom
undees:undees/avoid-httparty-deprecation-warning

Conversation

@undees

@undees undees commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

Fixes #20.

The old version of HTTParty::Response implements a custom implementation of #nil? that checks various properties of the body and raw response object. However, the project is interested in removing this method so that the class will behave more like other Ruby classes. (See jnunemaker/httparty#568.) In the meantime, they've put in a deprecation warning for anyone relying on the old custom behaviour.

The neverbounce-api gem isn't doing anything wrong by calling #nil? in the implementation of #require_attr, but by bad luck it's running afoul of the deprecation warning.

This PR works around the warning by calling == nil instead of #.nil? on the attribute's value.

@undees

undees commented Aug 12, 2025

Copy link
Copy Markdown
Contributor Author

See also #22 for running and testing this PR's code on a newer Ruby version.

@monikaamalik
monikaamalik merged commit ec56d81 into NeverBounce:master Nov 13, 2025
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.

Deprecation warning "HTTParty will no longer override response#nil?"

2 participants