jackal-kitchen-slack 0.1.0 → 0.1.2

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: c91608b2cfda461593d35cc79f668d0fd49951ce
4
- data.tar.gz: cb7c2a62930762be1ca1d15805b9deae202ae7d8
3
+ metadata.gz: 43bbdb5235753a2ad4c353f0a5b2921b528190ed
4
+ data.tar.gz: e38708efcb8f23af174e5837e24d9d0424c3c786
5
5
  SHA512:
6
- metadata.gz: 51470e03a37fe2da3d8d02621907d83dba2b8f3fd96da62a24704dff832e02c579e17bda44459e8d46088f3ccbf2e89cc0ecce1fd35659f9484d55237f469b67
7
- data.tar.gz: a8b4961ee3371d3d26ab9b15a62dbb69f603a2d4fb12fa89cd098e95b8fda6e529eb6892301e0e69ae0fd89394ae8920fc2ea625e25c76b2a64846cb570b10ff
6
+ metadata.gz: 3ffca5256ed5d140bbf47722d6b300c81e94f098560377af60cbd9a60164a15bf1dacf94c5a7f53e8c32f1635131891d412ec696ec9ed5f8f76705c949bb5066
7
+ data.tar.gz: ce5b5d3318411c78a62b3d84e7c01bd61ef0171bd1241e16d539e4bbb6ae2fb921ba010afcabd1d55bcb6cfbdbc133f2a89a2d9a9208a3336f60053b7f73a4c8
@@ -32,7 +32,13 @@ module Jackal
32
32
  def format_message(payload)
33
33
  ref = payload.get(:data, :github, :head_commit, :id)
34
34
  repo = payload.get(:data, :github, :repository, :full_name)
35
- {:message => payload.get(:data, :kitchen), :color => 'good'}
35
+ success = !payload.fetch(:data, :kitchen, :result, {}).values.detect do |v|
36
+ v.to_s == 'fail'
37
+ end
38
+ Smash.new(
39
+ :message => payload.get(:data, :kitchen),
40
+ :color => success ? config.fetch(:colors, :success, 'good') : config.fetch(:colors, :failure, 'danger')
41
+ )
36
42
  end
37
43
 
38
44
  def format_link(uri,anchor)
@@ -1,6 +1,6 @@
1
1
  module Jackal
2
2
  module KitchenSlack
3
3
  # current library version
4
- VERSION = Gem::Version.new('0.1.0')
4
+ VERSION = Gem::Version.new('0.1.2')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jackal-kitchen-slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heavywater
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-15 00:00:00.000000000 Z
11
+ date: 2014-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jackal
@@ -32,6 +32,7 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - CHANGELOG.md
34
34
  - README.md
35
+ - jackal-kitchen-slack-0.1.1.gem
35
36
  - jackal-kitchen-slack.gemspec
36
37
  - lib/jackal-kitchen-slack.rb
37
38
  - lib/jackal-kitchen-slack/message.rb