Sha256: 28ad19c72919d6618b5083e037282b897a9f43aab2c405040062af8793182825
Contents?: true
Size: 897 Bytes
Versions: 9
Compression:
Stored size: 897 Bytes
Contents
module Conveyor module Output class Email class << self def say(*msg) # Do nothing end alias_method :info, :say alias_method :debug, :say def reset! @msg_queue = [] end def warning(*msg) # Do nothing end def error(*msg) @msg_queue ||= [] options = msg.extract_options! msg = msg.join("\n") if msg.class == Array @msg_queue << msg end def write(msgtype, *msg) if respond_to?(msgtype) self.send(msgtype, *msg) end end def mail return if @msg_queue.nil? || @msg_queue.empty? puts "Sending email to #{Conveyor::Foreman.instance.notify_list}" puts @msg_queue reset! end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems