fb-support 1.0.0.alpha5 → 1.0.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90a4cb148ef3c1b148eac8953b611cd63f3034999cb5a1e33795e85085c0c91b
4
- data.tar.gz: 71d38e58297da8b68cae44554f381025eba344d187c0db5f5908c8ee07a2d2b4
3
+ metadata.gz: 84710c0524e0f1372564277a6c79c58c488518eb0c5bd3aa3b77bbcb0ed1e2b7
4
+ data.tar.gz: 9b76c1b8de6609b3291228c736fbc518a44fec6e998f8d602aa29ecee3fdc03f
5
5
  SHA512:
6
- metadata.gz: d8e9af893c25d8476c2a0cc40a14c0740692055f4275a6c3f7f72bb97f857af3fe5abe800808084498260c0c050d4c0f5f950e63113c56b0e14e0043db251578
7
- data.tar.gz: 0e5e1c572d0d07548406c52f225b404f39d450948d4987635b2d587e4770911a1def7d43abe072c27e04413b379f9b546762135217dbd6244ad9a5f35ae060b9
6
+ metadata.gz: a1660a6e93d37e1d3300052030f1dd7ae716ff8186ce0657e36cbbabd0386c3e4ee3e016c8e6e028046feea6583f53bf149e0beaa1d83619155b489741756743
7
+ data.tar.gz: a8890a505edaba286a35d35c933008f8a44c784f876915c5ca4cfc07284ba4c5a9cadb284d9440a7ed3ff09c8ff3ab543fac145f0b9ad16f5f38a7149c2a7270
data/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ For more information about changelogs, check
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
9
 
10
+ ## 1.0.0.alpha6 - 2018-08-24
11
+
12
+ * [BUGFIX] Do not raise error from `rate_limiting_header` when
13
+ response does not have the usage status header.
14
+
10
15
  ## 1.0.0.alpha5 - 2018-08-23
11
16
 
12
17
  * [FEATURE] Wait when usage status is approaching limit.
@@ -45,7 +45,7 @@ module Fb
45
45
  # @raise [Fb::HTTPError] if the request fails.
46
46
  def run
47
47
  if response.is_a? @expected_response
48
- if (waiting_time = self.class.waiting_time) &&
48
+ if (waiting_time = self.class.waiting_time) && rate_limiting_header &&
49
49
  rate_limiting_header.values.any? {|value| value > 85 }
50
50
  sleep waiting_time
51
51
  end
@@ -64,7 +64,8 @@ module Fb
64
64
 
65
65
  # @return [Hash] rate limit status in the response header.
66
66
  def rate_limiting_header
67
- JSON response.to_hash['x-app-usage'][0]
67
+ usage = response.to_hash['x-app-usage']
68
+ JSON usage[0] if usage
68
69
  end
69
70
 
70
71
  private
@@ -3,6 +3,6 @@ module Fb
3
3
  module Support
4
4
  # @return [String] the SemVer-compatible gem version.
5
5
  # @see http://semver.org
6
- VERSION = '1.0.0.alpha5'
6
+ VERSION = '1.0.0.alpha6'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha5
4
+ version: 1.0.0.alpha6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-08-28 00:00:00.000000000 Z
12
+ date: 2018-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler