Class: Hookie::Plugin::HipChatPlugin
Instance Attribute Summary
Attributes inherited from BasePlugin
#config
Instance Method Summary
collapse
Methods inherited from BasePlugin
#config_key, #initialize, #log
Instance Method Details
#post_receive ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/hookie/plugins/hipchat_plugin.rb', line 28
def post_receive
log "Sending message to HipChat ... "
response = {}
response = speak format_message
if response[:status]
log "Message sent to HipChat"
elsif response[:error]
log "Message end failed: #{response[:error][:message]}"
else
log "Unknown response"
end
end
|
#should_run? ⇒ Boolean
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/hookie/plugins/hipchat_plugin.rb', line 14
def should_run?
warnings = []
if @framework.changes.empty?
log "No changes"
return false
end
warnings << "hookie.hipchat.apikey not set!" unless @config[:apikey]
warnings << "hookie.hipchat.room not set!" unless @config[:room]
log warnings.join(", ") unless warnings.empty?
warnings.empty?
end
|
#to_s ⇒ Object
10
11
12
|
# File 'lib/hookie/plugins/hipchat_plugin.rb', line 10
def to_s
"HipChat Notifier"
end
|