Compare commits

...

6 Commits

Author SHA1 Message Date
Matt
82086930f9
Use ruby/setup-ruby in publish.yml 2023-01-18 15:42:56 +00:00
Matt
eeec3677d7
Fix ruby version in publish.yml 2023-01-18 15:40:12 +00:00
Matt
92c038bcbf
Update publish.yml to use Ruby 2.7 2023-01-18 15:08:48 +00:00
Matt
7a382b5abb
Version bump to 1.10.3 2023-01-18 15:04:12 +00:00
Tim Rogers
16506ee918
Add support for Ruby 3.2.0 in Faraday v1.x (#1483)
* Run tests against Ruby 3.2

* Declare `DependencyLoader#new` with `ruby2_keywords` to fix Ruby 3.2.0

When adding a middleware that receives keyword arguments in the
constructor, the call from `DependencyLoader#new` fails because
the method is not defined using `ruby2_keywords`.

This adds the required `ruby2_keywords` declaration to
`DependencyLoader#new`, fixing the tests and getting Faraday v1.x
working with Ruby 3.2.0.

Fixes #1479.

Co-authored-by: Matt <iMacTia@users.noreply.github.com>
2023-01-18 14:58:13 +00:00
Mattia Giuffrida
d72db285e9 Fix rack version to '< 3' to avoid backwards incompatible change breaking specs 2023-01-18 13:46:45 +00:00
5 changed files with 9 additions and 6 deletions

View File

@ -42,7 +42,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1']
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
steps:
- uses: actions/checkout@v1

View File

@ -12,10 +12,10 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.7
- name: Publish to RubyGems
run: |

View File

@ -30,6 +30,7 @@ group :test, :development do
options = (RUBY_VERSION.start_with?('3') ? { github: 'grosser/net-http-persistent', branch: 'grosser/spec' } : {})
gem 'net-http-persistent', '>= 3.0', **options
gem 'patron', '>= 0.4.2', platforms: :ruby
gem 'rack', '< 3'
gem 'rack-test', '>= 0.6', require: 'rack/test'
gem 'rspec', '~> 3.7'
gem 'rspec_junit_formatter', '~> 0.4'

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true
require 'ruby2_keywords'
module Faraday
# DependencyLoader helps Faraday adapters and middleware load dependencies.
module DependencyLoader
@ -13,7 +15,7 @@ module Faraday
self.load_error = e
end
def new(*)
ruby2_keywords def new(*)
unless loaded?
raise "missing dependency for #{self}: #{load_error.message}"
end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module Faraday
VERSION = '1.10.2'
VERSION = '1.10.3'
end