Prepare this adapter for Faraday 2.0 #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Faraday 2.0, adapters will be completely opt-in. As a consequence, this adapter can now have a hard dependency on
net_http_persistent
. If a user has opted into adding this adapter to their Gemfile, we know they will be using it.Thus this PR can make the following changes:
dependency "net/http/persistent"
declaration. This existed to support loading dependencies on demand, based on what adapter is being used. Since adapters are now explicitly opt-in, this is no longer needed.faraday-net_http
as an explicit dependency. Thefaraday-net_http_persistent
adapter subclasses the net_http one. Previously the net_http adapter was part of Faraday core. As of 2.0 it is packaged as a separate gem, so we need to declare it as a dependency.faraday-net_http_persistent
. All other dependencies will be included automatically.