Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that Faraday::Request::Json and Faraday::Response::Json are correctly autoloaded #1595

Merged
merged 3 commits into from
Sep 20, 2024
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
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