Skip to content

Commit

Permalink
Merge pull request #155 from ProductPlan/chore/faraday-2-support
Browse files Browse the repository at this point in the history
faraday 2 support
  • Loading branch information
irphilli authored Feb 28, 2022
2 parents 2a500c1 + 7dc744f commit d566e88
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ruby-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ on:
jobs:
test:

name: Specs - Ruby ${{ matrix.ruby-version }} ${{matrix.gemfile}}
runs-on: ubuntu-latest
env:
CC_TEST_REPORTER_ID: 2a6849be8214739deef0090b810b945ce9a550a4d8279d242cb03242d1ad53c5
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile

strategy:
matrix:
gemfile:
- faraday-1
- faraday-2
ruby-version:
- "3.1"
- "3.0"
Expand All @@ -35,4 +40,4 @@ jobs:
run: bundle exec rake test
- name: Upload Coverage
uses: paambaati/[email protected]
if: matrix.ruby-version == '3.1'
if: matrix.ruby-version == '3.1' && matrix.gemfile == 'faraday-2'
5 changes: 5 additions & 0 deletions gemfiles/faraday-1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'faraday', '~> 1.10'

gemspec path: '../'
5 changes: 5 additions & 0 deletions gemfiles/faraday-2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'faraday', '~> 2.2'

gemspec path: '../'
2 changes: 1 addition & 1 deletion lib/tracker_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# dependencies
require 'faraday'
require 'faraday_middleware'
require 'faraday/multipart'
require 'pathname'
require 'mini_mime'

Expand Down
2 changes: 1 addition & 1 deletion lib/tracker_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(options={}, &block)
@url = Addressable::URI.parse(url).to_s
@api_version = options.fetch(:api_version, '/services/v5')
@logger = options.fetch(:logger, ::Logger.new(nil))
adapter = options.fetch(:adapter) { defined?(JRUBY_VERSION) ? :net_http : :excon }
adapter = options.fetch(:adapter, :net_http)
connection_options = options.fetch(:connection_options, { ssl: { verify: true } })
@auto_paginate = options.fetch(:auto_paginate, true)
@token = options[:token]
Expand Down
2 changes: 1 addition & 1 deletion lib/tracker_api/logger.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TrackerApi
class Logger < Faraday::Response::Middleware
class Logger < Faraday::Middleware
extend Forwardable

def initialize(app, logger = nil)
Expand Down
5 changes: 2 additions & 3 deletions tracker_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ Gem::Specification.new do |spec|

spec.add_dependency 'addressable'
spec.add_dependency 'virtus'
spec.add_dependency 'faraday'
spec.add_dependency 'faraday_middleware'
spec.add_dependency 'excon'
spec.add_dependency 'faraday', ['>= 1.10', '< 3.0']
spec.add_dependency 'faraday-multipart'
spec.add_dependency 'equalizer'
spec.add_dependency 'representable'
spec.add_dependency 'multi_json'
Expand Down

0 comments on commit d566e88

Please sign in to comment.