From 572ec548e9a213a0c271e8071050f39a2e539b56 Mon Sep 17 00:00:00 2001 From: Mattia Giuffrida Date: Fri, 20 Sep 2024 14:56:39 +0100 Subject: [PATCH 1/3] Make sure that Faraday::Request::Json and Faraday::Response::Json are correctly autoloaded --- .gitignore | 2 ++ lib/faraday/autoload.rb | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index eea05d17b..340eada9e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ tmp .rvmrc .ruby-version .yardoc +.DS_Store ## BUNDLER *.gem @@ -17,6 +18,7 @@ vendor/bundle ## PROJECT::SPECIFIC .rbx +node_modules ## IDEs .idea/ diff --git a/lib/faraday/autoload.rb b/lib/faraday/autoload.rb index 76a0e0e51..6fbaf17bd 100644 --- a/lib/faraday/autoload.rb +++ b/lib/faraday/autoload.rb @@ -67,13 +67,14 @@ class Adapter class Request extend AutoloadHelper autoload_all 'faraday/request', - UrlEncoded: 'url_encoded', - Multipart: 'multipart', - Retry: 'retry', Authorization: 'authorization', BasicAuthentication: 'basic_authentication', + Instrumentation: 'instrumentation', + Json: 'json', + Multipart: 'multipart', + Retry: 'retry', TokenAuthentication: 'token_authentication', - Instrumentation: 'instrumentation' + UrlEncoded: 'url_encoded' end # Response represents the returned value of a sent Faraday request. @@ -81,7 +82,8 @@ class Request class Response extend AutoloadHelper autoload_all 'faraday/response', - RaiseError: 'raise_error', - Logger: 'logger' + Json: 'json', + Logger: 'logger', + RaiseError: 'raise_error' end end From 2b766b87ec39bd38a73f5c26ef877d2457cc2bf2 Mon Sep 17 00:00:00 2001 From: Mattia Giuffrida Date: Fri, 20 Sep 2024 15:12:55 +0100 Subject: [PATCH 2/3] Update GitHub Actions --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/publish.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66f720d46..b33481408 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - - name: Set up Ruby 2.7 + - name: Set up Ruby 3.0 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.0 - name: Rubocop run: | @@ -42,10 +42,10 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2'] + ruby: ['3.0', '3.1', '3.2'] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cea225d74..77fac5bc6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 From 0ca4e9b5a2f629460fb0fba2f7b07e652267b25f Mon Sep 17 00:00:00 2001 From: Mattia Giuffrida Date: Fri, 20 Sep 2024 15:24:32 +0100 Subject: [PATCH 3/3] Use older bundler version --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b33481408..47ee4bc18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,14 +17,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Ruby 3.0 + - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: - ruby-version: 3.0 + ruby-version: 2.7 - name: Rubocop run: | - gem install bundler + gem install bundler -v 2.4.22 bundle config set without 'development test' bundle config set with 'lint' bundle install @@ -57,7 +57,7 @@ jobs: - name: Build run: | - gem install bundler -v '<2' + gem install bundler -v 2.4.22 bundle install --jobs 4 --retry 3 - name: Test