intercom 2.1.4 → 2.1.5

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: d926e07d26eefd26f84f84ee9396712647c22782
4
- data.tar.gz: 1fcca290fa346ceb3490400a8aa1295e2bc89e93
3
+ metadata.gz: 93b3088910bdf34dcb9dd1566e1d926a89050da0
4
+ data.tar.gz: db0ef2a2587d36903eec10f0fb436aa18552e4fb
5
5
  SHA512:
6
- metadata.gz: c9794f7becf939adab0d9d7c6c2c704494404a7b1af068cb15c5a450a50c0c6230dd28ff01ffd24157ac89dacaa4140d1bf0135c9df8bc800101c1c9f9ea73bb
7
- data.tar.gz: af350c1a8b995fcea209a9e9c52eefd2753700664f8fc8b800e5c2539bf0a4870b2484b7c89cdb1bb6e1b175bf5d1d53f5943f77adab5800b18ab52a8ce7852d
6
+ metadata.gz: fb04dbf382b3151d00a28381f1e4fd2580a6063a044c6999563cfeb28d594fd81fe101b2cae585c713a54390bc0e57dcb383537021e21b4083498584e6acfe1e
7
+ data.tar.gz: add597f18c97052f2d21196e0a70bd75f5267010b18bf37b33f48148c22c4f58e80f61d726465bfdad65dfb36b3ab2dcf5b08f492c0a0d3b8ee3553a3932adb1
data/Gemfile CHANGED
@@ -3,9 +3,6 @@ source "http://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem 'fakeweb', "~> 1.3"
7
- # gem 'm'
8
- # gem 'pry-byebug'
9
6
  platforms :jruby do
10
7
  gem 'json-jruby'
11
8
  gem 'jruby-openssl'
data/changes.txt CHANGED
@@ -1,3 +1,9 @@
1
+ 2.1.5
2
+ - Fix typos in error messages (thanks to @infertux)
3
+ - Gemfile cleanup (thanks to @Manfred)
4
+ - Handle 403 Forbidden errors
5
+ - Fix intermittant spec failure
6
+
1
7
  2.1.4
2
8
  - Rework hash helper extensions
3
9
 
@@ -3,7 +3,7 @@ module Intercom
3
3
  module Find
4
4
  module ClassMethods
5
5
  def find(params)
6
- raise BadRequestError, "#{self}#find takes a hash as it's parameter but you supplied #{params.inspect}" unless params.is_a? Hash
6
+ raise BadRequestError, "#{self}#find takes a hash as its parameter but you supplied #{params.inspect}" unless params.is_a? Hash
7
7
  collection_name = Utils.resource_class_to_collection_name(self)
8
8
  if params[:id]
9
9
  response = Intercom.get("/#{collection_name}/#{params[:id]}", {})
@@ -5,7 +5,7 @@ module Intercom
5
5
  module FindAll
6
6
  module ClassMethods
7
7
  def find_all(params)
8
- raise BadRequestError, "#{self}#find takes a hash as it's parameter but you supplied #{params.inspect}" unless params.is_a? Hash
8
+ raise BadRequestError, "#{self}#find takes a hash as its parameter but you supplied #{params.inspect}" unless params.is_a? Hash
9
9
  collection_name = Utils.resource_class_to_collection_name(self)
10
10
  finder_details = {}
11
11
  if params[:id] && !type_switched_finder?(params)
@@ -81,6 +81,8 @@ module Intercom
81
81
  raise Intercom::ResourceNotFound.new('Resource Not Found')
82
82
  elsif res.code.to_i.eql?(401)
83
83
  raise Intercom::AuthenticationError.new('Unauthorized')
84
+ elsif res.code.to_i.eql?(403)
85
+ raise Intercom::AuthenticationError.new('Forbidden')
84
86
  elsif res.code.to_i.eql?(500)
85
87
  raise Intercom::ServerError.new('Server Error')
86
88
  elsif res.code.to_i.eql?(502)
@@ -100,7 +102,7 @@ module Intercom
100
102
  :application_error_code => error_code
101
103
  }
102
104
  case error_code
103
- when 'unauthorized'
105
+ when 'unauthorized', 'forbidden'
104
106
  raise Intercom::AuthenticationError.new(error_details['message'], error_context)
105
107
  when "bad_request", "missing_parameter", 'parameter_invalid'
106
108
  raise Intercom::BadRequestError.new(error_details['message'], error_context)
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "2.1.4"
2
+ VERSION = "2.1.5"
3
3
  end
@@ -13,7 +13,7 @@ describe Intercom::Traits::ApiResource do
13
13
  "user_count"=>1,
14
14
  "custom_attributes"=>{}}
15
15
  end
16
- let(:api_resource) { Object.new.extend(Intercom::Traits::ApiResource)}
16
+ let(:api_resource) { DummyClass.new.extend(Intercom::Traits::ApiResource)}
17
17
 
18
18
  before(:each) { api_resource.from_response(object_json) }
19
19
 
@@ -80,4 +80,6 @@ describe Intercom::Traits::ApiResource do
80
80
  keys.each { |key| h.delete(key) }
81
81
  h
82
82
  end
83
+
84
+ class DummyClass; end
83
85
  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: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McRedmond
@@ -15,76 +15,76 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2014-08-07 00:00:00.000000000 Z
18
+ date: 2014-08-15 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest
22
22
  requirement: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  type: :development
28
28
  prerelease: false
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  type: :development
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: mocha
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: fakeweb
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.3'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: json
78
78
  requirement: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  description: 'Intercom (https://www.intercom.io) is a customer relationship management
@@ -103,8 +103,8 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - ".gitignore"
107
- - ".travis.yml"
106
+ - .gitignore
107
+ - .travis.yml
108
108
  - Gemfile
109
109
  - MIT-LICENSE
110
110
  - README.md
@@ -171,12 +171,12 @@ require_paths:
171
171
  - lib
172
172
  required_ruby_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - "~>"
174
+ - - ~>
175
175
  - !ruby/object:Gem::Version
176
176
  version: '2.0'
177
177
  required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - ">="
179
+ - - '>='
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []