Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby: [2.6, 2.7, 3.0, 3.1]
ruby: [3.2]
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
3.2.2
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.2.2
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Changelog

## [v1.0.0] - 2023-07-12
- [Upgrade to Faraday 2.x](https://github.com/Shopify/oktakit/pull/68)

## [v0.3.3] - 2022-07-20
- [Loosen sawyer dependency to allow 0.9.1](https://github.com/Shopify/oktakit/pull/61)

Expand Down
39 changes: 30 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
PATH
remote: .
specs:
oktakit (1.0.0)
faraday (>= 2.0.1, < 3)
oktakit (0.3.3)
faraday (>= 0.17.3, < 2)
sawyer (>= 0.8.1, < 0.10)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
byebug (11.1.3)
diff-lcs (1.4.4)
faraday (2.7.10)
faraday-net_http (>= 2.0, < 3.1)
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)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
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)
parallel (1.21.0)
parser (3.0.3.2)
ast (~> 2.4.1)
public_suffix (5.0.3)
public_suffix (4.0.7)
rainbow (3.0.0)
rake (13.0.6)
regexp_parser (2.2.0)
Expand Down Expand Up @@ -63,6 +83,7 @@ GEM
PLATFORMS
-darwin-21
arm64-darwin-21
arm64-darwin-24
x86_64-linux

DEPENDENCIES
Expand All @@ -77,4 +98,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.3.24
2.2.22
7 changes: 5 additions & 2 deletions lib/oktakit/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ 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 = Faraday::RackBuilder.new do |builder|
MIDDLEWARE = RACK_BUILDER_CLASS.new do |builder|
builder.use(Oktakit::Response::RaiseError)
builder.adapter(:net_http)
builder.adapter(Faraday.default_adapter)
end

def initialize(token: nil, access_token: nil, organization: nil, api_endpoint: nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/oktakit/response/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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::Middleware
class RaiseError < Faraday::Response::Middleware
private

def on_complete(response)
Expand Down
2 changes: 1 addition & 1 deletion lib/oktakit/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Oktakit
VERSION = '1.0.0'.freeze
VERSION = '0.3.3'.freeze
end
2 changes: 1 addition & 1 deletion oktakit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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', '>= 2.0.1', '< 3')
spec.add_dependency('faraday', '>= 0.17.3', '< 2')
spec.add_development_dependency('bundler')
end
Loading