No release in over a year
Faraday 2.x compatible extraction of FaradayMiddleware::FollowRedirects.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 13.0
~> 3.0
~> 1.25.0
~> 0.21.0
~> 3.14.0
~> 2.4

Runtime

>= 1, < 3
 Project Readme

Faraday Follow Redirects

GitHub Workflow Status Gem License

Faraday 2.x compatible extraction of FaradayMiddleware::FollowRedirects. This gem will also work with Faraday 1.x, to support gem codebases which can work with Faraday 1.x or 2.x. For the former standard version of this middleware for Faraday 1.x, check out https://github.com/lostisland/faraday_middleware. Faraday 1.x support is considered deprecated, please update to Faraday 2.x.

This gem is based on the deprecated FaradayMiddleware::FollowRedirects (v1.2.0).

We only support non-EOL versions of Ruby. See Ruby Maintenance Branches for the list of non-EOL Rubies.

Installation

Add this line to your application's Gemfile:

gem 'faraday-follow_redirects'

And then execute:

bundle install

Or install it yourself as:

gem install faraday-follow_redirects

Usage

require 'faraday/follow_redirects'

Faraday.new(url: url) do |faraday|
  faraday.response :follow_redirects # use Faraday::FollowRedirects::Middleware
  faraday.adapter Faraday.default_adapter
end

Upgrading from Faraday 1.x

If you still use Faraday 1.x, and have uninstalled the faraday_middleware gem, all you have to change is:

- conn.use FaradayMiddleware::FollowRedirects
+ conn.use Faraday::FollowRedirects::Middleware

Development

After checking out the repo, run bin/setup to install dependencies.

Then, run bin/test to run the tests.

To install this gem onto your local machine, run rake build.

To release a new version, make a commit with a message such as "Bumped to 0.0.2" and then run rake release. See how it works here.

Appraisal for testing multiple versions of dependencies

We use appraisal to test against both faraday 1.x and 2.x, and ./bin/test will run tests against both. To run tests against just one you could:

bundle exec appraisal faraday_1 rspec
bundle exec appraisal faraday_2 rspec

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.