intercom 2.1.6 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/changes.txt +3 -0
- data/lib/ext/sliceable_hash.rb +5 -1
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/user_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f26bb35b88b669bfc5225edd1fc7838411dcefe7
|
4
|
+
data.tar.gz: 1636c5b0708ed2ffb05d75e4d381a9cd4e35df87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81ec8dad83ea630bfb9dc59c400d190fb8c299a5024b06c8a486563dd45d2be084e6dda5d0e12927f3d0eb09b7fb4be8f2903a4c266e5858301ae5eacae43076
|
7
|
+
data.tar.gz: d34a0ebe575bf3d365eba99f3a3f9e3203e21759213919f616fdf4c2035a4ad4fb850fddf9f9c185e7e4e6f5f541896553017b1c47a04c41473f17a31dd61096
|
data/README.md
CHANGED
data/changes.txt
CHANGED
data/lib/ext/sliceable_hash.rb
CHANGED
@@ -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
|
data/lib/intercom/version.rb
CHANGED
@@ -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.
|
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-
|
18
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|