Skip to content

Commit

Permalink
Make sure that Faraday::Request::Json and Faraday::Response::Json
Browse files Browse the repository at this point in the history
… are correctly autoloaded (#1595)
  • Loading branch information
iMacTia authored Sep 20, 2024
1 parent 8208693 commit 435888d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
Expand All @@ -24,7 +24,7 @@ jobs:

- 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
Expand All @@ -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 }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tmp
.rvmrc
.ruby-version
.yardoc
.DS_Store

## BUNDLER
*.gem
Expand All @@ -17,6 +18,7 @@ vendor/bundle

## PROJECT::SPECIFIC
.rbx
node_modules

## IDEs
.idea/
Expand Down
14 changes: 8 additions & 6 deletions lib/faraday/autoload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,23 @@ 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.
# @see lib/faraday/response.rb Original class location
class Response
extend AutoloadHelper
autoload_all 'faraday/response',
RaiseError: 'raise_error',
Logger: 'logger'
Json: 'json',
Logger: 'logger',
RaiseError: 'raise_error'
end
end

0 comments on commit 435888d

Please sign in to comment.