clearbit 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clearbit/analytics.rb +8 -0
- data/lib/clearbit/version.rb +1 -1
- data/spec/lib/clearbit/analytics_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5836e1bb80db4d5663e2e84e7ed9d3c60d96ea6a9b983363690a0f83cffc6224
|
4
|
+
data.tar.gz: fabac72f97c7937d4678b965c93ec750a5e5b2a803d761f4833c7cfee67ddb87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e16b8de900c7fd920d9cd7e11c73ce194ac140c90a8a6170dd5186420ca4d7bf5086ac3502a84b630c8b4998c43fd64f0a5693e7fccdc7c3ccf5df46893fdec
|
7
|
+
data.tar.gz: 801102e5be08ffcbb45b4d777188f9fa06928d3956db42978ab7ab871c03d3692ab63781170266896386cfaa42cf9ae3306b6090c3d3459db3edb628b4aa5d34
|
data/lib/clearbit/analytics.rb
CHANGED
@@ -25,6 +25,14 @@ module Clearbit
|
|
25
25
|
analytics.flush
|
26
26
|
end
|
27
27
|
|
28
|
+
# Proxy group through to a client instance, in order to keep the client
|
29
|
+
# consistent with how the other Clearbit APIs are accessed
|
30
|
+
def self.group(args)
|
31
|
+
analytics = new(write_key: Clearbit.key)
|
32
|
+
analytics.group(args)
|
33
|
+
analytics.flush
|
34
|
+
end
|
35
|
+
|
28
36
|
# Initializes a new instance of {Clearbit::Analytics::Client}, to which all
|
29
37
|
# method calls are proxied.
|
30
38
|
#
|
data/lib/clearbit/version.rb
CHANGED
@@ -43,4 +43,24 @@ describe Clearbit::Analytics do
|
|
43
43
|
expect(x_stub).to have_been_requested
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
describe '#group' do
|
48
|
+
it 'sends an identify request to Clearbit X' do
|
49
|
+
basic_auth = Base64.encode64('clearbit_key:').strip
|
50
|
+
x_stub = stub_request(:post, 'https://x.clearbit.com/v1/import').
|
51
|
+
with(
|
52
|
+
headers: { 'Authorization' => "Basic #{basic_auth}" }
|
53
|
+
).to_return(status: 200, body: {success: true}.to_json)
|
54
|
+
|
55
|
+
Clearbit::Analytics.group(
|
56
|
+
user_id: '123',
|
57
|
+
group_id: '123',
|
58
|
+
traits: {
|
59
|
+
domain: 'clearbit.com',
|
60
|
+
},
|
61
|
+
)
|
62
|
+
|
63
|
+
expect(x_stub).to have_been_requested
|
64
|
+
end
|
65
|
+
end
|
46
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearbit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex MacCaw
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|