intercom 2.0.3 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/changes.txt +4 -0
- data/lib/intercom.rb +1 -0
- data/lib/intercom/admin.rb +10 -0
- data/lib/intercom/utils.rb +2 -2
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/admin_spec.rb +9 -0
- metadata +19 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57b29735d28416b6901a6857691fd1f0d37ba665
|
4
|
+
data.tar.gz: a2f62b7ded39fc80c68993d8fd886095c9ac97cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5fdd7950174bce14c2ab7e770ce2e916c9633e15242dbc548145c6de8db09bd0a416a5e9d9b8d17e6c1500dc3f541950c535c9e390818fd6a840078b4fa3667
|
7
|
+
data.tar.gz: b10118b627a24d5d084c9a5986b98d0333da7c5468ba3b4f7bccc7e7668f0806ccd4ee9aea8d570d4ffca49a6cd412d8cb1dc9fe6bffbac52c083a9a89de2722
|
data/README.md
CHANGED
@@ -11,6 +11,8 @@ For generating Intercom javascript script tags for Rails, please see https://git
|
|
11
11
|
## Upgrading information
|
12
12
|
Version 2 of intercom-ruby is not backwards compatible with previous versions. Be sure to test this new version before deploying to production. One other change you will need to make as part of the upgrade is to set `Intercom.app_api_key` and not set `Intercom.api_key` (you can continue to use your existing API key).
|
13
13
|
|
14
|
+
Additionally, the new version uses Ruby 2.
|
15
|
+
|
14
16
|
## Installation
|
15
17
|
|
16
18
|
gem install intercom
|
@@ -64,6 +66,12 @@ Intercom::User.all.each {|user| puts %Q(#{user.email} - #{user.custom_attributes
|
|
64
66
|
Intercom::User.all.map {|user| user.email }
|
65
67
|
```
|
66
68
|
|
69
|
+
#### Admins
|
70
|
+
```ruby
|
71
|
+
# Iterate over all admins
|
72
|
+
Intercom::Admin.all.each {|admin| puts admin.email }
|
73
|
+
```
|
74
|
+
|
67
75
|
#### Companies
|
68
76
|
```ruby
|
69
77
|
# Add a user to one or more companies
|
data/changes.txt
CHANGED
data/lib/intercom.rb
CHANGED
data/lib/intercom/utils.rb
CHANGED
@@ -20,14 +20,14 @@ module Intercom
|
|
20
20
|
|
21
21
|
def constantize_resource_name(resource_name)
|
22
22
|
class_name = Utils.singularize(resource_name.capitalize)
|
23
|
-
define_lightweight_class(class_name) unless Intercom.const_defined?(class_name)
|
23
|
+
define_lightweight_class(class_name) unless Intercom.const_defined?(class_name, false)
|
24
24
|
namespaced_class_name = "Intercom::#{class_name}"
|
25
25
|
Object.const_get(namespaced_class_name)
|
26
26
|
end
|
27
27
|
|
28
28
|
def constantize_singular_resource_name(resource_name)
|
29
29
|
class_name = resource_name.split('_').map(&:capitalize).join
|
30
|
-
define_lightweight_class(class_name) unless Intercom.const_defined?(class_name)
|
30
|
+
define_lightweight_class(class_name) unless Intercom.const_defined?(class_name, false)
|
31
31
|
namespaced_class_name = "Intercom::#{class_name}"
|
32
32
|
Object.const_get(namespaced_class_name )
|
33
33
|
end
|
data/lib/intercom/version.rb
CHANGED
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.0
|
4
|
+
version: 2.1.0
|
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-06-
|
18
|
+
date: 2014-06-26 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
|
-
-
|
107
|
-
-
|
106
|
+
- .gitignore
|
107
|
+
- .travis.yml
|
108
108
|
- Gemfile
|
109
109
|
- MIT-LICENSE
|
110
110
|
- README.md
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/data/cacert.pem
|
115
115
|
- lib/ext/hash.rb
|
116
116
|
- lib/intercom.rb
|
117
|
+
- lib/intercom/admin.rb
|
117
118
|
- lib/intercom/api_operations/count.rb
|
118
119
|
- lib/intercom/api_operations/delete.rb
|
119
120
|
- lib/intercom/api_operations/find.rb
|
@@ -151,6 +152,7 @@ files:
|
|
151
152
|
- lib/intercom/utils.rb
|
152
153
|
- lib/intercom/version.rb
|
153
154
|
- spec/spec_helper.rb
|
155
|
+
- spec/unit/intercom/admin_spec.rb
|
154
156
|
- spec/unit/intercom/collection_proxy_spec.rb
|
155
157
|
- spec/unit/intercom/event_spec.rb
|
156
158
|
- spec/unit/intercom/lib/flat_store_spec.rb
|
@@ -169,12 +171,12 @@ require_paths:
|
|
169
171
|
- lib
|
170
172
|
required_ruby_version: !ruby/object:Gem::Requirement
|
171
173
|
requirements:
|
172
|
-
- -
|
174
|
+
- - ~>
|
173
175
|
- !ruby/object:Gem::Version
|
174
176
|
version: '2.0'
|
175
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
178
|
requirements:
|
177
|
-
- -
|
179
|
+
- - '>='
|
178
180
|
- !ruby/object:Gem::Version
|
179
181
|
version: '0'
|
180
182
|
requirements: []
|
@@ -185,6 +187,7 @@ specification_version: 4
|
|
185
187
|
summary: Ruby bindings for the Intercom API
|
186
188
|
test_files:
|
187
189
|
- spec/spec_helper.rb
|
190
|
+
- spec/unit/intercom/admin_spec.rb
|
188
191
|
- spec/unit/intercom/collection_proxy_spec.rb
|
189
192
|
- spec/unit/intercom/event_spec.rb
|
190
193
|
- spec/unit/intercom/lib/flat_store_spec.rb
|