Class: Integrity::Notifier::IRC

Inherits:
Notifier::Base
  • Object
show all
Defined in:
lib/integrity/notifier/irc.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build, config = {}) ⇒ IRC

Returns a new instance of IRC.



20
21
22
23
# File 'lib/integrity/notifier/irc.rb', line 20

def initialize(build, config={})
  @uri = config.delete("uri")
  super
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



6
7
8
# File 'lib/integrity/notifier/irc.rb', line 6

def uri
  @uri
end

Class Method Details

.to_hamlObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/integrity/notifier/irc.rb', line 8

def self.to_haml
  "%p.normal\n%label{ :for => \"irc_notifier_uri\" } Send to\n%input.text#irc_notifier_uri{                          |\n:name => \"notifiers[IRC][uri]\",                      |\n:type => \"text\",                                     |\n:value => config[\"uri\"] ||                           |\n\"irc://[email protected]:6667/#test\" } |\n"
end

Instance Method Details

#deliver!Object



25
26
27
28
29
30
# File 'lib/integrity/notifier/irc.rb', line 25

def deliver!
  ShoutBot.shout(uri) do |channel|
    channel.say "#{build.project.name}: #{short_message}"
    channel.say commit_url
  end
end