excon 0.63.0 → 0.64.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.
Potentially problematic release.
This version of excon might be problematic. Click here for more details.
- checksums.yaml +4 -4
 - data/changelog.txt +5 -0
 - data/lib/excon/connection.rb +10 -1
 - data/lib/excon/version.rb +1 -1
 - data/tests/middleware_tests.rb +27 -0
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: '0089e6e20aad3c735ea51b5dae6b90820b31d1379d2159cb01a2d2ab5e1e0fa8'
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f362e1a3bbedfa71887fcd4c53ef3d202cfe7a337a8d1414396787e8eb160733
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: d03f86c4ec2ab00e8190f462cc21e64709be82820898e3d1ce25229ebbe23a3026939b879a07dffb255e4dadf47a59f103cca6035661f7d361164e78a2144efc
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: efecb7088b79a9e951cec7af4ae768addb8ed7bee909bfe6ace5cecbcb7d43cbbcb9846a04feebe6b17c545d20eeefbca8d2733865e0613e93f74cbc8b7f1179
         
     | 
    
        data/changelog.txt
    CHANGED
    
    
    
        data/lib/excon/connection.rb
    CHANGED
    
    | 
         @@ -398,7 +398,16 @@ module Excon 
     | 
|
| 
       398 
398 
     | 
    
         
             
                end
         
     | 
| 
       399 
399 
     | 
    
         | 
| 
       400 
400 
     | 
    
         
             
                def valid_middleware_keys(middlewares)
         
     | 
| 
       401 
     | 
    
         
            -
                  middlewares.flat_map 
     | 
| 
      
 401 
     | 
    
         
            +
                  middlewares.flat_map do |middleware|
         
     | 
| 
      
 402 
     | 
    
         
            +
                    if middleware.respond_to?(:valid_parameter_keys)
         
     | 
| 
      
 403 
     | 
    
         
            +
                      middleware.valid_parameter_keys
         
     | 
| 
      
 404 
     | 
    
         
            +
                    else
         
     | 
| 
      
 405 
     | 
    
         
            +
                      Excon.display_warning(
         
     | 
| 
      
 406 
     | 
    
         
            +
                        "Excon middleware #{middleware} does not define #valid_parameter_keys"
         
     | 
| 
      
 407 
     | 
    
         
            +
                      )
         
     | 
| 
      
 408 
     | 
    
         
            +
                      []
         
     | 
| 
      
 409 
     | 
    
         
            +
                    end
         
     | 
| 
      
 410 
     | 
    
         
            +
                  end
         
     | 
| 
       402 
411 
     | 
    
         
             
                end
         
     | 
| 
       403 
412 
     | 
    
         | 
| 
       404 
413 
     | 
    
         
             
                def validate_params(validation, params, middlewares)
         
     | 
    
        data/lib/excon/version.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Shindo.tests('Excon middleware') do
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
              with_rackup('basic.ru', '0.0.0.0') do
         
     | 
| 
      
 4 
     | 
    
         
            +
                tests('succeeds without defining valid_parameter_keys') do
         
     | 
| 
      
 5 
     | 
    
         
            +
                  class Middleware
         
     | 
| 
      
 6 
     | 
    
         
            +
                    def initialize(stack)
         
     | 
| 
      
 7 
     | 
    
         
            +
                      @stack = stack
         
     | 
| 
      
 8 
     | 
    
         
            +
                    end
         
     | 
| 
      
 9 
     | 
    
         
            +
                    def error_call(datum)
         
     | 
| 
      
 10 
     | 
    
         
            +
                      @stack.error_call(datum)
         
     | 
| 
      
 11 
     | 
    
         
            +
                    end
         
     | 
| 
      
 12 
     | 
    
         
            +
                    def request_call(datum)
         
     | 
| 
      
 13 
     | 
    
         
            +
                      @stack.request_call(datum)
         
     | 
| 
      
 14 
     | 
    
         
            +
                    end
         
     | 
| 
      
 15 
     | 
    
         
            +
                    def response_call(datum)
         
     | 
| 
      
 16 
     | 
    
         
            +
                      @stack.response_call(datum)
         
     | 
| 
      
 17 
     | 
    
         
            +
                    end
         
     | 
| 
      
 18 
     | 
    
         
            +
                  end
         
     | 
| 
      
 19 
     | 
    
         
            +
                  silence_warnings do
         
     | 
| 
      
 20 
     | 
    
         
            +
                    Excon.get(
         
     | 
| 
      
 21 
     | 
    
         
            +
                      'http://127.0.0.1:9292/content-length/100',
         
     | 
| 
      
 22 
     | 
    
         
            +
                      :middlewares => Excon.defaults[:middlewares] + [Middleware]
         
     | 
| 
      
 23 
     | 
    
         
            +
                    )
         
     | 
| 
      
 24 
     | 
    
         
            +
                  end
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: excon
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.64.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - dpiddy (Dan Peterson)
         
     | 
| 
         @@ -10,7 +10,7 @@ authors: 
     | 
|
| 
       10 
10 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       11 
11 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       12 
12 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       13 
     | 
    
         
            -
            date: 2019-04- 
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2019-04-15 00:00:00.000000000 Z
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       16 
16 
     | 
    
         
             
              name: rspec
         
     | 
| 
         @@ -279,6 +279,7 @@ files: 
     | 
|
| 
       279 
279 
     | 
    
         
             
            - tests/error_tests.rb
         
     | 
| 
       280 
280 
     | 
    
         
             
            - tests/header_tests.rb
         
     | 
| 
       281 
281 
     | 
    
         
             
            - tests/instrumentors/logging_instrumentor_tests.rb
         
     | 
| 
      
 282 
     | 
    
         
            +
            - tests/middleware_tests.rb
         
     | 
| 
       282 
283 
     | 
    
         
             
            - tests/middlewares/canned_response_tests.rb
         
     | 
| 
       283 
284 
     | 
    
         
             
            - tests/middlewares/capture_cookies_tests.rb
         
     | 
| 
       284 
285 
     | 
    
         
             
            - tests/middlewares/decompress_tests.rb
         
     |