Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Faraday v2 #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions lib/plivo/base_client.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'json'
require 'faraday'
require 'faraday_middleware'

require_relative 'exceptions'
require_relative 'utils'
Expand Down Expand Up @@ -137,7 +136,7 @@ def configure_connection
# DANGER: Basic auth should always come after headers, else
# The headers will replace the basic_auth

faraday.request(:basic_auth, auth_id, auth_token)
faraday.request(:authorization, :basic, auth_id, auth_token)

faraday.proxy=@proxy_hash if @proxy_hash
faraday.response :json, content_type: /\bjson$/
Expand All @@ -150,7 +149,7 @@ def configure_connection
# DANGER: Basic auth should always come after headers, else
# The headers will replace the basic_auth

faraday.request(:basic_auth, auth_id, auth_token)
faraday.request(:authorization, :basic, auth_id, auth_token)

faraday.proxy=@proxy_hash if @proxy_hash
faraday.response :json, content_type: /\bjson$/
Expand All @@ -163,7 +162,7 @@ def configure_connection
# DANGER: Basic auth should always come after headers, else
# The headers will replace the basic_auth

faraday.request(:basic_auth, auth_id, auth_token)
faraday.request(:authorization, :basic, auth_id, auth_token)

faraday.proxy=@proxy_hash if @proxy_hash
faraday.response :json, content_type: /\bjson$/
Expand All @@ -176,7 +175,7 @@ def configure_connection
# DANGER: Basic auth should always come after headers, else
# The headers will replace the basic_auth

faraday.request(:basic_auth, auth_id, auth_token)
faraday.request(:authorization, :basic, auth_id, auth_token)

faraday.proxy=@proxy_hash if @proxy_hash
faraday.response :json, content_type: /\bjson$/
Expand All @@ -189,7 +188,7 @@ def configure_connection
# DANGER: Basic auth should always come after headers, else
# The headers will replace the basic_auth

faraday.request(:basic_auth, auth_id, auth_token)
faraday.request(:authorization, :basic, auth_id, auth_token)

faraday.proxy=@proxy_hash if @proxy_hash
faraday.response :json, content_type: /\bjson$/
Expand All @@ -202,7 +201,7 @@ def configure_connection
# DANGER: Basic auth should always come after headers, else
# The headers will replace the basic_auth

faraday.request(:basic_auth, auth_id, auth_token)
faraday.request(:authorization, :basic, auth_id, auth_token)

faraday.proxy=@proxy_hash if @proxy_hash
faraday.response :json, content_type: /\bjson$/
Expand Down Expand Up @@ -255,7 +254,7 @@ def send_post(resource_path, data, timeout, use_multipart_conn, options = nil)

faraday.request :multipart
faraday.request :url_encoded
faraday.request(:basic_auth, auth_id, auth_token)
faraday.request(:authorization, :basic, auth_id, auth_token)

faraday.proxy=@proxy_hash if @proxy_hash
faraday.response :json, content_type: /\bjson$/
Expand Down
1 change: 0 additions & 1 deletion lib/plivo/resources/call_feedback.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'json'
require 'faraday'
require 'faraday_middleware'

module Plivo
module Resources
Expand Down
3 changes: 1 addition & 2 deletions plivo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.0.0'

spec.add_dependency 'faraday', '~> 1.0'
spec.add_dependency 'faraday_middleware', '~> 1.0'
spec.add_dependency 'faraday', '~> 2.0'
spec.add_dependency 'htmlentities'
spec.add_dependency 'jwt'

Expand Down