slack_notifier_wrapper 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/slack_notifier_wrapper/helpers.rb +16 -0
- data/lib/slack_notifier_wrapper/version.rb +1 -1
- data/lib/slack_notifier_wrapper.rb +5 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 544801374847a42ab0ab512bc121415c428bc81b
|
4
|
+
data.tar.gz: 19aa5f01f32fc051d06b1661d1bc119a7255f61a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c543209a6d74af7daf7baa49cd875e5fc960d2517cd7dafbc20058d8210a6e814c933c0c9acc429423ee98c0cd0e29714016a969c8e4fc469224add10f6a459
|
7
|
+
data.tar.gz: 6cb909419b520262534fd3b6a275013af8c04a878f23f3461dd35caf4916c2a3ee68176a93138ae241dbb670d64a7284eb8793a2f0d2895f5970c2b13ea5baff
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module SlackNotifierWrapper
|
2
|
+
module Helpers
|
3
|
+
|
4
|
+
def execute_or_speak(method)
|
5
|
+
begin
|
6
|
+
send(method)
|
7
|
+
rescue Exception => e
|
8
|
+
attachment_message = "#{self.class}##{method_name} failed to execute"
|
9
|
+
SlackNotifierWrapper.speak_attachments({ color: "danger", attachment_message: attachment_message })
|
10
|
+
raise e
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "slack_notifier_wrapper/version"
|
2
|
+
require "slack_notifier_wrapper/helpers"
|
2
3
|
|
3
4
|
module SlackNotifierWrapper
|
4
5
|
|
@@ -8,13 +9,13 @@ module SlackNotifierWrapper
|
|
8
9
|
notifier.ping message, icon_emoji: @icon_emoji
|
9
10
|
end
|
10
11
|
|
11
|
-
def speak_attachments(
|
12
|
+
def speak_attachments(args)
|
12
13
|
{
|
13
14
|
text: args.fetch(:attachment_message, ""),
|
14
|
-
color: color,
|
15
|
+
color: args.fetch(:color, "good"),
|
15
16
|
mrkdwn_in: ["text"]
|
16
17
|
}
|
17
|
-
notifier.ping message, icon_emoji: @icon_emoji, attachments: [attachments]
|
18
|
+
notifier.ping args.fetch(:message, ""), icon_emoji: @icon_emoji, attachments: [attachments]
|
18
19
|
end
|
19
20
|
|
20
21
|
def notifier
|
@@ -44,3 +45,4 @@ module SlackNotifierWrapper
|
|
44
45
|
end
|
45
46
|
|
46
47
|
end
|
48
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack_notifier_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MrPowers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- bin/console
|
85
85
|
- bin/setup
|
86
86
|
- lib/slack_notifier_wrapper.rb
|
87
|
+
- lib/slack_notifier_wrapper/helpers.rb
|
87
88
|
- lib/slack_notifier_wrapper/version.rb
|
88
89
|
- slack_notifier_wrapper.gemspec
|
89
90
|
homepage: https://github.com/mrpowers/slack_notifier_wrapper
|