From f1f8dd5fdf37427a8308c00013334b70a0770256 Mon Sep 17 00:00:00 2001 From: Christian Gregg Date: Wed, 2 Oct 2019 17:38:33 +0100 Subject: [PATCH 1/2] Fallback to :response_body if :body is not set Faraday 0.16.x changed the key names, this should allow us to support both 0.15.x and 0.16.x for now --- lib/faraday/http_cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/faraday/http_cache.rb b/lib/faraday/http_cache.rb index e33bb75..df502e3 100644 --- a/lib/faraday/http_cache.rb +++ b/lib/faraday/http_cache.rb @@ -297,7 +297,7 @@ def create_response(env) { status: hash[:status], - body: hash[:body], + body: hash[:body] || hash[:response_body], response_headers: hash[:response_headers] } end From 88772d9349645f873f5db6b787ddf810a860486f Mon Sep 17 00:00:00 2001 From: Christian Gregg Date: Tue, 24 Mar 2020 09:42:09 +0000 Subject: [PATCH 2/2] Add faraday 1.0.0 to build matrix --- .travis.yml | 1 + faraday-http-cache.gemspec | 2 +- gemfiles/Gemfile.faraday-1.0 | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gemfiles/Gemfile.faraday-1.0 diff --git a/.travis.yml b/.travis.yml index 549d34e..5a843d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,4 +16,5 @@ notifications: secure: Ri3bGJvNKfZ6ynbHcbICknWaAJFbQPlGQE9YSY9xMB7rGomsofY4yS8yf17WlSTd2MqxhzMXgbqXfkQW759Opknw75URo8tLTnSlpJsVSqV7T4dUsfNZguyQElVZMxYacFbBZEJGBdz2Ra6xbMBdg8NqVACb65I2xeK2fsvm77k= gemfile: - gemfiles/Gemfile.faraday-0.8 + - gemfiles/Gemfile.faraday-1.0 - Gemfile diff --git a/faraday-http-cache.gemspec b/faraday-http-cache.gemspec index 75c1c9c..880016e 100644 --- a/faraday-http-cache.gemspec +++ b/faraday-http-cache.gemspec @@ -15,5 +15,5 @@ Gem::Specification.new do |gem| gem.executables = [] gem.required_ruby_version = '>= 2.1.0' - gem.add_dependency 'faraday', '~> 0.8' + gem.add_dependency 'faraday', '>= 0.8' end diff --git a/gemfiles/Gemfile.faraday-1.0 b/gemfiles/Gemfile.faraday-1.0 new file mode 100644 index 0000000..e4afeaf --- /dev/null +++ b/gemfiles/Gemfile.faraday-1.0 @@ -0,0 +1,12 @@ +source 'http://rubygems.org' + +gem 'faraday-http-cache', path: '..' + +gem 'faraday', '1.0.0' +gem 'faraday_middleware', '1.0.0.rc1' + +gem 'em-http-request', '~> 1.1' +gem 'rspec', '~> 3.1' +gem 'rake', '~> 12.0' +gem 'activesupport', '>= 5.0' +gem 'sinatra', '~> 2.0'