integrity-notifyio 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.2.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{integrity-notifyio}
8
- s.version = "0.1.6"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Kalek"]
@@ -21,14 +21,16 @@ module Integrity
21
21
  private
22
22
 
23
23
  def post(emails, api_key, title, body)
24
+ return if emails.nil? || email.empty? || api_key.nil? || api_key.empty?
24
25
  emails.split(',').each do |email|
25
26
  email_hash = MD5.hexdigest(email.strip!)
26
- HTTParty.post "http://api.notify.io/v1/notify/#{email_hash}?api_key=#{api_key}", :body => {
27
- :type => 'regular',
28
- :title => title,
29
- :body => body,
30
- :generator => 'integrity-notifyio notifier'
31
- }
27
+ HTTParty.post "http://api.notify.io/v1/notify/#{email_hash}", :headers => {'content-type' => 'application/x-www-form-urlencoded'},
28
+ :body => {:api_key => api_key},
29
+ :query => {
30
+ :api_key => api_key,
31
+ :title => title,
32
+ :text => body
33
+ }
32
34
 
33
35
  end
34
36
  end
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 6
10
- version: 0.1.6
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Kalek