faraday 1.0.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +104 -0
 - data/LICENSE.md +1 -1
 - data/README.md +3 -5
 - data/examples/client_spec.rb +1 -1
 - data/lib/faraday.rb +53 -41
 - data/lib/faraday/adapter.rb +1 -6
 - data/lib/faraday/adapter/em_http.rb +16 -13
 - data/lib/faraday/adapter/em_synchrony.rb +16 -13
 - data/lib/faraday/autoload.rb +1 -4
 - data/lib/faraday/connection.rb +5 -4
 - data/lib/faraday/encoders/flat_params_encoder.rb +9 -2
 - data/lib/faraday/encoders/nested_params_encoder.rb +7 -2
 - data/lib/faraday/error.rb +20 -0
 - data/lib/faraday/methods.rb +6 -0
 - data/lib/faraday/middleware.rb +14 -4
 - data/lib/faraday/options.rb +4 -8
 - data/lib/faraday/rack_builder.rb +13 -12
 - data/lib/faraday/request.rb +20 -10
 - data/lib/faraday/request/multipart.rb +9 -2
 - data/lib/faraday/request/retry.rb +2 -2
 - data/lib/faraday/response.rb +0 -6
 - data/lib/faraday/response/raise_error.rb +12 -1
 - data/lib/faraday/utils.rb +2 -2
 - data/lib/faraday/utils/headers.rb +2 -2
 - data/lib/faraday/version.rb +5 -0
 - data/spec/faraday/adapter/test_spec.rb +260 -0
 - data/spec/faraday/connection_spec.rb +30 -0
 - data/spec/faraday/error_spec.rb +15 -0
 - data/spec/faraday/middleware_spec.rb +32 -6
 - data/spec/faraday/params_encoders/flat_spec.rb +8 -0
 - data/spec/faraday/params_encoders/nested_spec.rb +8 -0
 - data/spec/faraday/rack_builder_spec.rb +149 -0
 - data/spec/faraday/request/authorization_spec.rb +2 -2
 - data/spec/faraday/request/multipart_spec.rb +41 -13
 - data/spec/faraday/request/retry_spec.rb +1 -1
 - data/spec/faraday/request_spec.rb +16 -5
 - data/spec/faraday/response/raise_error_spec.rb +63 -0
 - data/spec/support/shared_examples/adapter.rb +2 -1
 - data/spec/support/shared_examples/request_method.rb +39 -11
 - metadata +64 -9
 - data/lib/faraday/adapter/excon.rb +0 -124
 - data/lib/faraday/adapter/net_http.rb +0 -219
 - data/lib/faraday/adapter/net_http_persistent.rb +0 -91
 - data/spec/faraday/adapter/net_http_persistent_spec.rb +0 -57
 
| 
         @@ -56,7 +56,7 @@ RSpec.describe Faraday::Request::Authorization do 
     | 
|
| 
       56 
56 
     | 
    
         
             
                end
         
     | 
| 
       57 
57 
     | 
    
         | 
| 
       58 
58 
     | 
    
         
             
                context 'when other values are provided' do
         
     | 
| 
       59 
     | 
    
         
            -
                  let(:auth_config) { ['baz', foo: 42] }
         
     | 
| 
      
 59 
     | 
    
         
            +
                  let(:auth_config) { ['baz', { foo: 42 }] }
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
                  it { expect(response.body).to match(/^Token /) }
         
     | 
| 
       62 
62 
     | 
    
         
             
                  it { expect(response.body).to match(/token="baz"/) }
         
     | 
| 
         @@ -78,7 +78,7 @@ RSpec.describe Faraday::Request::Authorization do 
     | 
|
| 
       78 
78 
     | 
    
         
             
                end
         
     | 
| 
       79 
79 
     | 
    
         | 
| 
       80 
80 
     | 
    
         
             
                context 'when passed a string and a hash' do
         
     | 
| 
       81 
     | 
    
         
            -
                  let(:auth_config) { ['baz', foo: 42] }
         
     | 
| 
      
 81 
     | 
    
         
            +
                  let(:auth_config) { ['baz', { foo: 42 }] }
         
     | 
| 
       82 
82 
     | 
    
         | 
| 
       83 
83 
     | 
    
         
             
                  it { expect(response.body).to eq('baz foo="42"') }
         
     | 
| 
       84 
84 
     | 
    
         | 
| 
         @@ -1,9 +1,10 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            RSpec.describe Faraday::Request::Multipart do
         
     | 
| 
      
 4 
     | 
    
         
            +
              let(:options) { {} }
         
     | 
| 
       4 
5 
     | 
    
         
             
              let(:conn) do
         
     | 
| 
       5 
6 
     | 
    
         
             
                Faraday.new do |b|
         
     | 
| 
       6 
     | 
    
         
            -
                  b.request :multipart
         
     | 
| 
      
 7 
     | 
    
         
            +
                  b.request :multipart, options
         
     | 
| 
       7 
8 
     | 
    
         
             
                  b.request :url_encoded
         
     | 
| 
       8 
9 
     | 
    
         
             
                  b.adapter :test do |stub|
         
     | 
| 
       9 
10 
     | 
    
         
             
                    stub.post('/echo') do |env|
         
     | 
| 
         @@ -54,9 +55,10 @@ RSpec.describe Faraday::Request::Multipart do 
     | 
|
| 
       54 
