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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29a0596d32818bbb39669a1dac0f85d432069273
4
- data.tar.gz: 97258c4633fa639afa63323236f49f92ab4057fa
3
+ metadata.gz: edc0e785c055e4793c37ef8bb9981e5430f42f60
4
+ data.tar.gz: b3982afde4e180d696f34e290b5b6a12fbe51838
5
5
  SHA512:
6
- metadata.gz: 344682f99a915b967e3ab13fd2d4ec0f79b257f3c085b8307cb0916a9b1831887f08c6a3b4637fd528f7b440ae2e0c5b1d484ce923963991291ed473c5ae7634
7
- data.tar.gz: 6fc94fd8b8209206a584951f05bd36744884827bb257c86c64fa88f9e023213b5d5bfb8fc2e2cd4286de47b3d711e868bf978e922a64b555ecd4435c45528a05
6
+ metadata.gz: 0637e8a94f07b7ad8d3a3f9923df929d72264ca4bd8fb779673b8eb48ea10b1e533813af85dad521972e95793a4bae8825a6daf387b30dd787a92c9f804d5dff
7
+ data.tar.gz: 012a4bffe50ef32787c15cda50949dd3b0f97c19b4bcc61af47ded47bfce9334eda2b78ea449bfd4b23c44754b3293b7dd44c52770ae6c5a8a2c2ca145f1cf10
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
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
- | given_name | Used to augment message data when Person not found |
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
- family_name: customer.last_name,
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
- family_name: customer.last_name,
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 "bundler/gem_tasks"
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
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ require "bundler/setup"
3
+ require "clearbit/slack"
4
+
5
+ # You can add fixtures and/or initialization code here to make experimenting
6
+ # with your gem easier. You can also use a different console, if you like.
7
+
8
+ require "irb"
9
+ IRB.start
@@ -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
- :given_name, :family_name, :email,
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
- @given_name = attrs[:given_name]
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
- given_name: given_name,
57
- family_name: family_name
56
+ full_name: full_name,
58
57
  }
59
58
  )
60
59
  end
@@ -1,5 +1,5 @@
1
1
  module Clearbit
2
2
  module Slack
3
- VERSION = '0.1.8'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  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.1.8
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 00:00:00.000000000 Z
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