clearbit-slack 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +3 -6
- data/Rakefile +22 -1
- data/bin/console +9 -0
- data/clearbit-slack.gemspec +1 -0
- data/lib/clearbit/slack/notifier.rb +4 -5
- data/lib/clearbit/slack/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edc0e785c055e4793c37ef8bb9981e5430f42f60
|
4
|
+
data.tar.gz: b3982afde4e180d696f34e290b5b6a12fbe51838
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0637e8a94f07b7ad8d3a3f9923df929d72264ca4bd8fb779673b8eb48ea10b1e533813af85dad521972e95793a4bae8825a6daf387b30dd787a92c9f804d5dff
|
7
|
+
data.tar.gz: 012a4bffe50ef32787c15cda50949dd3b0f97c19b4bcc61af47ded47bfce9334eda2b78ea449bfd4b23c44754b3293b7dd44c52770ae6c5a8a2c2ca145f1cf10
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -40,8 +40,7 @@ Sign up for a [Free Trial](https://clearbit.com/) if you don't already have a Cl
|
|
40
40
|
| person | Person data returned form Clearbit |
|
41
41
|
| message | Used for deep link into an internal Admin/CRM |
|
42
42
|
| email | Used to augment message data when Person not found |
|
43
|
-
|
|
44
|
-
| family_name | Used to augment message data when Person not found |
|
43
|
+
| full_name | Used to augment message data when Person not found |
|
45
44
|
|
46
45
|
### Streaming API
|
47
46
|
|
@@ -60,8 +59,7 @@ module APIHub
|
|
60
59
|
|
61
60
|
result.merge!(
|
62
61
|
email: customer.email,
|
63
|
-
|
64
|
-
given_name: customer.first_name,
|
62
|
+
full_name: "#{customer.first_name} #{customer.last_name}",
|
65
63
|
message: "View details in <https://admin-panel.com/#{customer.token}|Admin Panel>",
|
66
64
|
)
|
67
65
|
|
@@ -88,8 +86,7 @@ class WebhooksController < ApplicationController
|
|
88
86
|
|
89
87
|
result.merge!(
|
90
88
|
email: customer.email,
|
91
|
-
|
92
|
-
given_name: customer.first_name,
|
89
|
+
full_name: "#{customer.first_name} #{customer.last_name}",
|
93
90
|
message: "View details in <https://admin-panel.com/#{customer.token}|Admin Panel>",
|
94
91
|
)
|
95
92
|
|
data/Rakefile
CHANGED
@@ -1 +1,22 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'clearbit'
|
3
|
+
require 'clearbit/slack'
|
4
|
+
|
5
|
+
desc 'Test a live lookup and ping'
|
6
|
+
task :ping do
|
7
|
+
Clearbit.key = ENV['CLEARBIT_KEY']
|
8
|
+
|
9
|
+
Clearbit::Slack.configure do |config|
|
10
|
+
config.slack_url = ENV['SLACK_URL']
|
11
|
+
config.slack_channel = ENV['SLACK_CHANNEL']
|
12
|
+
end
|
13
|
+
|
14
|
+
result = Clearbit::Enrichment.find(email: 'harlow@clearbit.com', given_name: 'Harlow', family_name: 'Ward', stream: true)
|
15
|
+
result.merge!(
|
16
|
+
email: 'harlow@clearbit.com',
|
17
|
+
full_name: 'Harlow Ward',
|
18
|
+
message: "View details in <https://admin-panel.com/user_id|Admin Panel>",
|
19
|
+
)
|
20
|
+
|
21
|
+
Clearbit::Slack.ping(result)
|
22
|
+
end
|
data/bin/console
ADDED
data/clearbit-slack.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_development_dependency 'pry', '~> 0.10', '>= 0.10.1'
|
21
21
|
spec.add_development_dependency 'rake', '~> 10.0'
|
22
22
|
spec.add_development_dependency 'rspec', '~> 3.5', '>= 3.5.0'
|
23
|
+
spec.add_development_dependency 'webmock', '~> 2'
|
23
24
|
|
24
25
|
spec.add_runtime_dependency 'clearbit', '~> 0.2', '>= 0.2.2'
|
25
26
|
spec.add_runtime_dependency 'maccman-mash', '~> 0.0', '>= 0.0.2'
|
@@ -2,7 +2,7 @@ module Clearbit
|
|
2
2
|
module Slack
|
3
3
|
class Notifier
|
4
4
|
attr_reader :company, :message, :person,
|
5
|
-
:
|
5
|
+
:full_name, :email,
|
6
6
|
:slack_url, :slack_channel, :slack_icon
|
7
7
|
|
8
8
|
def initialize(attrs = {}, options = {})
|
@@ -11,8 +11,7 @@ module Clearbit
|
|
11
11
|
@company = attrs[:company]
|
12
12
|
@message = attrs[:message]
|
13
13
|
@person = attrs[:person]
|
14
|
-
@
|
15
|
-
@family_name = attrs[:family_name]
|
14
|
+
@full_name = attrs[:full_name]
|
16
15
|
@email = attrs[:email]
|
17
16
|
@slack_url = options[:slack_url]
|
18
17
|
@slack_channel = options[:slack_channel]
|
@@ -52,9 +51,9 @@ module Clearbit
|
|
52
51
|
def unknown_person
|
53
52
|
Mash.new(
|
54
53
|
email: email,
|
54
|
+
bio: 'unknown person',
|
55
55
|
name: {
|
56
|
-
|
57
|
-
family_name: family_name
|
56
|
+
full_name: full_name,
|
58
57
|
}
|
59
58
|
)
|
60
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearbit-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harlow Ward
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,6 +78,20 @@ dependencies:
|
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 3.5.0
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: webmock
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '2'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '2'
|
81
95
|
- !ruby/object:Gem::Dependency
|
82
96
|
name: clearbit
|
83
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +166,7 @@ files:
|
|
152
166
|
- LICENSE
|
153
167
|
- README.md
|
154
168
|
- Rakefile
|
169
|
+
- bin/console
|
155
170
|
- clearbit-slack.gemspec
|
156
171
|
- lib/clearbit/slack.rb
|
157
172
|
- lib/clearbit/slack/attachments/company.rb
|