Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

faraday 2.x #2

Merged
merged 4 commits into from
Nov 25, 2023
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
20 changes: 15 additions & 5 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
appraise '3.2' do
appraise 'activesupport-3.2' do
gem 'activesupport', '~> 3.2.22'
gem 'minitest', '~> 5'
end

appraise '4.0' do
appraise 'activesupport-4.0' do
gem 'activesupport', '~> 4.0.13'
end

appraise '4.1' do
appraise 'activesupport-4.1' do
gem 'activesupport', '~> 4.1.14'
end

appraise '4.2' do
appraise 'activesupport-4.2' do
gem 'activesupport', '~> 4.2.5.1'
end

appraise '5.0' do
appraise 'activesupport-5.0' do
gem 'activesupport', '~> 5.0.0'
end

appraise 'faraday-1.x' do
gem 'faraday', '~> 1.10'
gem 'faraday-gzip', '~> 1.0'
end

appraise 'faraday-2.x' do
gem 'faraday', '~> 2.0'
gem 'faraday-gzip', '~> 2.0'
end
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source "https://rubygems.org"
gemspec

gem 'rake'
gem 'appraisal'

gem "activesupport"
gem 'addressable', '~> 2.2'
Expand Down
15 changes: 0 additions & 15 deletions gemfiles/5.2.3.gemfile

This file was deleted.

15 changes: 0 additions & 15 deletions gemfiles/6.0.gemfile

This file was deleted.

7 changes: 3 additions & 4 deletions gemfiles/3.2.gemfile → gemfiles/activesupport_3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
source "https://rubygems.org"

gem "rake"
gem "appraisal"
gem "activesupport", "~> 3.2.22"
gem "addressable", "~> 2.2"
gem "codeclimate-test-reporter", :group => :test, :require => nil
gem "codeclimate-test-reporter", group: :test, require: nil
gem "minitest", "~> 5"

group :development, :test do
gem "byebug", :platforms => [:mri_20, :mri_21, :mri_22]
gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22]
end

gemspec :path => "../"
gemspec path: "../"
7 changes: 3 additions & 4 deletions gemfiles/4.0.gemfile → gemfiles/activesupport_4.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
source "https://rubygems.org"

gem "rake"
gem "appraisal"
gem "activesupport", "~> 4.0.13"
gem "addressable", "~> 2.2"
gem "codeclimate-test-reporter", :group => :test, :require => nil
gem "codeclimate-test-reporter", group: :test, require: nil

group :development, :test do
gem "byebug", :platforms => [:mri_20, :mri_21, :mri_22]
gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22]
end

gemspec :path => "../"
gemspec path: "../"
7 changes: 3 additions & 4 deletions gemfiles/4.1.gemfile → gemfiles/activesupport_4.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
source "https://rubygems.org"

gem "rake"
gem "appraisal"
gem "activesupport", "~> 4.1.14"
gem "addressable", "~> 2.2"
gem "codeclimate-test-reporter", :group => :test, :require => nil
gem "codeclimate-test-reporter", group: :test, require: nil

group :development, :test do
gem "byebug", :platforms => [:mri_20, :mri_21, :mri_22]
gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22]
end

gemspec :path => "../"
gemspec path: "../"
7 changes: 3 additions & 4 deletions gemfiles/4.2.gemfile → gemfiles/activesupport_4.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
source "https://rubygems.org"

gem "rake"
gem "appraisal"
gem "activesupport", "~> 4.2.5.1"
gem "addressable", "~> 2.2"
gem "codeclimate-test-reporter", :group => :test, :require => nil
gem "codeclimate-test-reporter", group: :test, require: nil

group :development, :test do
gem "byebug", :platforms => [:mri_20, :mri_21, :mri_22]
gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22]
end

gemspec :path => "../"
gemspec path: "../"
7 changes: 3 additions & 4 deletions gemfiles/5.0.gemfile → gemfiles/activesupport_5.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
source "https://rubygems.org"

gem "rake"
gem "appraisal"
gem "activesupport", "~> 5.0.0"
gem "addressable", "~> 2.2"
gem "codeclimate-test-reporter", :group => :test, :require => nil
gem "codeclimate-test-reporter", group: :test, require: nil

group :development, :test do
gem "byebug", :platforms => [:mri_20, :mri_21, :mri_22]
gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22]
end

gemspec :path => "../"
gemspec path: "../"
16 changes: 16 additions & 0 deletions gemfiles/faraday_1.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rake"
gem "activesupport"
gem "addressable", "~> 2.2"
gem "codeclimate-test-reporter", group: :test, require: nil
gem "faraday", "~> 1.10"
gem "faraday-gzip", "~> 1.0"

group :development, :test do
gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22]
end

gemspec path: "../"
16 changes: 16 additions & 0 deletions gemfiles/faraday_2.x.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rake"
gem "activesupport"
gem "addressable", "~> 2.2"
gem "codeclimate-test-reporter", group: :test, require: nil
gem "faraday", "~> 2.0"
gem "faraday-gzip", "~> 2.0"

group :development, :test do
gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22]
end

gemspec path: "../"
5 changes: 3 additions & 2 deletions json_api_client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ Gem::Specification.new do |s|
s.summary = 'Build client libraries compliant with specification defined by jsonapi.org'

s.add_dependency "activesupport", '>= 3.2.0'
s.add_dependency "faraday", '>= 0.15.2', '< 2.0'
s.add_dependency "faraday-gzip", '>= 0.1.0', '< 2.0'
s.add_dependency "faraday", '>= 1.10', '< 3.0'
s.add_dependency "faraday-gzip", '>= 1.0', '< 3.0'
s.add_dependency "addressable", '~> 2.2'
s.add_dependency "activemodel", '>= 3.2.0'
s.add_dependency "rack", '>= 0.2'

s.add_development_dependency "webmock", '~> 3.5.1'
s.add_development_dependency "mocha"
s.add_development_dependency "appraisal"

s.license = "MIT"

Expand Down
4 changes: 2 additions & 2 deletions lib/json_api_client/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(options = {})
builder.request :json
builder.use Middleware::JsonRequest
builder.use Middleware::Status, status_middleware_options
builder.use Middleware::ParseJson
builder.response :json
builder.use ::Faraday::Gzip::Middleware
builder.adapter(*adapter_options)
end
Expand All @@ -24,7 +24,7 @@ def initialize(options = {})
# inserted middleware will run after json parsed
def use(middleware, *args, &block)
return if faraday.builder.locked?
faraday.builder.insert_before(Middleware::ParseJson, middleware, *args, &block)
faraday.builder.insert_before(::Faraday::Response::Json, middleware, *args, &block)
end

def delete(middleware)
Expand Down
3 changes: 1 addition & 2 deletions lib/json_api_client/middleware.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module JsonApiClient
module Middleware
autoload :JsonRequest, 'json_api_client/middleware/json_request'
autoload :ParseJson, 'json_api_client/middleware/parse_json'
autoload :Status, 'json_api_client/middleware/status'
end
end
end
31 changes: 0 additions & 31 deletions lib/json_api_client/middleware/parse_json.rb

This file was deleted.