intercom 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changes.txt +3 -0
- data/lib/ext/sliceable_hash.rb +12 -0
- data/lib/intercom/api_operations/save.rb +1 -1
- data/lib/intercom/collection_proxy.rb +1 -1
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/traits/api_resource_spec.rb +6 -1
- metadata +17 -17
- data/lib/ext/hash.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d926e07d26eefd26f84f84ee9396712647c22782
|
4
|
+
data.tar.gz: 1fcca290fa346ceb3490400a8aa1295e2bc89e93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9794f7becf939adab0d9d7c6c2c704494404a7b1af068cb15c5a450a50c0c6230dd28ff01ffd24157ac89dacaa4140d1bf0135c9df8bc800101c1c9f9ea73bb
|
7
|
+
data.tar.gz: af350c1a8b995fcea209a9e9c52eefd2753700664f8fc8b800e5c2539bf0a4870b2484b7c89cdb1bb6e1b175bf5d1d53f5943f77adab5800b18ab52a8ce7852d
|
data/changes.txt
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
class SliceableHash
|
2
|
+
|
3
|
+
def initialize(hash)
|
4
|
+
@hash = hash
|
5
|
+
end
|
6
|
+
|
7
|
+
# Return a hash that includes only the given keys.
|
8
|
+
def slice(*keys)
|
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) }
|
11
|
+
end
|
12
|
+
end
|
data/lib/intercom/version.rb
CHANGED
@@ -71,8 +71,13 @@ describe Intercom::Traits::ApiResource do
|
|
71
71
|
it "an initialized ApiResource is equal to on generated from a response" do
|
72
72
|
class ConcreteApiResource; include Intercom::Traits::ApiResource; end
|
73
73
|
initialized_api_resource = ConcreteApiResource.new(object_json)
|
74
|
-
|
74
|
+
except(object_json, 'type').keys.each do |attribute|
|
75
75
|
assert_equal initialized_api_resource.send(attribute), api_resource.send(attribute)
|
76
76
|
end
|
77
77
|
end
|
78
|
+
|
79
|
+
def except(h, *keys)
|
80
|
+
keys.each { |key| h.delete(key) }
|
81
|
+
h
|
82
|
+
end
|
78
83
|
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
|
+
version: 2.1.4
|
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-07
|
18
|
+
date: 2014-08-07 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
|
@@ -112,7 +112,7 @@ files:
|
|
112
112
|
- changes.txt
|
113
113
|
- intercom.gemspec
|
114
114
|
- lib/data/cacert.pem
|
115
|
-
- lib/ext/
|
115
|
+
- lib/ext/sliceable_hash.rb
|
116
116
|
- lib/intercom.rb
|
117
117
|
- lib/intercom/admin.rb
|
118
118
|
- lib/intercom/api_operations/count.rb
|
@@ -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: []
|
data/lib/ext/hash.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
class Hash
|
2
|
-
# Return a hash that includes everything but the given keys.
|
3
|
-
def except(*keys)
|
4
|
-
dup.except!(*keys)
|
5
|
-
end
|
6
|
-
|
7
|
-
# Replaces the hash without the given keys.
|
8
|
-
def except!(*keys)
|
9
|
-
keys.each { |key| delete(key) }
|
10
|
-
self
|
11
|
-
end
|
12
|
-
|
13
|
-
# Return a hash that includes only the given keys.
|
14
|
-
def slice(*keys)
|
15
|
-
keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true)
|
16
|
-
keys.each_with_object(self.class.new) { |k, hash| hash[k] = self[k] if has_key?(k) }
|
17
|
-
end
|
18
|
-
end
|