Class: PostRemoteLog::Methods::Growl

Inherits:
Object
  • Object
show all
Defined in:
lib/post_remote_log/methods/growl.rb

Class Method Summary collapse

Class Method Details

.send(config, values) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/post_remote_log/methods/growl.rb', line 22

def self.send(config, values)
	g = ::Growl.new(config[:host], "PostRemoteLog", [values[:classification]], [values[:classification]], config[:password])
	
	message = StringIO.new
	[:uptime, :system, :hostname, :address].each do |key|
		message.puts "[#{key}] #{values[key]}"
	end
	
	message.puts
	message.puts values[:report]
	
	g.notify(values[:classification], "Remote Log [#{values[:classification]}] from #{values[:hostname]}", message.string, config[:priority] || 0, config[:sticky])
end