Class: Integrity::Notifier::Jabber
- Inherits:
-
Notifier::Base
- Object
- Notifier::Base
- Integrity::Notifier::Jabber
- Defined in:
- lib/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.
14 15 16 17 18 |
# File 'lib/notifier/jabber.rb', line 14 def initialize(build, config = {}) @server = ::Jabber::Simple.new(config.delete(:user), config.delete(:pass)) @recipients = config[:recipients].nil? ? [] : config.delete(:recipients).split(/\s+/) super end |
Instance Attribute Details
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
8 9 10 |
# File 'lib/notifier/jabber.rb', line 8 def recipients @recipients end |
Class Method Details
.to_haml ⇒ Object
10 11 12 |
# File 'lib/notifier/jabber.rb', line 10 def self.to_haml File.read File.dirname(__FILE__) / "config.haml" end |
Instance Method Details
#deliver! ⇒ Object
20 21 22 23 24 |
# File 'lib/notifier/jabber.rb', line 20 def deliver! @recipients.each do |r| @server.deliver(r, ) end end |
#message ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/notifier/jabber.rb', line 26 def @message ||= <<-content #{build.project.name}: #{} (at #{build.commited_at} by #{build..name}) Commit Message: '#{build.}' Link: #{build_url} content end |