jackal-kitchen-slack 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c91608b2cfda461593d35cc79f668d0fd49951ce
4
+ data.tar.gz: cb7c2a62930762be1ca1d15805b9deae202ae7d8
5
+ SHA512:
6
+ metadata.gz: 51470e03a37fe2da3d8d02621907d83dba2b8f3fd96da62a24704dff832e02c579e17bda44459e8d46088f3ccbf2e89cc0ecce1fd35659f9484d55237f469b67
7
+ data.tar.gz: a8b4961ee3371d3d26ab9b15a62dbb69f603a2d4fb12fa89cd098e95b8fda6e529eb6892301e0e69ae0fd89394ae8920fc2ea625e25c76b2a64846cb570b10ff
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__)) + '/lib/'
2
+ require 'jackal-kitchen-slack/version'
3
+ Gem::Specification.new do |s|
4
+ s.name = 'jackal-kitchen-slack'
5
+ s.version = Jackal::KitchenSlack::VERSION.version
6
+ s.summary = 'Jackal Kitchen Slack'
7
+ s.author = 'Heavywater'
8
+ s.email = 'support@hw-ops.com'
9
+ s.homepage = 'http://github.com/heavywater/jackal-kitchen-slack'
10
+ s.description = 'Jackal Kitchen Slack'
11
+ s.require_path = 'lib'
12
+ s.add_dependency 'jackal'
13
+ s.files = Dir['**/*']
14
+ end
@@ -0,0 +1,9 @@
1
+ require 'jackal'
2
+ require 'jackal-kitchen-slack/version'
3
+
4
+ module Jackal
5
+ module KitchenSlack
6
+ autoload :Message, 'jackal-kitchen-slack/message'
7
+ end
8
+ end
9
+
@@ -0,0 +1,44 @@
1
+ require 'jackal-kitchen-slack'
2
+
3
+ module Jackal
4
+ # Formulate kitchen output into short message
5
+ module KitchenSlack
6
+ class Message < Jackal::Callback
7
+
8
+ def setup(*_)
9
+ end
10
+
11
+ # Validity of message
12
+ #
13
+ # @param message [Carnivore::Message]
14
+ # @return [Truthy, Falsey]
15
+ def valid?(message)
16
+ super do |payload|
17
+ payload.get(:data, :kitchen)
18
+ end
19
+ end
20
+
21
+ def execute(message)
22
+ failure_wrap(message) do |payload|
23
+ payload[:data][:slack] = Smash.new
24
+ payload[:data][:slack][:messages] = [format_message(payload)]
25
+ job_completed(:kitchen_messenger, payload, message)
26
+ end
27
+ end
28
+
29
+ # payload:: Payload
30
+ # Return formatted message hash: {:message => 'something happened', :color => 'good|blue|FFF000'}
31
+ # depending on what's loaded in the environment
32
+ def format_message(payload)
33
+ ref = payload.get(:data, :github, :head_commit, :id)
34
+ repo = payload.get(:data, :github, :repository, :full_name)
35
+ {:message => payload.get(:data, :kitchen), :color => 'good'}
36
+ end
37
+
38
+ def format_link(uri,anchor)
39
+ "<#{uri}|#{anchor}>"
40
+ end
41
+
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,6 @@
1
+ module Jackal
2
+ module KitchenSlack
3
+ # current library version
4
+ VERSION = Gem::Version.new('0.1.0')
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jackal-kitchen-slack
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Heavywater
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jackal
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Jackal Kitchen Slack
28
+ email: support@hw-ops.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - CHANGELOG.md
34
+ - README.md
35
+ - jackal-kitchen-slack.gemspec
36
+ - lib/jackal-kitchen-slack.rb
37
+ - lib/jackal-kitchen-slack/message.rb
38
+ - lib/jackal-kitchen-slack/version.rb
39
+ homepage: http://github.com/heavywater/jackal-kitchen-slack
40
+ licenses: []
41
+ metadata: {}
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 2.2.2
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: Jackal Kitchen Slack
62
+ test_files: []
63
+ has_rdoc: