Skip to content

Commit af13607

Browse files
soberstadtckoegel
andauthored
Support Faraday 2.x (#53)
* Support Faraday 2.x * update version Co-authored-by: Cameron Koegel <[email protected]>
1 parent 67c750f commit af13607

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

bandwidth.gemspec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
Gem::Specification.new do |s|
22
s.name = 'bandwidth-sdk'
3-
s.version = '9.4.0'
3+
s.version = '9.4.1'
44
s.summary = 'Bandwidth'
55
s.description = 'The official client SDK for Bandwidht\'s Voice, Messaging, MFA, and WebRTC APIs'
66
s.authors = ['Bandwidth']
77
s.email = '[email protected]'
88
s.homepage = 'https://github.com/Bandwidth/ruby-sdk'
99
s.license = 'MIT'
1010
s.add_dependency('logging', '~> 2.3')
11-
s.add_dependency('faraday', '~> 1.0', '<= 1.9.3')
12-
s.add_dependency('faraday_middleware', '~> 1.0')
11+
s.add_dependency('faraday', '>= 1.0', '< 3.0')
12+
s.add_dependency('faraday-follow_redirects', '~> 0.3')
13+
s.add_dependency('faraday-gzip', '~> 0.1.0')
14+
s.add_dependency('faraday-multipart', '~> 1.0')
15+
s.add_dependency('faraday-retry', '~> 1.0')
1316
s.add_dependency('certifi', '~> 2018.1', '>= 2018.01.18')
1417
s.add_dependency('faraday-http-cache', '~> 2.2')
1518
s.add_dependency('builder', '~> 3.2.4')
1619
s.add_development_dependency('minitest', '~> 5.14', '>= 5.14.1')
1720
s.add_development_dependency('minitest-proveit', '~> 1.0')
21+
s.add_development_dependency('test-unit')
1822
s.required_ruby_version = ['>= 2.0']
1923
s.files = Dir['{bin,lib,man,test,spec}/**/*', 'README*', 'LICENSE*']
2024
s.require_paths = ['lib']

lib/bandwidth/http/faraday_client.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
# This file was automatically generated by APIMATIC v2.0
44
# ( https://apimatic.io ).
55

6+
require 'faraday/follow_redirects'
7+
require 'faraday/gzip'
68
require 'faraday/http_cache'
7-
require 'faraday_middleware'
9+
require 'faraday/multipart'
10+
require 'faraday/retry'
811

912
module Bandwidth
1013
# An implementation of HttpClient.
@@ -15,8 +18,8 @@ def initialize(timeout:, max_retries:, retry_interval:,
1518
cache: false, verify: true)
1619
@connection = Faraday.new do |faraday|
1720
faraday.use Faraday::HttpCache, serializer: Marshal if cache
18-
faraday.use FaradayMiddleware::FollowRedirects
19-
faraday.use :gzip
21+
faraday.use Faraday::FollowRedirects::Middleware
22+
faraday.request :gzip
2023
faraday.request :multipart
2124
faraday.request :url_encoded
2225
faraday.ssl[:ca_file] = Certifi.where

0 commit comments

Comments
 (0)