intercom 3.5.24 → 3.5.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/intercom/request.rb +1 -1
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/request_spec.rb +4 -4
- metadata +26 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '00705085830c8f265f87386afef35cdaf81bd194'
|
4
|
+
data.tar.gz: 918f33d66ba48c4af692fd80e3d428b7bdfaae49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38857bc2b76c472b997fe2e2b209c8c78cad6a168af28ba044af67635ae402c53a10b72b8b78515f353382578108ce94afad090d7f20bc3dd3f1804d2bb1fb7b
|
7
|
+
data.tar.gz: 5d3387191e313a532a311cce57d3728ab59eb2b12e12eeedc82b7f0dd11c1c3d0eb003df1772e16e5481d54f67949478d61fb8f80bb8a6546a5288c586029b37
|
data/README.md
CHANGED
data/lib/intercom/request.rb
CHANGED
@@ -110,7 +110,7 @@ module Intercom
|
|
110
110
|
rate_limit_details = {}
|
111
111
|
rate_limit_details[:limit] = response['X-RateLimit-Limit'].to_i if response['X-RateLimit-Limit']
|
112
112
|
rate_limit_details[:remaining] = response['X-RateLimit-Remaining'].to_i if response['X-RateLimit-Remaining']
|
113
|
-
rate_limit_details[:reset_at] = Time.
|
113
|
+
rate_limit_details[:reset_at] = Time.at(response['X-RateLimit-Reset'].to_i) if response['X-RateLimit-Reset']
|
114
114
|
@rate_limit_details = rate_limit_details
|
115
115
|
end
|
116
116
|
|
data/lib/intercom/version.rb
CHANGED
@@ -33,7 +33,7 @@ describe 'Intercom::Request' do
|
|
33
33
|
it 'should call sleep for rate limit error three times' do
|
34
34
|
# Use webmock to mock the HTTP request
|
35
35
|
stub_request(:any, uri).\
|
36
|
-
to_return(status: [429, "Too Many Requests"], headers: { 'X-RateLimit-Reset' => Time.now.utc + 10 })
|
36
|
+
to_return(status: [429, "Too Many Requests"], headers: { 'X-RateLimit-Reset' => (Time.now.utc + 10).to_i.to_s })
|
37
37
|
req = Intercom::Request.get(uri, "")
|
38
38
|
req.handle_rate_limit=true
|
39
39
|
req.expects(:sleep).times(3).with(any_parameters)
|
@@ -53,7 +53,7 @@ describe 'Intercom::Request' do
|
|
53
53
|
it 'should call sleep for rate limit error just once' do
|
54
54
|
# Use webmock to mock the HTTP request
|
55
55
|
stub_request(:any, uri).\
|
56
|
-
to_return(status: [429, "Too Many Requests"], headers: { 'X-RateLimit-Reset' => Time.now.utc + 10 }).\
|
56
|
+
to_return(status: [429, "Too Many Requests"], headers: { 'X-RateLimit-Reset' => (Time.now.utc + 10).to_i.to_s }).\
|
57
57
|
then.to_return(status: [200, "OK"])
|
58
58
|
req = Intercom::Request.get(uri, "")
|
59
59
|
req.handle_rate_limit=true
|
@@ -64,7 +64,7 @@ describe 'Intercom::Request' do
|
|
64
64
|
it 'should not sleep if rate limit reset time has passed' do
|
65
65
|
# Use webmock to mock the HTTP request
|
66
66
|
stub_request(:any, uri).\
|
67
|
-
to_return(status: [429, "Too Many Requests"], headers: { 'X-RateLimit-Reset' => Time.parse("February 25 2010").utc }).\
|
67
|
+
to_return(status: [429, "Too Many Requests"], headers: { 'X-RateLimit-Reset' => Time.parse("February 25 2010").utc.to_i.to_s }).\
|
68
68
|
then.to_return(status: [200, "OK"])
|
69
69
|
req = Intercom::Request.get(uri, "")
|
70
70
|
req.handle_rate_limit=true
|
@@ -80,7 +80,7 @@ describe 'Intercom::Request' do
|
|
80
80
|
it 'should raise ResourceNotUniqueError error on resource_conflict code' do
|
81
81
|
# Use webmock to mock the HTTP request
|
82
82
|
stub_request(:put, uri).\
|
83
|
-
to_return(status: [409, "Resource Already Exists"], headers: { 'X-RateLimit-Reset' => Time.now.utc + 10 }, body: {type: "error.list", errors: [ code: "resource_conflict" ]}.to_json)
|
83
|
+
to_return(status: [409, "Resource Already Exists"], headers: { 'X-RateLimit-Reset' => (Time.now.utc + 10).to_i.to_s }, body: {type: "error.list", errors: [ code: "resource_conflict" ]}.to_json)
|
84
84
|
req = Intercom::Request.put(uri, "")
|
85
85
|
expect { req.execute(target_base_url=uri, username: "ted", secret: "") }.must_raise(Intercom::ResourceNotUniqueError)
|
86
86
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben McRedmond
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2018-05-
|
18
|
+
date: 2018-05-11 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|
@@ -244,8 +244,30 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
246
|
rubyforge_project: intercom
|
247
|
-
rubygems_version: 2.
|
247
|
+
rubygems_version: 2.6.14.1
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Ruby bindings for the Intercom API
|
251
|
-
test_files:
|
251
|
+
test_files:
|
252
|
+
- spec/spec_helper.rb
|
253
|
+
- spec/unit/intercom/admin_spec.rb
|
254
|
+
- spec/unit/intercom/client_collection_proxy_spec.rb
|
255
|
+
- spec/unit/intercom/client_spec.rb
|
256
|
+
- spec/unit/intercom/company_spec.rb
|
257
|
+
- spec/unit/intercom/contact_spec.rb
|
258
|
+
- spec/unit/intercom/conversation_spec.rb
|
259
|
+
- spec/unit/intercom/count_spec.rb
|
260
|
+
- spec/unit/intercom/event_spec.rb
|
261
|
+
- spec/unit/intercom/job_spec.rb
|
262
|
+
- spec/unit/intercom/lib/flat_store_spec.rb
|
263
|
+
- spec/unit/intercom/message_spec.rb
|
264
|
+
- spec/unit/intercom/note_spec.rb
|
265
|
+
- spec/unit/intercom/request_spec.rb
|
266
|
+
- spec/unit/intercom/scroll_collection_proxy_spec.rb
|
267
|
+
- spec/unit/intercom/segment_spec.rb
|
268
|
+
- spec/unit/intercom/subscription_spec.rb
|
269
|
+
- spec/unit/intercom/tag_spec.rb
|
270
|
+
- spec/unit/intercom/traits/api_resource_spec.rb
|
271
|
+
- spec/unit/intercom/user_spec.rb
|
272
|
+
- spec/unit/intercom/visitors_spec.rb
|
273
|
+
- spec/unit/intercom_spec.rb
|