Sha256: baa6ebbc163ca7876c841672f94c377e1a402ec67f69f7322da017783130482a
Contents?: true
Size: 1.25 KB
Versions: 5
Compression:
Stored size: 1.25 KB
Contents
require 'knife-spork/plugins/plugin' module KnifeSpork module Plugins class HipChat < Plugin name :hip_chat def perform; end def after_upload hipchat "#{current_user} uploaded the following cookbooks:\n#{cookbooks.collect{ |c| " #{c.name}@#{c.version}" }.join("\n")}" end def after_promote_remote hipchat "#{current_user} promoted the following cookbooks:\n#{cookbooks.collect{ |c| " #{c.name}@#{c.version}" }.join("\n")} to #{environments.collect{ |e| "#{e.name}" }.join(", ")}" end private def hipchat(message) safe_require 'hipchat' rooms.each do |room_name| begin client = ::HipChat::Client.new(config.api_token) client[room_name].send(nickname, message, notify:notify, color:color) rescue Exception => e ui.error 'Something went wrong sending to HipChat.' ui.error e.to_s end end end def rooms [ config.room || config.rooms ].flatten end def nickname config.nickname || 'KnifeSpork' end def notify config.notify.nil? ? true : config.notify end def color config.color || 'yellow' end end end end
Version data entries
5 entries across 5 versions & 1 rubygems