osakana 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/osakana/notifier.rb +4 -2
- data/lib/osakana/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21f7bc97c893c14d7c702ab8867c7ce63144f5c4cdb54f019e9c8fa99393e3b8
|
4
|
+
data.tar.gz: 3d41bfebf99474b4e9176b8dd2218e3febfa3a106ab70fb1e287de3650683733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7582cf02d5e62690d0b5db05aaf2eacc3360b6f9f53380ff4eec99701a00069bc673d0f4a65bfd0eb93fb759237ac820ec3bb576e0ade9362357d9a620f935be
|
7
|
+
data.tar.gz: 3c5d87e8746db988fcc29d67ee72c1907b982f714e8895080b1a0883c7d80f8913e653bd28db3955a0aa0f3aa785ddfa65e7a76bd11ff0ecfc180053d56122fd
|
data/lib/osakana/notifier.rb
CHANGED
@@ -5,6 +5,8 @@ require "slack/incoming/webhooks"
|
|
5
5
|
module Osakana
|
6
6
|
class Notifier
|
7
7
|
def notifiy(title, attachments = [])
|
8
|
+
attachments << { title: "N/A" } if attachments.empty?
|
9
|
+
|
8
10
|
if slack_webhook_url?
|
9
11
|
slack = Slack::Incoming::Webhooks.new(slack_webhook_url, channel: slack_channel)
|
10
12
|
slack.post title, attachments: attachments
|
@@ -28,8 +30,8 @@ module Osakana
|
|
28
30
|
ENV.key? "SLACK_WEBHOOK_URL"
|
29
31
|
end
|
30
32
|
|
31
|
-
def self.notify(title,
|
32
|
-
new.notifiy(title,
|
33
|
+
def self.notify(title, attachments)
|
34
|
+
new.notifiy(title, attachments)
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
data/lib/osakana/version.rb
CHANGED