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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0dbda33717023773fe561fcb9c84b46111ee60c7
4
- data.tar.gz: 426f92eeef9226d327bf8731884e458acd0dfb82
3
+ metadata.gz: 57b29735d28416b6901a6857691fd1f0d37ba665
4
+ data.tar.gz: a2f62b7ded39fc80c68993d8fd886095c9ac97cb
5
5
  SHA512:
6
- metadata.gz: 63bc5f1bf011fe12ca02eec3b127200f609dd6617f2e87e1ff30fa824aff91a46a794e62d44e371d6c7429931fe1416b11caa4543efa6a3d98a3e415f403a1b4
7
- data.tar.gz: 515f90cf4bb6ff6e2bbaebaa0649279d94e71666815c3f38fc5979e022e170359330378c5addac30caf93001d445531e3f0c7bed20ca113dad3a3304e37a8263
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
@@ -1,3 +1,7 @@
1
+ 2.1.0
2
+ - Added Admin listing (thanks to @javiercr)
3
+ - Fix ancestor lookup of constants (thanks to @javiercr)
4
+
1
5
  2.0.3
2
6
  - Fix for bug caused by "type" in custom attributes
3
7
 
@@ -7,6 +7,7 @@ require "intercom/segment"
7
7
  require "intercom/event"
8
8
  require "intercom/conversation"
9
9
  require "intercom/message"
10
+ require "intercom/admin"
10
11
  require "intercom/count"
11
12
  require "intercom/request"
12
13
  require "intercom/utils"
@@ -0,0 +1,10 @@
1
+ require 'intercom/api_operations/list'
2
+ require 'intercom/traits/api_resource'
3
+
4
+ module Intercom
5
+ class Admin
6
+ include ApiOperations::List
7
+ include Traits::IncrementableAttributes
8
+ include Traits::ApiResource
9
+ end
10
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "2.0.3"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -0,0 +1,9 @@
1
+ require "spec_helper"
2
+
3
+ describe "Intercom::Admin" do
4
+ it "returns a CollectionProxy for all without making any requests" do
5
+ Intercom.expects(:execute_request).never
6
+ all = Intercom::Admin.all
7
+ all.must_be_instance_of(Intercom::CollectionProxy)
8
+ end
9
+ 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.0.3
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-19 00:00:00.000000000 Z
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
- - ".gitignore"
107
- - ".travis.yml"
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