class RakeNotifier::Ikachan

Constants

FAILED_LABEL
START_LABEL
SUCCESS_LABEL

Public Class Methods

new(url, channel) click to toggle source
# File lib/rake_notifier/ikachan.rb, line 13
def initialize(url, channel)
  @client = Client.new(url, channel)
end

Public Instance Methods

completed_task(task, system_exit) click to toggle source
# File lib/rake_notifier/ikachan.rb, line 24
    def completed_task(task, system_exit)
      label = system_exit.success? ? SUCCESS_LABEL : FAILED_LABEL
      notice <<-EOS.strip_heredoc
        #{label} $ #{task.reconstructed_command_line}
        (exit #{system_exit.status} from #{hostname} at #{Time.now} RAILS_ENV=#{rails_env})
      EOS
    end
started_task(task) click to toggle source
# File lib/rake_notifier/ikachan.rb, line 17
    def started_task(task)
      notice <<-EOS.strip_heredoc
        #{START_LABEL} $ #{task.reconstructed_command_line}
        (from #{hostname} at #{Time.now} RAILS_ENV=#{rails_env})
      EOS
    end

Private Instance Methods

notice(message) click to toggle source
# File lib/rake_notifier/ikachan.rb, line 34
def notice(message)
  message.each_line {|m| @client.notice m }
end