intercom 2.1.6 → 2.2.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: d953f0ac9679e338f12dfcfcd568a49730a1f538
4
- data.tar.gz: 7ebb28538bad6a0b604ce75b71585a66732772d3
3
+ metadata.gz: f26bb35b88b669bfc5225edd1fc7838411dcefe7
4
+ data.tar.gz: 1636c5b0708ed2ffb05d75e4d381a9cd4e35df87
5
5
  SHA512:
6
- metadata.gz: 7fd4e80e4ca57cfe32a5b62e7fa89b703f37675790d039801e4693cfd745a33aca68f2cd4dc6c613611f7c92e223f34351ca0ad0de274da5b01d850b11e3067f
7
- data.tar.gz: 6fabb4a63c460b2ba4efc2ecbc1c02773380740c28abdd8de99fc0ea904a61d0f1724d757ea20a8d6f7277830587eac41811d00552349d507c7e80e9213e6d2a
6
+ metadata.gz: 81ec8dad83ea630bfb9dc59c400d190fb8c299a5024b06c8a486563dd45d2be084e6dda5d0e12927f3d0eb09b7fb4be8f2903a4c266e5858301ae5eacae43076
7
+ data.tar.gz: d34a0ebe575bf3d365eba99f3a3f9e3203e21759213919f616fdf4c2035a4ad4fb850fddf9f9c185e7e4e6f5f541896553017b1c47a04c41473f17a31dd61096
data/README.md CHANGED
@@ -19,7 +19,7 @@ Additionally, the new version uses Ruby 2.
19
19
 
20
20
  Using bundler:
21
21
 
22
- gem 'intercom', "~> 2.1.6"
22
+ gem 'intercom', "~> 2.2.0"
23
23
 
24
24
  ## Basic Usage
25
25
 
data/changes.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 2.2.0
2
+ - Handle blanks on identity attributes (e.g. email) better.
3
+
1
4
  2.1.6
2
5
  - Add handling for service unavailable exceptions
3
6
 
@@ -7,6 +7,10 @@ class SliceableHash
7
7
  # Return a hash that includes only the given keys.
8
8
  def slice(*keys)
9
9
  keys.map! { |key| @hash.convert_key(key) } if @hash.respond_to?(:convert_key, true)
10
- keys.each_with_object(@hash.class.new) { |k, hash| hash[k] = @hash[k] if @hash.has_key?(k) }
10
+ keys.each_with_object(@hash.class.new) { |k, hash| hash[k] = @hash[k] if @hash.has_key?(k) && if_string_not_empty(@hash[k]) }
11
+ end
12
+
13
+ def if_string_not_empty(val)
14
+ val.kind_of?(String) ? !val.empty? : true
11
15
  end
12
16
  end
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "2.1.6"
2
+ VERSION = "2.2.0"
3
3
  end
@@ -165,6 +165,12 @@ describe "Intercom::User" do
165
165
  Intercom.expects(:post).with("/users", {'custom_attributes' => {}, "email" => "jo@example.com", "user_id" => "i-1224242", "companies" => [{"company_id" => 6, "name" => "Intercom"}]}).returns({"email" => "jo@example.com", "user_id" => "i-1224242"})
166
166
  user.save
167
167
  end
168
+
169
+ it 'can save a user with a nil email' do
170
+ user = Intercom::User.new("email" => nil, :user_id => "i-1224242", :companies => [{'company_id' => 6, 'name' => "Intercom"}])
171
+ Intercom.expects(:post).with("/users", {'custom_attributes' => {}, "email" => nil, "user_id" => "i-1224242", "companies" => [{"company_id" => 6, "name" => "Intercom"}]}).returns({"email" => nil, "user_id" => "i-1224242"})
172
+ user.save
173
+ end
168
174
 
169
175
  it "deletes a user" do
170
176
  user = Intercom::User.new("id" => "1")
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.6
4
+ version: 2.2.0
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: 2014-09-03 00:00:00.000000000 Z
18
+ date: 2014-09-04 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest