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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a536d04e90db04fdeca6edd06c3e88782106a660d410a1b908b94147a3e9154
4
- data.tar.gz: d0d89904a00069fdd8f3ef297f296e5da9d1383a4b4239aeebf00b6869be082a
3
+ metadata.gz: 41b0c46c3ced081c73e722058eace5a163bb5f84516fb4c6a6d074800ade7d7d
4
+ data.tar.gz: e4f37fdf66fa76cc137ec6142bc445468a904f0cbaea2578850c6984478f4228
5
5
  SHA512:
6
- metadata.gz: 858291c8b53ce6447df1cc23fabd7c74ca4307ff7590eaebb76f4d538b769f81d9d89055bf79bf564814cf55c6832fccee42918100433061331252c6aafd8042
7
- data.tar.gz: 49356178736094b85a4d9c1eab8dcf390024df5b580cb696e7f02683cbc1f1cf4a3e5bcfc6e03f5e8b9330fed1e02b94dd8bbbe17ec3c58e14b91b7352df9030
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 if value.present?
83
+ Time.zone.at(value.to_i).to_datetime
84
84
  end
85
85
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHC
4
- VERSION ||= '12.2.0'
4
+ VERSION ||= '12.2.1'
5
5
  end
@@ -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.0
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-24 00:00:00.000000000 Z
11
+ date: 2020-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport