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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ef2fb93ad9465fc8f69a87a2b94ead8843082586e763bbe3d32d2ca8a20cc57
4
- data.tar.gz: 1ae24030ff38ee37a7079c5b47cfe859233c1e613c515e5f84fcca3b0b1aed4f
3
+ metadata.gz: 5836e1bb80db4d5663e2e84e7ed9d3c60d96ea6a9b983363690a0f83cffc6224
4
+ data.tar.gz: fabac72f97c7937d4678b965c93ec750a5e5b2a803d761f4833c7cfee67ddb87
5
5
  SHA512:
6
- metadata.gz: 668f7320b3f7774a2712ace35d08e264dfe6095039db4dfe169bdad19e5613f739add95ffe4a1b95af2583abd9c403a27e9a822abdda867ce85842f40667ac05
7
- data.tar.gz: a6955e0c932d7990c9f1ba0a02735f4fdfb7fa75c1e6d50cd3b2ac15bd113bbbd8af21303a3b2ec306af76c91ff28b1ea9ecaf204bf01a4d026e2fd37995f640
6
+ metadata.gz: 0e16b8de900c7fd920d9cd7e11c73ce194ac140c90a8a6170dd5186420ca4d7bf5086ac3502a84b630c8b4998c43fd64f0a5693e7fccdc7c3ccf5df46893fdec
7
+ data.tar.gz: 801102e5be08ffcbb45b4d777188f9fa06928d3956db42978ab7ab871c03d3692ab63781170266896386cfaa42cf9ae3306b6090c3d3459db3edb628b4aa5d34
@@ -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
  #
@@ -1,3 +1,3 @@
1
1
  module Clearbit
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
@@ -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.1
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: 2019-08-16 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler