generated from lostisland/faraday-adapter-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare this adapter for Faraday 2.0 (#7)
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.
- Loading branch information
1 parent
5b06f0d
commit f2f24c3
Showing
4 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
# TODO: remove this once v4 is released | ||
options = (RUBY_VERSION.start_with?("3") ? {github: "grosser/net-http-persistent", branch: "grosser/spec"} : {}) | ||
gem "net-http-persistent", ">= 3.1", **options | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters