clearbit-slack 0.1.0 → 0.1.1

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: 5d9dfc7ac039cfaa0447d80da593ebd05aff9165
4
- data.tar.gz: dfbcb4635d839a66769fddb3596eba20a0d9a1cc
3
+ metadata.gz: 60aca03f72552305bf5d7e20577226ff2cbcd28a
4
+ data.tar.gz: cf75a3a709528e225fa2515f12f07d2af66cec55
5
5
  SHA512:
6
- metadata.gz: 47036dddbc356e39c732f34f33555a9507dae21eac3857215cd0c9f729d11462f45729a9fa626ecd30f56adf689f82258129007c8a80d66df851783dedc7398a
7
- data.tar.gz: 7ee62b77dc88118e9547a52143bf9ef19da360a44d4962507a57f42298aaaca33936ca6ef5066f6c065312b76abbf88732a9fe4c740d6e12bc83c5d6d8af2c9b
6
+ metadata.gz: fbeb501486542cc7810f8a24025ef3b613897d1edee9daa3a5992d315a671c871f037132d226fc4920f0e8e69cf467699a781f1bdd992ade28f85542f40472a8
7
+ data.tar.gz: 40124571455871c71139b139e2168b9d18df152dcbf29bee73abeaced12b8ed133f910a3f76c8a5ea4d434bf62acff61bcf4e0c23386f8dba9e6708159f4ca9e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Clearbit Slack Notifier
2
2
 
3
- Send Clearbit Person and Company data into a Slack channel.
3
+ Clean beautiful customer data. Now in Slack.
4
4
 
5
5
  ![alex_test](https://cloud.githubusercontent.com/assets/739782/8149387/3f89cd68-1276-11e5-863c-5529237bfe6c.png)
6
6
 
@@ -9,7 +9,6 @@ Send Clearbit Person and Company data into a Slack channel.
9
9
  Add to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'clearbit'
13
12
  gem 'clearbit-slack'
14
13
  ```
15
14
 
@@ -59,20 +58,16 @@ module APIHub
59
58
  customer = Customer.find!(customer_id)
60
59
  response = Clearbit::Streaming::PersonCompany[email: customer.email]
61
60
 
62
- if response.person || response.company
63
- params = {
64
- company: response.company,
65
- email: customer.email,
66
- family_name: customer.last_name,
67
- given_name: customer.first_name,
68
- message: "View details in <https://admin-panel.com/#{customer.token}|Admin Panel>",
69
- person: response.person
70
- }
61
+ response.merge!(
62
+ email: customer.email,
63
+ family_name: customer.last_name,
64
+ given_name: customer.first_name,
65
+ message: "View details in <https://admin-panel.com/#{customer.token}|Admin Panel>",
66
+ )
71
67
 
72
- Clearbit::Slack.ping(params)
73
- end
68
+ Clearbit::Slack.ping(response)
74
69
 
75
- # Persist Clearbit Data
70
+ # Persist the Clearbit Data
76
71
  end
77
72
  end
78
73
  end
@@ -89,21 +84,18 @@ class WebhooksController < ApplicationController
89
84
  def clearbit
90
85
  webhook = Clearbit::Webhook.new(env)
91
86
  customer = Customer.find!(webhook.webhook_id)
87
+ response = webhook.body
92
88
 
93
- if webhook.body.person || webhook.body.company
94
- params = {
95
- company: webhook.body.company,
96
- email: customer.email,
97
- family_name: customer.last_name,
98
- given_name: customer.first_name,
99
- message: "View details in <https://admin-panel/#{webhook.webhook_id}|Admin Panel>",
100
- person: webhook.body.person
101
- }
102
-
103
- Clearbit::Slack.ping(params)
104
- end
89
+ response.merge!(
90
+ email: customer.email,
91
+ family_name: customer.last_name,
92
+ given_name: customer.first_name,
93
+ message: "View details in <https://admin-panel.com/#{customer.token}|Admin Panel>",
94
+ )
95
+
96
+ Clearbit::Slack.ping(response)
105
97
 
106
- # Persist Clearbit Data
98
+ # Persist the Clearbit Data
107
99
  end
108
100
  end
109
101
  ```
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
17
  spec.require_paths = ["lib"]
18
18
 
19
+ spec.add_dependency 'clearbit', '~> 0.1.6'
19
20
  spec.add_dependency 'maccman-mash', '~> 0.0.2'
20
21
  spec.add_dependency 'slack-notifier', '~> 1.2.1'
21
22
  spec.add_development_dependency 'bundler', '~> 1.9'
@@ -1,5 +1,5 @@
1
1
  module Clearbit
2
2
  module Slack
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
- require 'slack-notifier'
1
+ require 'clearbit'
2
2
  require 'mash'
3
+ require 'slack-notifier'
3
4
 
4
5
  require 'clearbit/slack/configuration'
5
6
  require 'clearbit/slack/helpers'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearbit-slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harlow Ward
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: clearbit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.6
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.6
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: maccman-mash
15
29
  requirement: !ruby/object:Gem::Requirement