From 06a7b55ffc4fa47e033cce1db458d516db8b85b6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Orban Date: Wed, 27 Nov 2024 09:57:14 +0100 Subject: [PATCH 1/7] remove Gemfile.lock from .gitignore file --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e111242..d1249f7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ .bundle .config .yardoc -Gemfile.lock InstalledFiles _yardoc coverage @@ -16,4 +15,4 @@ test/tmp test/version_tmp tmp .idea/** -.idea \ No newline at end of file +.idea From e156d4444a4eaa57861f40fbfc0946a2ae037499 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Orban Date: Wed, 27 Nov 2024 10:18:08 +0100 Subject: [PATCH 2/7] upgrade to faraday v2 --- lib/sendcloud.rb | 2 +- lib/sendcloud/client.rb | 2 +- lib/sendcloud/service_point_client.rb | 2 +- sendcloud.gemspec | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sendcloud.rb b/lib/sendcloud.rb index 82ff927..59a928b 100644 --- a/lib/sendcloud.rb +++ b/lib/sendcloud.rb @@ -1,5 +1,5 @@ require "faraday" -require "faraday_middleware" +require "faraday/follow_redirects" require "sendcloud/version" module Sendcloud diff --git a/lib/sendcloud/client.rb b/lib/sendcloud/client.rb index 1125a25..da8a12f 100644 --- a/lib/sendcloud/client.rb +++ b/lib/sendcloud/client.rb @@ -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 diff --git a/lib/sendcloud/service_point_client.rb b/lib/sendcloud/service_point_client.rb index 3c94e5e..aa88a0c 100644 --- a/lib/sendcloud/service_point_client.rb +++ b/lib/sendcloud/service_point_client.rb @@ -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} # Faraday v2 conn.request :json conn.response :json, content_type: "application/json" conn.adapter adapter, @stubs diff --git a/sendcloud.gemspec b/sendcloud.gemspec index 1aca50b..0e34de8 100644 --- a/sendcloud.gemspec +++ b/sendcloud.gemspec @@ -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" + spec.add_dependency "faraday-follow_redirects" spec.add_development_dependency "standard" end From e42266bce83c8e8688f28b7bf4f068f8b628658a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Orban Date: Wed, 27 Nov 2024 10:18:14 +0100 Subject: [PATCH 3/7] add Gemfile.lock --- Gemfile.lock | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..5710e85 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,76 @@ +PATH + remote: . + specs: + sendcloud-ruby (3.0.0) + faraday (~> 2) + faraday-follow_redirects + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + faraday (2.12.1) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + json (2.8.2) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) + logger (1.6.1) + minitest (5.25.2) + net-http (0.5.0) + uri + parallel (1.26.3) + parser (3.3.6.0) + ast (~> 2.4.1) + racc + racc (1.8.1) + rainbow (3.1.1) + rake (13.2.1) + regexp_parser (2.9.2) + rubocop (1.68.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.36.1) + parser (>= 3.3.1.0) + rubocop-performance (1.22.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (1.13.0) + standard (1.42.1) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.68.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.5) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.5.0) + lint_roller (~> 1.1) + rubocop-performance (~> 1.22.0) + unicode-display_width (2.6.0) + uri (1.0.2) + +PLATFORMS + arm64-darwin-23 + +DEPENDENCIES + minitest (~> 5.0) + rake (~> 13.0) + sendcloud-ruby! + standard + +BUNDLED WITH + 2.4.19 From 23ebf32fdefc000ca3a45b8ba91e108f974886b5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Orban Date: Wed, 27 Nov 2024 10:24:14 +0100 Subject: [PATCH 4/7] remove comment --- lib/sendcloud/service_point_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sendcloud/service_point_client.rb b/lib/sendcloud/service_point_client.rb index aa88a0c..3a67845 100644 --- a/lib/sendcloud/service_point_client.rb +++ b/lib/sendcloud/service_point_client.rb @@ -19,7 +19,7 @@ def service_point def connection @connection ||= Faraday.new(BASE_URL) do |conn| conn.request :authorization, :AccessToken, api_key - conn.response :follow_redirects, {clear_authorization_header: false} # Faraday v2 + conn.response :follow_redirects, {clear_authorization_header: false} conn.request :json conn.response :json, content_type: "application/json" conn.adapter adapter, @stubs From 4b6043b0f5d147be61d59d31f63c1924cc3e88aa Mon Sep 17 00:00:00 2001 From: Pierre-Yves Orban Date: Wed, 27 Nov 2024 10:28:43 +0100 Subject: [PATCH 5/7] Revert "remove Gemfile.lock from .gitignore file" This reverts commit 06a7b55ffc4fa47e033cce1db458d516db8b85b6. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d1249f7..e111242 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .bundle .config .yardoc +Gemfile.lock InstalledFiles _yardoc coverage @@ -15,4 +16,4 @@ test/tmp test/version_tmp tmp .idea/** -.idea +.idea \ No newline at end of file From b2cb8a24ceb147c57617dedfbc04f5a7e103c4a9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Orban Date: Wed, 27 Nov 2024 10:28:50 +0100 Subject: [PATCH 6/7] Revert "add Gemfile.lock" This reverts commit e42266bce83c8e8688f28b7bf4f068f8b628658a. --- Gemfile.lock | 76 ---------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 5710e85..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,76 +0,0 @@ -PATH - remote: . - specs: - sendcloud-ruby (3.0.0) - faraday (~> 2) - faraday-follow_redirects - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.2) - faraday (2.12.1) - faraday-net_http (>= 2.0, < 3.5) - json - logger - faraday-follow_redirects (0.3.0) - faraday (>= 1, < 3) - faraday-net_http (3.4.0) - net-http (>= 0.5.0) - json (2.8.2) - language_server-protocol (3.17.0.3) - lint_roller (1.1.0) - logger (1.6.1) - minitest (5.25.2) - net-http (0.5.0) - uri - parallel (1.26.3) - parser (3.3.6.0) - ast (~> 2.4.1) - racc - racc (1.8.1) - rainbow (3.1.1) - rake (13.2.1) - regexp_parser (2.9.2) - rubocop (1.68.0) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.36.1) - parser (>= 3.3.1.0) - rubocop-performance (1.22.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - ruby-progressbar (1.13.0) - standard (1.42.1) - language_server-protocol (~> 3.17.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.68.0) - standard-custom (~> 1.0.0) - standard-performance (~> 1.5) - standard-custom (1.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.50) - standard-performance (1.5.0) - lint_roller (~> 1.1) - rubocop-performance (~> 1.22.0) - unicode-display_width (2.6.0) - uri (1.0.2) - -PLATFORMS - arm64-darwin-23 - -DEPENDENCIES - minitest (~> 5.0) - rake (~> 13.0) - sendcloud-ruby! - standard - -BUNDLED WITH - 2.4.19 From a80247e35bffe01f143b1b09a1e3defbe9eb9fdd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Orban Date: Wed, 27 Nov 2024 10:34:27 +0100 Subject: [PATCH 7/7] use faraday 2.0.1 at least --- sendcloud.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendcloud.gemspec b/sendcloud.gemspec index 0e34de8..9346af6 100644 --- a/sendcloud.gemspec +++ b/sendcloud.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| end spec.require_paths = ["lib"] - spec.add_dependency "faraday", "~> 2" + spec.add_dependency "faraday", ">= 2.0.1" spec.add_dependency "faraday-follow_redirects" spec.add_development_dependency "standard"