From 572ec548e9a213a0c271e8071050f39a2e539b56 Mon Sep 17 00:00:00 2001 From: Mattia Giuffrida Date: Fri, 20 Sep 2024 14:56:39 +0100 Subject: [PATCH] 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