55 
     | 
    
         
             
                  part_bc, body_bc = result.part('b[c]')
         
     | 
| 
       55 
56 
     | 
    
         
             
                  expect(part_bc).to_not be_nil
         
     | 
| 
       56 
57 
     | 
    
         
             
                  expect(part_bc.filename).to eq('multipart_spec.rb')
         
     | 
| 
       57 
     | 
    
         
            -
                  expect(part_bc.headers['content-disposition']) 
     | 
| 
       58 
     | 
    
         
            -
                     
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
      
 58 
     | 
    
         
            +
                  expect(part_bc.headers['content-disposition'])
         
     | 
| 
      
 59 
     | 
    
         
            +
                    .to eq(
         
     | 
| 
      
 60 
     | 
    
         
            +
                      'form-data; foo=1; name="b[c]"; filename="multipart_spec.rb"'
         
     | 
| 
      
 61 
     | 
    
         
            +
                    )
         
     | 
| 
       60 
62 
     | 
    
         
             
                  expect(part_bc.headers['content-type']).to eq('text/x-ruby')
         
     | 
| 
       61 
63 
     | 
    
         
             
                  expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
         
     | 
| 
       62 
64 
     | 
    
         
             
                  expect(body_bc).to eq(File.read(__FILE__))
         
     | 
| 
         @@ -135,9 +137,10 @@ RSpec.describe Faraday::Request::Multipart do 
     | 
|
| 
       135 
137 
     | 
    
         
             
                  part_bc, body_bc = result.part('b[][c]')
         
     | 
| 
       136 
138 
     | 
    
         
             
                  expect(part_bc).to_not be_nil
         
     | 
| 
       137 
139 
     | 
    
         
             
                  expect(part_bc.filename).to eq('multipart_spec.rb')
         
     | 
| 
       138 
     | 
    
         
            -
                  expect(part_bc.headers['content-disposition']) 
     | 
| 
       139 
     | 
    
         
            -
                     
     | 
| 
       140 
     | 
    
         
            -
             
     | 
| 
      
 140 
     | 
    
         
            +
                  expect(part_bc.headers['content-disposition'])
         
     | 
| 
      
 141 
     | 
    
         
            +
                    .to eq(
         
     | 
| 
      
 142 
     | 
    
         
            +
                      'form-data; name="b[][c]"; filename="multipart_spec.rb"'
         
     | 
| 
      
 143 
     | 
    
         
            +
                    )
         
     | 
| 
       141 
144 
     | 
    
         
             
                  expect(part_bc.headers['content-type']).to eq('text/x-ruby')
         
     | 
| 
       142 
145 
     | 
    
         
             
                  expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
         
     | 
| 
       143 
146 
     | 
    
         
             
                  expect(body_bc).to eq(File.read(__FILE__))
         
     | 
| 
         @@ -177,9 +180,10 @@ RSpec.describe Faraday::Request::Multipart do 
     | 
|
| 
       177 
180 
     | 
    
         
             
                  part_bc, body_bc = result.part('b[c]')
         
     | 
| 
       178 
181 
     | 
    
         
             
                  expect(part_bc).to_not be_nil
         
     | 
| 
       179 
182 
     | 
    
         
             
                  expect(part_bc.filename).to eq('multipart_spec.rb')
         
     | 
| 
       180 
     | 
    
         
            -
                  expect(part_bc.headers['content-disposition']) 
     | 
| 
       181 
     | 
    
         
            -
                     
     | 
| 
       182 
     | 
    
         
            -
             
     | 
| 
      
 183 
     | 
    
         
            +
                  expect(part_bc.headers['content-disposition'])
         
     | 
| 
      
 184 
     | 
    
         
            +
                    .to eq(
         
     | 
| 
      
 185 
     | 
    
         
            +
                      'form-data; foo=1; name="b[c]"; filename="multipart_spec.rb"'
         
     | 
| 
      
 186 
     | 
    
         
            +
                    )
         
     | 
| 
       183 
187 
     | 
    
         
             
                  expect(part_bc.headers['content-type']).to eq('text/x-ruby')
         
     | 
| 
       184 
188 
     | 
    
         
             
                  expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
         
     | 
| 
       185 
189 
     | 
    
         
             
                  expect(body_bc).to eq(File.read(__FILE__))
         
     | 
| 
         @@ -258,9 +262,10 @@ RSpec.describe Faraday::Request::Multipart do 
     | 
|
| 
       258 
262 
     | 
    
         
             
                  part_bc, body_bc = result.part('b[][c]')
         
     | 
| 
       259 
263 
     | 
    
         
             
                  expect(part_bc).to_not be_nil
         
     | 
| 
       260 
264 
     | 
    
         
             
                  expect(part_bc.filename).to eq('multipart_spec.rb')
         
     | 
| 
       261 
     | 
    
         
            -
                  expect(part_bc.headers['content-disposition']) 
     | 
| 
       262 
     | 
    
         
            -
                     
     | 
| 
       263 
     | 
    
         
            -
             
     | 
| 
      
 265 
     | 
    
         
            +
                  expect(part_bc.headers['content-disposition'])
         
     | 
| 
      
 266 
     | 
    
         
            +
                    .to eq(
         
     | 
| 
      
 267 
     | 
    
         
            +
                      'form-data; name="b[][c]"; filename="multipart_spec.rb"'
         
     | 
| 
      
 268 
     | 
    
         
            +
                    )
         
     | 
