jackal-slack 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/lib/jackal-slack.rb +2 -1
- data/lib/jackal-slack/formatter.rb +1 -0
- data/lib/jackal-slack/formatter/error.rb +34 -0
- data/lib/jackal-slack/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f12d0d0ca32f93f7ed568f6f4ae105d326e74ddf
|
4
|
+
data.tar.gz: c3bbcb240a03d747127d6d38bf9f4f17990e1c2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5afc1a3d05d5469eb8e7e344f3b5c3240a9781a91948ffe4d87d32da10e620e49653f040485ab6de0f393dc591606c293f6a8d693fa2f8459a142d1637345b7e
|
7
|
+
data.tar.gz: 7e91ac42c8750202f7fb8937c100c34ac86fdd7472f9c12c92243f8958c338134b6fb1afc50d3971df2782b01931e11dbb0bffc3c9daf1d677ca945795ce1e0e
|
data/CHANGELOG.md
CHANGED
data/lib/jackal-slack.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
require 'jackal-slack/formatter/error'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'jackal-slack'
|
2
|
+
|
3
|
+
module Jackal
|
4
|
+
module Slack
|
5
|
+
module Formatter
|
6
|
+
# Format job errors for display
|
7
|
+
class Error < Jackal::Formatter
|
8
|
+
|
9
|
+
# Source service
|
10
|
+
SOURCE = '*'
|
11
|
+
# Destination service
|
12
|
+
DESTINATION = 'slack'
|
13
|
+
|
14
|
+
# Provide error message output
|
15
|
+
#
|
16
|
+
# @param payload [Smash]
|
17
|
+
def format(payload)
|
18
|
+
if(payload[:status] == 'error' && payload[:error])
|
19
|
+
msgs = payload.fetch(:data, :slack, :messages, [])
|
20
|
+
msgs.push(
|
21
|
+
Smash.new(
|
22
|
+
:message => "#{payload.get(:error, :reason)} (`#{payload.get(:error, :callback)}`)",
|
23
|
+
:color => 'danger',
|
24
|
+
:description => "Job Failure (#{payload[:id]})"
|
25
|
+
)
|
26
|
+
)
|
27
|
+
payload.set(:data, :slack, :messages, msgs)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/jackal-slack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jackal-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heavywater
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jackal
|
@@ -50,6 +50,8 @@ files:
|
|
50
50
|
- README.md
|
51
51
|
- jackal-slack.gemspec
|
52
52
|
- lib/jackal-slack.rb
|
53
|
+
- lib/jackal-slack/formatter.rb
|
54
|
+
- lib/jackal-slack/formatter/error.rb
|
53
55
|
- lib/jackal-slack/notification.rb
|
54
56
|
- lib/jackal-slack/version.rb
|
55
57
|
homepage: http://github.com/heavywater/jackal-slack
|