Class: Integrity::Notifier::Jabber
- Inherits:
-
Notifier::Base
- Object
- Notifier::Base
- Integrity::Notifier::Jabber
- Defined in:
- lib/integrity/notifier/jabber.rb
Instance Attribute Summary collapse
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
Class Method Summary collapse
Instance Method Summary collapse
- #deliver! ⇒ Object
-
#initialize(build, config = {}) ⇒ Jabber
constructor
A new instance of Jabber.
- #message ⇒ Object
Constructor Details
#initialize(build, config = {}) ⇒ Jabber
Returns a new instance of Jabber.
13 14 15 16 17 18 19 20 |
# File 'lib/integrity/notifier/jabber.rb', line 13 def initialize(build, config = {}) host = config["host"].blank? ? nil : config.delete("host") post = config["port"].blank? ? 5222 : config.delete("port") @server = ::Jabber::Simple.new(config.delete("user"), config.delete("pass"), nil, "Available", host, port) sleep 4 @recipients = config["recipients"].nil? ? [] : config.delete("recipients").split(/\s+/) super end |
Instance Attribute Details
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
7 8 9 |
# File 'lib/integrity/notifier/jabber.rb', line 7 def recipients @recipients end |
Class Method Details
.to_haml ⇒ Object
9 10 11 |
# File 'lib/integrity/notifier/jabber.rb', line 9 def self.to_haml File.read(File.dirname(__FILE__) / "config.haml") end |
Instance Method Details
#deliver! ⇒ Object
22 23 24 25 26 |
# File 'lib/integrity/notifier/jabber.rb', line 22 def deliver! @recipients.each do |r| @server.deliver(r, ) end end |
#message ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/integrity/notifier/jabber.rb', line 28 def @message ||= <<-content #{build.project.name}: #{} (#{commit.committed_at} by #{commit..name}) Message: #{commit.} Link: #{build_url} content end |