| 
       264 
269 
     | 
    
         
             
                  expect(part_bc.headers['content-type']).to eq('text/x-ruby')
         
     | 
| 
       265 
270 
     | 
    
         
             
                  expect(part_bc.headers['content-transfer-encoding']).to eq('binary')
         
     | 
| 
       266 
271 
     | 
    
         
             
                  expect(body_bc).to eq(File.read(__FILE__))
         
     | 
| 
         @@ -271,4 +276,27 @@ RSpec.describe Faraday::Request::Multipart do 
     | 
|
| 
       271 
276 
     | 
    
         
             
                  expect(body_bd).to eq('2')
         
     | 
| 
       272 
277 
     | 
    
         
             
                end
         
     | 
| 
       273 
278 
     | 
    
         
             
              end
         
     | 
| 
      
 279 
     | 
    
         
            +
             
     | 
| 
      
 280 
     | 
    
         
            +
              context 'when passing flat_encode=true option' do
         
     | 
| 
      
 281 
     | 
    
         
            +
                let(:options) { { flat_encode: true } }
         
     | 
| 
      
 282 
     | 
    
         
            +
                let(:io) { StringIO.new('io-content') }
         
     | 
| 
      
 283 
     | 
    
         
            +
                let(:payload) do
         
     | 
| 
      
 284 
     | 
    
         
            +
                  {
         
     | 
| 
      
 285 
     | 
    
         
            +
                    a: 1,
         
     | 
| 
      
 286 
     | 
    
         
            +
                    b: [
         
     | 
| 
      
 287 
     | 
    
         
            +
                      Faraday::UploadIO.new(io, 'application/pdf'),
         
     | 
| 
      
 288 
     | 
    
         
            +
                      Faraday::UploadIO.new(io, 'application/pdf')
         
     | 
| 
      
 289 
     | 
    
         
            +
                    ]
         
     | 
| 
      
 290 
     | 
    
         
            +
                  }
         
     | 
| 
      
 291 
     | 
    
         
            +
                end
         
     | 
| 
      
 292 
     | 
    
         
            +
             
     | 
| 
      
 293 
     | 
    
         
            +
                it_behaves_like 'a multipart request'
         
     | 
| 
      
 294 
     | 
    
         
            +
             
     | 
| 
      
 295 
     | 
    
         
            +
                it 'encode params using flat encoder' do
         
     | 
| 
      
 296 
     | 
    
         
            +
                  response = conn.post('/echo', payload)
         
     | 
| 
      
 297 
     | 
    
         
            +
             
     | 
| 
      
 298 
     | 
    
         
            +
                  expect(response.body).to include('name="b"')
         
     | 
| 
      
 299 
     | 
    
         
            +
                  expect(response.body).not_to include('name="b[]"')
         
     | 
| 
      
 300 
     | 
    
         
            +
                end
         
     | 
| 
      
 301 
     | 
    
         
            +
              end
         
     | 
| 
       274 
302 
     | 
    
         
             
            end
         
     | 
| 
         @@ -117,7 +117,7 @@ RSpec.describe Faraday::Request::Retry do 
     | 
|
| 
       117 
117 
     | 
    
         
             
                  let(:options) { { max: 2, interval: 0.1, interval_randomness: 0.05 } }
         
     | 
| 
       118 
118 
     | 
    
         
             
                  let(:middleware) { Faraday::Request::Retry.new(nil, options) }
         
     | 
| 
       119 
119 
     | 
    
         | 
