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
  <<-HAML
%p.normal
  %label{ :for => "irc_notifier_uri" } Send to
  %input.text#irc_notifier_uri{                          |
    :name => "notifiers[IRC][uri]",                      |
    :type => "text",                                     |
    :value => config["uri"] ||                           |
"irc://[email protected]:6667/#test" } |
  HAML
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