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 #137

Open
wants to merge 7 commits into
base: main
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
2 changes: 1 addition & 1 deletion lib/sendcloud.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "faraday"
require "faraday_middleware"
require "faraday/follow_redirects"
require "sendcloud/version"

module Sendcloud
Expand Down
2 changes: 1 addition & 1 deletion lib/sendcloud/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def service_point

def connection
@connection ||= Faraday.new(BASE_URL) do |conn|
conn.request :basic_auth, api_key, api_secret
conn.request :authorization, :basic, api_key, api_secret
conn.request :json
conn.response :json, content_type: "application/json"
conn.adapter adapter, @stubs
Expand Down
2 changes: 1 addition & 1 deletion lib/sendcloud/service_point_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def service_point
def connection
@connection ||= Faraday.new(BASE_URL) do |conn|
conn.request :authorization, :AccessToken, api_key
conn.use FaradayMiddleware::FollowRedirects, {clear_authorization_header: false}
conn.response :follow_redirects, {clear_authorization_header: false}
conn.request :json
conn.response :json, content_type: "application/json"
conn.adapter adapter, @stubs
Expand Down
4 changes: 2 additions & 2 deletions sendcloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
end

spec.require_paths = ["lib"]
spec.add_dependency "faraday"
spec.add_dependency "faraday_middleware"
spec.add_dependency "faraday", ">= 2.0.1"
spec.add_dependency "faraday-follow_redirects"

spec.add_development_dependency "standard"
end