From 5b980d5ebe34d05a85a147396df323f1362dd622 Mon Sep 17 00:00:00 2001 From: Riley Shott Date: Tue, 11 Jul 2023 15:34:29 -0700 Subject: [PATCH 1/2] Update default Ruby to 2.7.2 --- .ruby-version | 2 +- dev.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ruby-version b/.ruby-version index 338a5b5..37c2961 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.6 +2.7.2 diff --git a/dev.yml b/dev.yml index ff3539c..7b55eb8 100644 --- a/dev.yml +++ b/dev.yml @@ -3,7 +3,7 @@ name: oktakit up: - - ruby: 2.6.6 + - ruby: 2.7.2 - bundler commands: From 8fd0cce799f8d71da83c558e6f84347fffa50c71 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Cuchi Date: Tue, 1 Nov 2022 15:10:58 -0300 Subject: [PATCH 2/2] Upgrade to Faraday 2.x --- Gemfile.lock | 30 +++++------------------------ lib/oktakit/client.rb | 7 ++----- lib/oktakit/response/raise_error.rb | 2 +- oktakit.gemspec | 2 +- 4 files changed, 9 insertions(+), 32 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ddef1a0..d22394b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: oktakit (0.3.3) - faraday (>= 0.17.3, < 2) + faraday (>= 2.0.1, < 3) sawyer (>= 0.8.1, < 0.10) GEM @@ -13,30 +13,10 @@ GEM ast (2.4.2) byebug (11.1.3) diff-lcs (1.4.4) - faraday (1.10.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) + faraday (2.6.0) + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - multipart-post (2.2.3) + faraday-net_http (3.0.1) parallel (1.21.0) parser (3.0.3.2) ast (~> 2.4.1) @@ -99,4 +79,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.2.22 + 2.3.24 diff --git a/lib/oktakit/client.rb b/lib/oktakit/client.rb index b42548a..e4aa58e 100644 --- a/lib/oktakit/client.rb +++ b/lib/oktakit/client.rb @@ -24,13 +24,10 @@ class Client include Templates include Users - # In Faraday 0.9, Faraday::Builder was renamed to Faraday::RackBuilder - RACK_BUILDER_CLASS = defined?(Faraday::RackBuilder) ? Faraday::RackBuilder : Faraday::Builder - # Default Faraday middleware stack - MIDDLEWARE = RACK_BUILDER_CLASS.new do |builder| + MIDDLEWARE = Faraday::RackBuilder.new do |builder| builder.use(Oktakit::Response::RaiseError) - builder.adapter(Faraday.default_adapter) + builder.adapter(:net_http) end def initialize(token: nil, access_token: nil, organization: nil, api_endpoint: nil) diff --git a/lib/oktakit/response/raise_error.rb b/lib/oktakit/response/raise_error.rb index 5837a48..ba9fcb9 100644 --- a/lib/oktakit/response/raise_error.rb +++ b/lib/oktakit/response/raise_error.rb @@ -6,7 +6,7 @@ module Oktakit module Response # This class raises an Oktakit-flavored exception based # HTTP status codes returned by the API - class RaiseError < Faraday::Response::Middleware + class RaiseError < Faraday::Middleware private def on_complete(response) diff --git a/oktakit.gemspec b/oktakit.gemspec index 55fb77e..65cb5b8 100644 --- a/oktakit.gemspec +++ b/oktakit.gemspec @@ -20,6 +20,6 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 2.6' spec.add_dependency('sawyer', '>= 0.8.1', '< 0.10') - spec.add_dependency('faraday', '>= 0.17.3', '< 2') + spec.add_dependency('faraday', '>= 2.0.1', '< 3') spec.add_development_dependency('bundler') end