| 
       120 
     | 
    
         
            -
                  it { expect(middleware.send(:calculate_retry_interval, 2)).to be_between(0.1, 0. 
     | 
| 
      
 120 
     | 
    
         
            +
                  it { expect(middleware.send(:calculate_retry_interval, 2)).to be_between(0.1, 0.105) }
         
     | 
| 
       121 
121 
     | 
    
         
             
                end
         
     | 
| 
       122 
122 
     | 
    
         
             
              end
         
     | 
| 
       123 
123 
     | 
    
         | 
| 
         @@ -6,20 +6,31 @@ RSpec.describe Faraday::Request do 
     | 
|
| 
       6 
6 
     | 
    
         
             
                            headers: { 'Mime-Version' => '1.0' },
         
     | 
| 
       7 
7 
     | 
    
         
             
                            request: { oauth: { consumer_key: 'anonymous' } })
         
     | 
| 
       8 
8 
     | 
    
         
             
              end
         
     | 
| 
       9 
     | 
    
         
            -
              let(: 
     | 
| 
      
 9 
     | 
    
         
            +
              let(:http_method) { :get }
         
     | 
| 
       10 
10 
     | 
    
         
             
              let(:block) { nil }
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
              subject { conn.build_request( 
     | 
| 
      
 12 
     | 
    
         
            +
              subject { conn.build_request(http_method, &block) }
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
              context 'when nothing particular is configured' do
         
     | 
| 
       15 
     | 
    
         
            -
                it { expect(subject. 
     | 
| 
      
 15 
     | 
    
         
            +
                it { expect(subject.http_method).to eq(:get) }
         
     | 
| 
       16 
16 
     | 
    
         
             
                it { expect(subject.to_env(conn).ssl.verify).to be_falsey }
         
     | 
| 
       17 
17 
     | 
    
         
             
              end
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
              context 'when method is post' do
         
     | 
| 
       20 
     | 
    
         
            -
                let(: 
     | 
| 
      
 19 
     | 
    
         
            +
              context 'when HTTP method is post' do
         
     | 
| 
      
 20 
     | 
    
         
            +
                let(:http_method) { :post }
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                it { expect(subject.http_method).to eq(:post) }
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              describe 'deprecate method for HTTP method' do
         
     | 
| 
      
 26 
     | 
    
         
            +
                let(:http_method) { :post }
         
     | 
| 
      
 27 
     | 
    
         
            +
                let(:expected_warning) do
         
     | 
| 
      
 28 
     | 
    
         
            +
                  %r{WARNING: `Faraday::Request#method` is deprecated; use `#http_method` instead. It will be removed in or after version 2.0.\n`Faraday::Request#method` called from .+/spec/faraday/request_spec.rb:\d+.}
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
       21 
30 
     | 
    
         | 
| 
       22 
31 
     | 
    
         
             
                it { expect(subject.method).to eq(:post) }
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                it { expect { subject.method }.to output(expected_warning).to_stderr }
         
     | 
| 
       23 
34 
     | 
    
         
             
              end
         
     | 
| 
       24 
35 
     | 
    
         | 
| 
       25 
36 
     | 
    
         
             
              context 'when setting the url on setup with a URI' do
         
     | 
| 
         @@ -29,6 +29,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       29 
29 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 400')
         
     | 
| 
       30 
30 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       31 
31 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(400)
         
     | 
| 
      
 32 
     | 
    
         
            +
                  expect(ex.response_status).to eq(400)
         
     | 
| 
      
 33 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 34 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       32 
35 
     | 
    
         
             
                end
         
     | 
| 
       33 
36 
     | 
    
         
             
              end
         
     | 
| 
       34 
37 
     | 
    
         | 
| 
         @@ -37,6 +40,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       37 
40 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 401')
         
     | 
| 
       38 
41 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       39 
42 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(401)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  expect(ex.response_status).to eq(401)
         
     | 
| 
      
 44 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 45 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       40 
46 
     | 
    
         
             
                end
         
     | 
| 
       41 
47 
     | 
    
         
             
              end
         
     | 
| 
       42 
48 
     | 
    
         | 
| 
         @@ -45,6 +51,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       45 
51 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 403')
         
     | 
| 
       46 
52 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       47 
53 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(403)
         
     | 
| 
      
 54 
     | 
    
         
            +
                  expect(ex.response_status).to eq(403)
         
     | 
| 
      
 55 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 56 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       48 
57 
     | 
    
         
             
                end
         
     | 
| 
       49 
58 
     | 
    
         
             
              end
         
     | 
| 
       50 
59 
     | 
    
         | 
| 
         @@ -53,6 +62,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       53 
62 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 404')
         
     | 
| 
       54 
63 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       55 
64 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(404)
         
     | 
| 
      
 65 
     | 
    
         
            +
                  expect(ex.response_status).to eq(404)
         
     | 
| 
      
 66 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 67 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       56 
68 
     | 
    
         
             
                end
         
     | 
| 
       57 
69 
     | 
    
         
             
              end
         
     | 
| 
       58 
70 
     | 
    
         | 
| 
         @@ -61,6 +73,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       61 
73 
     | 
    
         
             
                  expect(ex.message).to eq('407 "Proxy Authentication Required"')
         
     | 
| 
       62 
74 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       63 
75 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(407)
         
     | 
| 
      
 76 
     | 
    
         
            +
                  expect(ex.response_status).to eq(407)
         
     | 
| 
      
 77 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 78 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       64 
79 
     | 
    
         
             
                end
         
     | 
| 
       65 
80 
     | 
    
         
             
              end
         
     | 
| 
       66 
81 
     | 
    
         | 
| 
         @@ -69,6 +84,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       69 
84 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 409')
         
     | 
| 
       70 
85 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       71 
86 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(409)
         
     | 
| 
      
 87 
     | 
    
         
            +
                  expect(ex.response_status).to eq(409)
         
     | 
| 
      
 88 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 89 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       72 
90 
     | 
    
         
             
                end
         
     | 
| 
       73 
91 
     | 
    
         
             
              end
         
     | 
| 
       74 
92 
     | 
    
         | 
| 
         @@ -77,6 +95,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       77 
95 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 422')
         
     | 
| 
       78 
96 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       79 
97 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(422)
         
     | 
| 
      
 98 
     | 
    
         
            +
                  expect(ex.response_status).to eq(422)
         
     | 
| 
      
 99 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 100 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       80 
101 
     | 
    
         
             
                end
         
     | 
| 
       81 
102 
     | 
    
         
             
              end
         
     | 
| 
       82 
103 
     | 
    
         | 
| 
         @@ -85,6 +106,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       85 
106 
     | 
    
         
             
                  expect(ex.message).to eq('http status could not be derived from the server response')
         
     | 
| 
       86 
107 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('nil')
         
     | 
| 
       87 
108 
     | 
    
         
             
                  expect(ex.response[:status]).to be_nil
         
     | 
| 
      
 109 
     | 
    
         
            +
                  expect(ex.response_status).to be_nil
         
     | 
| 
      
 110 
     | 
    
         
            +
                  expect(ex.response_body).to eq('fail')
         
     | 
| 
      
 111 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('nil')
         
     | 
| 
       88 
112 
     | 
    
         
             
                end
         
     | 
| 
       89 
113 
     | 
    
         
             
              end
         
     | 
| 
       90 
114 
     | 
    
         | 
| 
         @@ -93,6 +117,9 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       93 
117 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 499')
         
     | 
| 
       94 
118 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Reason']).to eq('because')
         
     | 
| 
       95 
119 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(499)
         
     | 
| 
      
 120 
     | 
    
         
            +
                  expect(ex.response_status).to eq(499)
         
     | 
| 
      
 121 
     | 
    
         
            +
                  expect(ex.response_body).to eq('keep looking')
         
     | 
| 
      
 122 
     | 
    
         
            +
                  expect(ex.response_headers['X-Reason']).to eq('because')
         
     | 
| 
       96 
123 
     | 
    
         
             
                end
         
     | 
| 
       97 
124 
     | 
    
         
             
              end
         
     | 
| 
       98 
125 
     | 
    
         | 
| 
         @@ -101,6 +128,42 @@ RSpec.describe Faraday::Response::RaiseError do 
     | 
|
| 
       101 
128 
     | 
    
         
             
                  expect(ex.message).to eq('the server responded with status 500')
         
     | 
| 
       102 
129 
     | 
    
         
             
                  expect(ex.response[:headers]['X-Error']).to eq('bailout')
         
     | 
| 
       103 
130 
     | 
    
         
             
                  expect(ex.response[:status]).to eq(500)
         
     | 
| 
      
 131 
     | 
    
         
            +
                  expect(ex.response_status).to eq(500)
         
     | 
| 
      
 132 
     | 
    
         
            +
                  expect(ex.response_body).to eq('fail')
         
     | 
| 
      
 133 
     | 
    
         
            +
                  expect(ex.response_headers['X-Error']).to eq('bailout')
         
     | 
| 
      
 134 
     | 
    
         
            +
                end
         
     | 
| 
      
 135 
     | 
    
         
            +
              end
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
      
 137 
     | 
    
         
            +
              describe 'request info' do
         
     | 
| 
      
 138 
     | 
    
         
            +
                let(:conn) do
         
     | 
| 
      
 139 
     | 
    
         
            +
                  Faraday.new do |b|
         
     | 
| 
      
 140 
     | 
    
         
            +
                    b.response :raise_error
         
     | 
| 
      
 141 
     | 
    
         
            +
                    b.adapter :test do |stub|
         
     | 
| 
      
 142 
     | 
    
         
            +
                      stub.post('request?full=true', request_body, request_headers) do
         
     | 
| 
      
 143 
     | 
    
         
            +
                        [400, { 'X-Reason' => 'because' }, 'keep looking']
         
     | 
| 
      
 144 
     | 
    
         
            +
                      end
         
     | 
| 
      
 145 
     | 
    
         
            +
                    end
         
     | 
| 
      
 146 
     | 
    
         
            +
                  end
         
     | 
| 
      
 147 
     | 
    
         
            +
                end
         
     | 
| 
      
 148 
     | 
    
         
            +
                let(:request_body) { JSON.generate({ 'item' => 'sth' }) }
         
     | 
| 
      
 149 
     | 
    
         
            +
                let(:request_headers) { { 'Authorization' => 'Basic 123' } }
         
     | 
| 
      
 150 
     | 
    
         
            +
             
     | 
| 
      
 151 
     | 
    
         
            +
                subject(:perform_request) do
         
     | 
| 
      
 152 
     | 
    
         
            +
                  conn.post 'request' do |req|
         
     | 
| 
      
 153 
     | 
    
         
            +
                    req.headers['Authorization'] = 'Basic 123'
         
     | 
| 
      
 154 
     | 
    
         
            +
                    req.params[:full] = true
         
     | 
| 
      
 155 
     | 
    
         
            +
                    req.body = request_body
         
     | 
| 
      
 156 
     | 
    
         
            +
                  end
         
     | 
| 
      
 157 
     | 
    
         
            +
                end
         
     | 
| 
      
 158 
     | 
    
         
            +
             
     | 
| 
      
 159 
     | 
    
         
            +
                it 'returns the request info in the exception' do
         
     | 
| 
      
 160 
     | 
    
         
            +
                  expect { perform_request }.to raise_error(Faraday::BadRequestError) do |ex|
         
     | 
| 
      
 161 
     | 
    
         
            +
                    expect(ex.response[:request][:method]).to eq(:post)
         
     | 
| 
      
 162 
     | 
    
         
            +
                    expect(ex.response[:request][:url_path]).to eq('/request')
         
     | 
| 
      
 163 
     | 
    
         
            +
                    expect(ex.response[:request][:params]).to eq({ 'full' => 'true' })
         
     | 
| 
      
 164 
     | 
    
         
            +
                    expect(ex.response[:request][:headers]).to match(a_hash_including(request_headers))
         
     | 
| 
      
 165 
     | 
    
         
            +
                    expect(ex.response[:request][:body]).to eq(request_body)
         
     | 
| 
      
 166 
     | 
    
         
            +
                  end
         
     | 
| 
       104 
167 
     | 
    
         
             
                end
         
     | 
| 
       105 
168 
     | 
    
         
             
              end
         
     | 
| 
       106 
169 
     | 
    
         
             
            end
         
     | 
| 
         @@ -33,6 +33,7 @@ shared_examples 'adapter examples' do |**options| 
     | 
|
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
              let(:protocol) { ssl_mode? ? 'https' : 'http' }
         
     | 
| 
       35 
35 
     | 
    
         
             
              let(:remote) { "#{protocol}://example.com" }
         
     | 
| 
      
 36 
     | 
    
         
            +
              let(:stub_remote) { remote }
         
     | 
| 
       36 
37 
     | 
    
         | 
| 
       37 
38 
     | 
    
         
             
              let(:conn) do
         
     | 
| 
       38 
39 
     | 
    
         
             
                conn_options[:ssl] ||= {}
         
     | 
| 
         @@ -46,7 +47,7 @@ shared_examples 'adapter examples' do |**options| 
     | 
|
| 
       46 
47 
     | 
    
         
             
                end
         
     | 
| 
       47 
48 
     | 
    
         
             
              end
         
     | 
| 
       48 
49 
     | 
    
         | 
| 
       49 
     | 
    
         
            -
              let!(:request_stub) { stub_request(http_method,  
     | 
| 
      
 50 
     | 
    
         
            +
              let!(:request_stub) { stub_request(http_method, stub_remote) }
         
     | 
| 
       50 
51 
     | 
    
         | 
| 
       51 
52 
     | 
    
         
             
              after do
         
     | 
| 
       52 
53 
     | 
    
         
             
                expect(request_stub).to have_been_requested unless request_stub.disabled?
         
     | 
| 
         @@ -1,5 +1,19 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            shared_examples 'proxy examples' do
         
     | 
| 
      
 4 
     | 
    
         
            +
              it 'handles requests with proxy' do
         
     | 
| 
      
 5 
     | 
    
         
            +
                res = conn.public_send(http_method, '/')
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                expect(res.status).to eq(200)
         
     | 
| 
      
 8 
     | 
    
         
            +
              end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
              it 'handles proxy failures' do
         
     | 
| 
      
 11 
     | 
    
         
            +
                request_stub.to_return(status: 407)
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                expect { conn.public_send(http_method, '/') }.to raise_error(Faraday::ProxyAuthError)
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
       3 
17 
     | 
    
         
             
            shared_examples 'a request method' do |http_method|
         
     | 
| 
       4 
18 
     | 
    
         
             
              let(:query_or_body) { method_with_body?(http_method) ? :body : :query }
         
     | 
| 
       5 
19 
     | 
    
         
             
              let(:response) { conn.public_send(http_method, '/') }
         
     | 
| 
         @@ -13,8 +27,8 @@ shared_examples 'a request method' do |http_method| 
     | 
|
| 
       13 
27 
     | 
    
         
             
              end
         
     | 
| 
       14 
28 
     | 
    
         | 
| 
       15 
29 
     | 
    
         
             
              it 'handles headers with multiple values' do
         
     | 
| 
       16 
     | 
    
         
            -
                request_stub.to_return(headers: { 'Set-Cookie' => ' 
     | 
| 
       17 
     | 
    
         
            -
                expect(response.headers['set-cookie']).to eq(' 
     | 
| 
      
 30 
     | 
    
         
            +
                request_stub.to_return(headers: { 'Set-Cookie' => 'name=value' })
         
     | 
| 
      
 31 
     | 
    
         
            +
                expect(response.headers['set-cookie']).to eq('name=value')
         
     | 
| 
       18 
32 
     | 
    
         
             
              end
         
     | 
| 
       19 
33 
     | 
    
         | 
| 
       20 
34 
     | 
    
         
             
              it 'retrieves the response headers' do
         
     | 
| 
         @@ -119,7 +133,7 @@ shared_examples 'a request method' do |http_method| 
     | 
|
| 
       119 
133 
     | 
    
         
             
                  request_stub.with(headers: { 'Content-Type' => %r{\Amultipart/form-data} }) do |request|
         
     | 
| 
       120 
134 
     | 
    
         
             
                    # WebMock does not support matching body for multipart/form-data requests yet :(
         
     | 
| 
       121 
135 
     | 
    
         
             
                    # https://github.com/bblimke/webmock/issues/623
         
     | 
| 
       122 
     | 
    
         
            -
                    request.body 
     | 
| 
      
 136 
     | 
    
         
            +
                    request.body.include?('RubyMultipartPost')
         
     | 
| 
       123 
137 
     | 
    
         
             
                  end
         
     | 
| 
       124 
138 
     | 
    
         
             
                  conn.public_send(http_method, '/', payload)
         
     | 
| 
       125 
139 
     | 
    
         
             
                end
         
     | 
| 
         @@ -218,17 +232,31 @@ shared_examples 'a request method' do |http_method| 
     | 
|
| 
       218 
232 
     | 
    
         
             
                end
         
     | 
| 
       219 
233 
     | 
    
         
             
              end
         
     | 
| 
       220 
234 
     | 
    
         | 
| 
       221 
     | 
    
         
            -
               
     | 
| 
       222 
     | 
    
         
            -
                 
     | 
| 
      
 235 
     | 
    
         
            +
              context 'when a proxy is provided as option' do
         
     | 
| 
      
 236 
     | 
    
         
            +
                before do
         
     | 
| 
      
 237 
     | 
    
         
            +
                  conn_options[:proxy] = 'http://env-proxy.com:80'
         
     | 
| 
      
 238 
     | 
    
         
            +
                end
         
     | 
| 
       223 
239 
     | 
    
         | 
| 
       224 
     | 
    
         
            -
                 
     | 
| 
       225 
     | 
    
         
            -
                expect(res.status).to eq(200)
         
     | 
| 
      
 240 
     | 
    
         
            +
                include_examples 'proxy examples'
         
     | 
| 
       226 
241 
     | 
    
         
             
              end
         
     | 
| 
       227 
242 
     | 
    
         | 
| 
       228 
     | 
    
         
            -
               
     | 
| 
       229 
     | 
    
         
            -
                 
     | 
| 
       230 
     | 
    
         
            -
                request_stub.to_return(status: 407)
         
     | 
| 
      
 243 
     | 
    
         
            +
              context 'when http_proxy env variable is set' do
         
     | 
| 
      
 244 
     | 
    
         
            +
                let(:proxy_url) { 'http://env-proxy.com:80' }
         
     | 
| 
       231 
245 
     | 
    
         | 
| 
       232 
     | 
    
         
            -
                 
     | 
| 
      
 246 
     | 
    
         
            +
                around do |example|
         
     | 
| 
      
 247 
     | 
    
         
            +
                  with_env 'http_proxy' => proxy_url do
         
     | 
| 
      
 248 
     | 
    
         
            +
                    example.run
         
     | 
| 
      
 249 
     | 
    
         
            +
                  end
         
     | 
| 
      
 250 
     | 
    
         
            +
                end
         
     | 
| 
      
 251 
     | 
    
         
            +
             
     | 
| 
      
 252 
     | 
    
         
            +
                include_examples 'proxy examples'
         
     | 
| 
      
 253 
     | 
    
         
            +
             
     | 
| 
      
 254 
     | 
    
         
            +
                context 'when the env proxy is ignored' do
         
     | 
| 
      
 255 
     | 
    
         
            +
                  around do |example|
         
     | 
| 
      
 256 
     | 
    
         
            +
                    with_env_proxy_disabled(&example)
         
     | 
| 
      
 257 
     | 
    
         
            +
                  end
         
     | 
| 
      
 258 
     | 
    
         
            +
             
     | 
| 
      
 259 
     | 
    
         
            +
                  include_examples 'proxy examples'
         
     | 
| 
      
 260 
     | 
    
         
            +
                end
         
     | 
| 
       233 
261 
     | 
    
         
             
              end
         
     | 
| 
       234 
262 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: faraday
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.4.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - "@technoweenie"
         
     | 
| 
         @@ -10,8 +10,50 @@ authors: 
     | 
|
| 
       10 
10 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       11 
11 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       12 
12 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       13 
     | 
    
         
            -
            date:  
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2021-04-16 00:00:00.000000000 Z
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
      
 15 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 16 
     | 
    
         
            +
              name: faraday-excon
         
     | 
| 
      
 17 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 18 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 19 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 20 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 21 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 22 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 23 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 25 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 26 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 27 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 28 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 29 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 30 
     | 
    
         
            +
              name: faraday-net_http
         
     | 
| 
      
 31 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 32 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 33 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 34 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 35 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 36 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 37 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 38 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 39 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 40 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 41 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 42 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 43 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 44 
     | 
    
         
            +
              name: faraday-net_http_persistent
         
     | 
| 
      
 45 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 46 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 47 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 48 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 49 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 50 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 51 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 52 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 53 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 54 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 55 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 56 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
       15 
57 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       16 
58 
     | 
    
         
             
              name: multipart-post
         
     | 
| 
       17 
59 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -32,6 +74,20 @@ dependencies: 
     | 
|
| 
       32 
74 
     | 
    
         
             
                - - "<"
         
     | 
| 
       33 
75 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       34 
76 
     | 
    
         
             
                    version: '3'
         
     | 
| 
      
 77 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 78 
     | 
    
         
            +
              name: ruby2_keywords
         
     | 
| 
      
 79 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 80 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 81 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 82 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 83 
     | 
    
         
            +
                    version: 0.0.4
         
     | 
| 
      
 84 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 85 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 86 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 87 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 88 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 89 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 90 
     | 
    
         
            +
                    version: 0.0.4
         
     | 
| 
       35 
91 
     | 
    
         
             
            description: 
         
     | 
| 
       36 
92 
     | 
    
         
             
            email: technoweenie@gmail.com
         
     | 
| 
       37 
93 
     | 
    
         
             
            executables: []
         
     | 
| 
         @@ -50,10 +106,7 @@ files: 
     | 
|
| 
       50 
106 
     | 
    
         
             
            - lib/faraday/adapter/em_http_ssl_patch.rb
         
     | 
| 
       51 
107 
     | 
    
         
             
            - lib/faraday/adapter/em_synchrony.rb
         
     | 
| 
       52 
108 
     | 
    
         
             
            - lib/faraday/adapter/em_synchrony/parallel_manager.rb
         
     | 
| 
       53 
     | 
    
         
            -
            - lib/faraday/adapter/excon.rb
         
     | 
| 
       54 
109 
     | 
    
         
             
            - lib/faraday/adapter/httpclient.rb
         
     | 
| 
       55 
     | 
    
         
            -
            - lib/faraday/adapter/net_http.rb
         
     | 
| 
       56 
     | 
    
         
            -
            - lib/faraday/adapter/net_http_persistent.rb
         
     | 
| 
       57 
110 
     | 
    
         
             
            - lib/faraday/adapter/patron.rb
         
     | 
| 
       58 
111 
     | 
    
         
             
            - lib/faraday/adapter/rack.rb
         
     | 
| 
       59 
112 
     | 
    
         
             
            - lib/faraday/adapter/test.rb
         
     | 
| 
         @@ -67,6 +120,7 @@ files: 
     | 
|
| 
       67 
120 
     | 
    
         
             
            - lib/faraday/error.rb
         
     | 
| 
       68 
121 
     | 
    
         
             
            - lib/faraday/file_part.rb
         
     | 
| 
       69 
122 
     | 
    
         
             
            - lib/faraday/logging/formatter.rb
         
     | 
| 
      
 123 
     | 
    
         
            +
            - lib/faraday/methods.rb
         
     | 
| 
       70 
124 
     | 
    
         
             
            - lib/faraday/middleware.rb
         
     | 
| 
       71 
125 
     | 
    
         
             
            - lib/faraday/middleware_registry.rb
         
     | 
| 
       72 
126 
     | 
    
         
             
            - lib/faraday/options.rb
         
     | 
| 
         @@ -92,15 +146,16 @@ files: 
     | 
|
| 
       92 
146 
     | 
    
         
             
            - lib/faraday/utils.rb
         
     | 
| 
       93 
147 
     | 
    
         
             
            - lib/faraday/utils/headers.rb
         
     | 
| 
       94 
148 
     | 
    
         
             
            - lib/faraday/utils/params_hash.rb
         
     | 
| 
      
 149 
     | 
    
         
            +
            - lib/faraday/version.rb
         
     | 
| 
       95 
150 
     | 
    
         
             
            - spec/external_adapters/faraday_specs_setup.rb
         
     | 
| 
       96 
151 
     | 
    
         
             
            - spec/faraday/adapter/em_http_spec.rb
         
     | 
| 
       97 
152 
     | 
    
         
             
            - spec/faraday/adapter/em_synchrony_spec.rb
         
     | 
| 
       98 
153 
     | 
    
         
             
            - spec/faraday/adapter/excon_spec.rb
         
     | 
| 
       99 
154 
     | 
    
         
             
            - spec/faraday/adapter/httpclient_spec.rb
         
     | 
| 
       100 
     | 
    
         
            -
            - spec/faraday/adapter/net_http_persistent_spec.rb
         
     | 
| 
       101 
155 
     | 
    
         
             
            - spec/faraday/adapter/net_http_spec.rb
         
     | 
| 
       102 
156 
     | 
    
         
             
            - spec/faraday/adapter/patron_spec.rb
         
     | 
| 
       103 
157 
     | 
    
         
             
            - spec/faraday/adapter/rack_spec.rb
         
     | 
| 
      
 158 
     | 
    
         
            +
            - spec/faraday/adapter/test_spec.rb
         
     | 
| 
       104 
159 
     | 
    
         
             
            - spec/faraday/adapter/typhoeus_spec.rb
         
     | 
| 
       105 
160 
     | 
    
         
             
            - spec/faraday/adapter_registry_spec.rb
         
     | 
| 
       106 
161 
     | 
    
         
             
            - spec/faraday/adapter_spec.rb
         
     | 
| 
         @@ -142,7 +197,7 @@ licenses: 
     | 
|
| 
       142 
197 
     | 
    
         
             
            - MIT
         
     | 
| 
       143 
198 
     | 
    
         
             
            metadata:
         
     | 
| 
       144 
199 
     | 
    
         
             
              homepage_uri: https://lostisland.github.io/faraday
         
     | 
| 
       145 
     | 
    
         
            -
              changelog_uri: https://github.com/lostisland/faraday/releases/tag/v1.0 
     | 
| 
      
 200 
     | 
    
         
            +
              changelog_uri: https://github.com/lostisland/faraday/releases/tag/v1.4.0
         
     | 
| 
       146 
201 
     | 
    
         
             
              source_code_uri: https://github.com/lostisland/faraday
         
     | 
| 
       147 
202 
     | 
    
         
             
              bug_tracker_uri: https://github.com/lostisland/faraday/issues
         
     | 
| 
       148 
203 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
         @@ -154,14 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       154 
209 
     | 
    
         
             
              requirements:
         
     | 
| 
       155 
210 
     | 
    
         
             
              - - ">="
         
     | 
| 
       156 
211 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       157 
     | 
    
         
            -
                  version: '2. 
     | 
| 
      
 212 
     | 
    
         
            +
                  version: '2.4'
         
     | 
| 
       158 
213 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       159 
214 
     | 
    
         
             
              requirements:
         
     | 
| 
       160 
215 
     | 
    
         
             
              - - ">="
         
     | 
| 
       161 
216 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       162 
217 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       163 
218 
     | 
    
         
             
            requirements: []
         
     | 
| 
       164 
     | 
    
         
            -
            rubygems_version: 3.0.3
         
     | 
| 
      
 219 
     | 
    
         
            +
            rubygems_version: 3.0.3.1
         
     | 
| 
       165 
220 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       166 
221 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       167 
222 
     | 
    
         
             
            summary: HTTP/REST API client library.
         
     |