intercom 3.5.20 → 3.5.21

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
  SHA1:
3
- metadata.gz: d152cf68b6c2269f1a3c8e03dbfd9a2a8ec8e824
4
- data.tar.gz: f3a554b9dd3ea886772429038ce83cc2ea8fb71b
3
+ metadata.gz: 1ea6f75d92d9202cfbc6fe25b4336c3a4081efb1
4
+ data.tar.gz: e3444b8fec87362f93ba4fa6a7f59d7960edf557
5
5
  SHA512:
6
- metadata.gz: 213eec7d52a614cf17e3523b5e15e241004e0e6a1210acc0f0d2e13df2e376196711197e4c1109d92310fd29a37a075829ce37597ba422ee2cdd41acc711a7f4
7
- data.tar.gz: d399e5fd78ac2df6f1b6102e3d2aa159b4636e8734901725cf858eab0092e7e1da946672268bd7eb1938ea502ac5a206c30f4e0dac28c337bb1444ba2e0301de
6
+ metadata.gz: 9940e952b926c8c918507e27fd7a01a58318f0994ca8e25a1a61a88c63d5ddcf0b2b7b3cb5e5e911eed3a4752903ae9e24468ac23885b2bcbea41206f34509b2
7
+ data.tar.gz: 11ede13348d1697930f2b6c7198dbda65efd3235491b79552e1b62a1f9ec39811f17dad25e7608756f8cb47d8a25c28fa6081f104da0d1262bf00adb5fbdb4c0
data/README.md CHANGED
@@ -22,7 +22,7 @@ This version of the gem is compatible with `Ruby 2.1` and above.
22
22
 
23
23
  Using bundler:
24
24
 
25
- gem 'intercom', '~> 3.5.20'
25
+ gem 'intercom', '~> 3.5.21'
26
26
 
27
27
  ## Basic Usage
28
28
 
@@ -1,3 +1,8 @@
1
+ 3.5.21
2
+ - Fix for PR-353 which addressed "NoMethodError in intercom/request"
3
+ - There were issues on older versions of Ruby (<2.3)
4
+ - This PR does not use lonely operator and instead simple checks for nil parsed_body
5
+
1
6
  3.5.17
2
7
  - Fix BlockedUserError typo
3
8
 
@@ -100,7 +100,8 @@ module Intercom
100
100
  rescue JSON::ParserError => _
101
101
  raise_errors_on_failure(response)
102
102
  end
103
- raise_application_errors_on_failure(parsed_body, response.code.to_i) if parsed_body&['type'] == 'error.list'
103
+ raise_errors_on_failure(response) if parsed_body.nil?
104
+ raise_application_errors_on_failure(parsed_body, response.code.to_i) if parsed_body['type'] == 'error.list'
104
105
  parsed_body
105
106
  end
106
107
 
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "3.5.20"
2
+ VERSION = "3.5.21"
3
3
  end
@@ -16,6 +16,12 @@ describe 'Intercom::Request' do
16
16
  proc {req.parse_body('<html>somethjing</html>', response)}.must_raise(Intercom::RateLimitExceeded)
17
17
  end
18
18
 
19
+ it 'parse_body raises an error if the decoded_body is "null"' do
20
+ response = OpenStruct.new(:code => 500)
21
+ req = Intercom::Request.new('path/', 'GET')
22
+ proc { req.parse_body('null', response)}.must_raise(Intercom::ServerError)
23
+ end
24
+
19
25
  describe 'Intercom::Client' do
20
26
  let (:client) { Intercom::Client.new(token: 'foo', handle_rate_limit: true) }
21
27
  let (:uri) {"https://api.intercom.io/users"}
@@ -62,10 +68,4 @@ describe 'Intercom::Request' do
62
68
  req = Intercom::Request.new('path/', 'GET')
63
69
  assert_nil(req.parse_body(nil, response))
64
70
  end
65
-
66
- it 'parse_body returns nil if the decoded_body is "null"' do
67
- response = OpenStruct.new(:code => 500)
68
- req = Intercom::Request.new('path/', 'GET')
69
- req.parse_body('null', response).must_equal(nil)
70
- end
71
71
  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.20
4
+ version: 3.5.21
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: 2017-10-13 00:00:00.000000000 Z
18
+ date: 2017-10-16 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest