# CatNotifier - CruiseControl Notifier for irc_cat
#
# Put this file in {CruiseControl Path}/builder_plugins/installed/
# Tell the builder, whom do you want to receive build notices
#
Project.configure do |project|
# ...
# project.cat_notifier.host = "your.irccat.host"
# project.cat_notifier.port = "yourport"
# ...
# end
#
# And enjoy :-)
# -Jordan Bracco
class CatNotifier
attr_accessor :host, :port
def initialize(project = nil)
end
def build_finished(build)
return if not build.failed?
catsend("#{build.project.name} build #{build.label} failed :-( Build cat is not happy.")
CruiseControl::Log.event("Sent build failed to irccat", :debug)
end
def build_fixed(build, previous_build)
catsend("#{build.project.name} build #{build.label} fixed! Yay!")
CruiseControl::Log.event("Sent build fixed to irccat", :debug)
end
def catsend(message)
begin
raise "Not Configured!" if @host.nil?||@port.nil?
socket = TCPSocket.open(@host,@port)
socket.write(message + "\r\n")
rescue => e
CruiseControl::Log.event("CatNotifier Error :\n#{e}", :error)
raise
end
end
end
Project.plugin :cat_notifier