From c6b9f63ee562ea0a344adc6d902afcecf605b0d7 Mon Sep 17 00:00:00 2001 From: Jon M Date: Mon, 30 May 2022 10:27:57 +0100 Subject: [PATCH] Update dependencies --- lib/mailosaur.rb | 11 ++++++++++- mailosaur.gemspec | 10 +++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/mailosaur.rb b/lib/mailosaur.rb index b4b7457..f5c9a3c 100644 --- a/lib/mailosaur.rb +++ b/lib/mailosaur.rb @@ -99,7 +99,16 @@ def connection content_type: 'application/json; charset=utf-8', user_agent: "mailosaur-ruby/#{Mailosaur::VERSION}" } - }).tap { |conn| conn.request(:basic_auth, @api_key, '') } + }).tap do |conn| + case Faraday::VERSION + when /^0/ + conn.basic_auth @api_key, '' + when /^1/ + conn.request(:basic_auth, @api_key, '') + else + conn.request(:authorization, :basic, @api_key, '') + end + end end def handle_http_error(response) diff --git a/mailosaur.gemspec b/mailosaur.gemspec index 3a28326..6101e6b 100644 --- a/mailosaur.gemspec +++ b/mailosaur.gemspec @@ -21,12 +21,12 @@ Gem::Specification.new do |s| } s.files = Dir['LICENSE', 'README.md', 'lib/mailosaur.rb', 'lib/**/*'] - s.add_dependency 'faraday', '>= 0.9', '< 2' + s.add_dependency 'faraday', '>= 2.0', '< 3' s.add_dependency 'json', '>= 1.7.5', '< 4' - s.add_development_dependency 'mail', '~> 2.6', '>= 2.6.1' + s.add_development_dependency 'mail', '~> 2.7', '>= 2.7.1' s.add_development_dependency 'rake', '~> 13.0' - s.add_development_dependency 'rubocop', '~> 1.19.0' - s.add_development_dependency 'shoulda-context', '~> 1.2', '>= 1.2.2' - s.add_development_dependency 'test-unit', '~> 3.2', '>= 3.2.7' + s.add_development_dependency 'rubocop', '~> 1.30.0' + s.add_development_dependency 'shoulda-context', '~> 2.0', '>= 2.0.0' + s.add_development_dependency 'test-unit', '~> 3.5', '>= 3.5.3' end