pact-support 1.14.3 → 1.15.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 +9 -0
 - data/lib/pact/consumer_contract/pact_file.rb +25 -0
 - data/lib/pact/support/version.rb +1 -1
 - metadata +3 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f2ee65cf7dfde0e38da424b8c462877550c73d8eb4a32d141979e3571dd5b68b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 156429a88a8fa6e2af7650a4ab82541a375e81a7d7613f8c1fc35d21a0f0c18f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3d14e51c30179bae9db88aa6b9dfc4c6780a9fb5aafd446e5e7b0914ccc1421f9d508a19d744864756b4a6b3809cc1579f0d344a169b1837f28ef6705f4b0448
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1e072929086a22a1e8a6ed2bc07e6a4d46fed8f666f177971596249357c641d1fc976c2751f73c03324963b81227bc0afa9324db905308cc8aabb4914c9d9b0a
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -79,12 +79,37 @@ module Pact 
     | 
|
| 
       79 
79 
     | 
    
         | 
| 
       80 
80 
     | 
    
         
             
                def get_remote(uri, options)
         
     | 
| 
       81 
81 
     | 
    
         
             
                  request = Net::HTTP::Get.new(uri)
         
     | 
| 
      
 82 
     | 
    
         
            +
                  request = prepare_auth(request, options) if options[:username] || options[:token]
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
                  http = prepare_request(uri)
         
     | 
| 
      
 85 
     | 
    
         
            +
                  response = perform_http_request(http, request, options)
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                  if response.is_a?(Net::HTTPRedirection)
         
     | 
| 
      
 88 
     | 
    
         
            +
                    uri = URI(response.header['location'])
         
     | 
| 
      
 89 
     | 
    
         
            +
                    req = Net::HTTP::Get.new(uri)
         
     | 
| 
      
 90 
     | 
    
         
            +
                    req = prepare_auth(req, options) if options[:username] || options[:token]
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                    http = prepare_request(uri)
         
     | 
| 
      
 93 
     | 
    
         
            +
                    response = perform_http_request(http, req, options)
         
     | 
| 
      
 94 
     | 
    
         
            +
                  end
         
     | 
| 
      
 95 
     | 
    
         
            +
                  response
         
     | 
| 
      
 96 
     | 
    
         
            +
                end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                def prepare_auth(request, options)
         
     | 
| 
       82 
99 
     | 
    
         
             
                  request.basic_auth(options[:username], options[:password]) if options[:username]
         
     | 
| 
       83 
100 
     | 
    
         
             
                  request['Authorization'] = "Bearer #{options[:token]}" if options[:token]
         
     | 
| 
      
 101 
     | 
    
         
            +
                  request
         
     | 
| 
      
 102 
     | 
    
         
            +
                end
         
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
      
 104 
     | 
    
         
            +
                def prepare_request(uri)
         
     | 
| 
       84 
105 
     | 
    
         
             
                  http = Net::HTTP.new(uri.host, uri.port, :ENV)
         
     | 
| 
       85 
106 
     | 
    
         
             
                  http.use_ssl = (uri.scheme == 'https')
         
     | 
| 
       86 
107 
     | 
    
         
             
                  http.ca_file = ENV['SSL_CERT_FILE'] if ENV['SSL_CERT_FILE'] && ENV['SSL_CERT_FILE'] != ''
         
     | 
| 
       87 
108 
     | 
    
         
             
                  http.ca_path = ENV['SSL_CERT_DIR'] if ENV['SSL_CERT_DIR'] && ENV['SSL_CERT_DIR'] != ''
         
     | 
| 
      
 109 
     | 
    
         
            +
                  http
         
     | 
| 
      
 110 
     | 
    
         
            +
                end
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                def perform_http_request(http, request, options)
         
     | 
| 
       88 
113 
     | 
    
         
             
                  http.start do |http|
         
     | 
| 
       89 
114 
     | 
    
         
             
                    http.open_timeout = options[:open_timeout] || OPEN_TIMEOUT
         
     | 
| 
       90 
115 
     | 
    
         
             
                    http.read_timeout = options[:read_timeout] || READ_TIMEOUT
         
     | 
    
        data/lib/pact/support/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: pact-support
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.15.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - James Fraser
         
     | 
| 
         @@ -12,7 +12,7 @@ authors: 
     | 
|
| 
       12 
12 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       14 
14 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       15 
     | 
    
         
            -
            date: 2020- 
     | 
| 
      
 15 
     | 
    
         
            +
            date: 2020-05-01 00:00:00.000000000 Z
         
     | 
| 
       16 
16 
     | 
    
         
             
            dependencies:
         
     | 
| 
       17 
17 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       18 
18 
     | 
    
         
             
              name: randexp
         
     | 
| 
         @@ -298,8 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       298 
298 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       299 
299 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       300 
300 
     | 
    
         
             
            requirements: []
         
     | 
| 
       301 
     | 
    
         
            -
             
     | 
| 
       302 
     | 
    
         
            -
            rubygems_version: 2.7.6
         
     | 
| 
      
 301 
     | 
    
         
            +
            rubygems_version: 3.0.6
         
     | 
| 
       303 
302 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       304 
303 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       305 
304 
     | 
    
         
             
            summary: Shared code for Pact gems
         
     |