Skip to content

Commit

Permalink
Allow faraday-net_http up to v3.1
Browse files Browse the repository at this point in the history
Version 3.0 of `faraday-net_http` uses the new streaming API and the new `finished` option in `save_response`, which are not available in `faraday` prior to version 2.5, and has therefore been released as a new major version.

To avoid the same issue in future, we're fixing the version to allow any 3.0.x version, but not 3.1+.
This will allow us to ship a minor versions of the adapter with "breaking" changes for older versions of Faraday.
  • Loading branch information
iMacTia committed Aug 8, 2022
1 parent 591b58f commit 646c30b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion faraday.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.6'

spec.add_dependency 'faraday-net_http', '~> 2.0'
# faraday-net_http is the "default adapter", but being a Faraday dependency it can't
# control which version of faraday it will be pulled from.
# To avoid releasing a major version every time there's a new Faraday API, we should
# always fix its required version to the next MINOR version.
# This way, we can release minor versions of the adapter with "breaking" changes for older versions of Faraday
# and then bump the version requirement on the next compatible version of faraday.
spec.add_dependency 'faraday-net_http', '>= 2.0', '< 3.1'
spec.add_dependency 'ruby2_keywords', '>= 0.0.4'

# Includes `examples` and `spec` to allow external adapter gems to run Faraday unit and integration tests
Expand Down

0 comments on commit 646c30b

Please sign in to comment.