lhc 12.2.0 → 12.2.1
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/lib/lhc/interceptors/throttle.rb +2 -2
- data/lib/lhc/version.rb +1 -1
- data/spec/interceptors/throttle/main_spec.rb +15 -2
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 41b0c46c3ced081c73e722058eace5a163bb5f84516fb4c6a6d074800ade7d7d
         | 
| 4 | 
            +
              data.tar.gz: e4f37fdf66fa76cc137ec6142bc445468a904f0cbaea2578850c6984478f4228
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b94b128def1cea71f871c2a14787a52e1ca76755b849fb4504b044f99c9ce4d35ce5a89b8d54621f539f83d51dfa72047b2538adc33f8ab4713f030dcefd31db
         | 
| 7 | 
            +
              data.tar.gz: e1354bbb77a671ef3d98ef33755ada6c4d32373f34609fc858c57744f4c4aed9543373ebf4f837d0ce4bc8c8f8962bcdef60cc2f0ed2045b1dac00f4139ce054
         | 
| @@ -3,7 +3,6 @@ | |
| 3 3 | 
             
            require 'active_support/duration'
         | 
| 4 4 |  | 
| 5 5 | 
             
            class LHC::Throttle < LHC::Interceptor
         | 
| 6 | 
            -
             | 
| 7 6 | 
             
              class OutOfQuota < StandardError
         | 
| 8 7 | 
             
              end
         | 
| 9 8 |  | 
| @@ -79,7 +78,8 @@ class LHC::Throttle < LHC::Interceptor | |
| 79 78 | 
             
              end
         | 
| 80 79 |  | 
| 81 80 | 
             
              def convert_expires(value)
         | 
| 81 | 
            +
                return if value.blank?
         | 
| 82 82 | 
             
                return Time.parse(value) if value.match(/GMT/)
         | 
| 83 | 
            -
                Time.zone.at(value.to_i).to_datetime | 
| 83 | 
            +
                Time.zone.at(value.to_i).to_datetime
         | 
| 84 84 | 
             
              end
         | 
| 85 85 | 
             
            end
         | 
    
        data/lib/lhc/version.rb
    CHANGED
    
    
| @@ -128,7 +128,6 @@ describe LHC::Throttle do | |
| 128 128 |  | 
| 129 129 | 
             
                    it 'does not hit the breaks' do
         | 
| 130 130 | 
             
                      LHC.get('http://local.ch', options)
         | 
| 131 | 
            -
                      LHC.get('http://local.ch', options)
         | 
| 132 131 | 
             
                    end
         | 
| 133 132 | 
             
                  end
         | 
| 134 133 | 
             
                end
         | 
| @@ -154,9 +153,23 @@ describe LHC::Throttle do | |
| 154 153 |  | 
| 155 154 | 
             
                    it 'does not hit the breaks' do
         | 
| 156 155 | 
             
                      LHC.get('http://local.ch', options)
         | 
| 157 | 
            -
                      LHC.get('http://local.ch', options)
         | 
| 158 156 | 
             
                    end
         | 
| 159 157 | 
             
                  end
         | 
| 160 158 | 
             
                end
         | 
| 161 159 | 
             
              end
         | 
| 160 | 
            +
             | 
| 161 | 
            +
              context 'when value is empty' do
         | 
| 162 | 
            +
                let(:quota_reset) { nil }
         | 
| 163 | 
            +
             | 
| 164 | 
            +
                before do
         | 
| 165 | 
            +
                  stub_request(:get, 'http://local.ch').to_return(
         | 
| 166 | 
            +
                    headers: { 'limit' => quota_limit, 'remaining' => quota_remaining }
         | 
| 167 | 
            +
                  )
         | 
| 168 | 
            +
                  LHC.get('http://local.ch', options)
         | 
| 169 | 
            +
                end
         | 
| 170 | 
            +
             | 
| 171 | 
            +
                it 'still runs' do
         | 
| 172 | 
            +
                  LHC.get('http://local.ch', options)
         | 
| 173 | 
            +
                end
         | 
| 174 | 
            +
              end
         | 
| 162 175 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: lhc
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 12.2. | 
| 4 | 
            +
              version: 12.2.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - https://github.com/local-ch/lhc/contributors
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020-08- | 
| 11 | 
            +
            date: 2020-08-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         |