的Twitter通知程序巡航控制.rb
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了的Twitter通知程序巡航控制.rb相关的知识,希望对你有一定的参考价值。
gem "twitter4r", ">=0.3.0" require "twitter" require "time" class TwitterNotifier attr_writer :login, :password def initialize(project) @project = project Twitter::Client.configure do |conf| conf.user_agent = 'cruisecontrolrb' conf.application_name = 'CruiseControl.rb' conf.application_version = 'v1.2.1' conf.application_url = 'http://cruisecontrolrb.thoughtworks.com/' end def build_finished(build) return unless @login and build.failed? Twitter::Client.new(:login => @login, :password => @password). status(:post, "#{build.project.name} build #{build.label} failed") rescue nil end def build_fixed(build, previous_build) return unless @login Twitter::Client.new(:login => @login, :password => @password). status(:post, "#{build.project.name} build #{build.label} fixed") rescue nil end end end Project.plugin :twitter_notifier
以上是关于的Twitter通知程序巡航控制.rb的主要内容,如果未能解决你的问题,请参考以下文章