lostisland / faraday-net_http_persistent

Faraday Adapter for NetHttpPersistent
MIT License
12 stars 9 forks source link

Prepare this adapter for Faraday 2.0 #7

Closed mattbrictson closed 3 years ago

mattbrictson commented 3 years ago

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:

  1. Remove the 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.
  2. Add faraday-net_http as an explicit dependency. The faraday-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.
  3. Change the installation instructions. All a user needs to do now is install faraday-net_http_persistent. All other dependencies will be included automatically.
mattbrictson commented 3 years ago

Thanks! I left off these things out of this PR because they aren't strictly related to Faraday 2.0 compatibility:

But I think those are worthwhile improvements and we should cherry-pick those from #8. As a follow-up PR.

olleolleolle commented 3 years ago

@mattbrictson I began taking some of these steps, so watch this space.

olleolleolle commented 3 years ago

11

10

9