<commit_before>class BuildMailer < ActionMailer::Base

  def build_report(build, recipients, from, subject, message, sent_at = Time.now)
    @subject    = "[CruiseControl] #{subject}"
    @body       = {:build => build, :message => message, :log_parser => LogParser.new(build.output)}
    @failures_and_errors = LogParser.new(build.output).failures_and_errors.map { |e| formatted_error(e) }  
    @recipients = recipients
    @from       = from
    @sent_on    = sent_at
    @headers    = {}
  end

  def test(recipients,  sent_at = Time.now)
    @subject    = 'Test CI E-mail'
    @body       = {}
    @recipients = recipients
    @sent_on    = sent_at
    @headers    = {}
  end

  def formatted_error
    return "Name: #{test_error.test_name}\n" +
           "Type: #{test_error.type}\n" +
           "Message: #{test_error.message('\n', "\n")}\n\n" +
           test_error.stacktrace + "\n\n\n"
  end

end
<commit_msg>r495: Fixing a unit test<commit_after>class BuildMailer < ActionMailer::Base

  def build_report(build, recipients, from, subject, message, sent_at = Time.now)
    @subject    = "[CruiseControl] #{subject}"
    @body       = {
        :build => build,
        :message => message,
        :failures_and_errors => LogParser.new(build.output).failures_and_errors.map { |e| formatted_error(e) } }
    @recipients = recipients
    @from       = from
    @sent_on    = sent_at
    @headers    = {}
  end

  def test(recipients,  sent_at = Time.now)
    @subject    = 'Test CI E-mail'
    @body       = {:build => nil, :message => 'Hi, mom', :failures_and_errors => []}
    @recipients = recipients
    @sent_on    = sent_at
    @headers    = {}
  end

  def formatted_error
    return "Name: #{test_error.test_name}\n" +
           "Type: #{test_error.type}\n" +
           "Message: #{test_error.message('\n', "\n")}\n\n" +
           test_error.stacktrace + "\n\n\n"
  end

end

{'fraction_non_alphanumeric': 0.14602003162888771, 'fraction_numerical': 0.0015814443858724301, 'mean_word_length': 2.574387947269303, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4007870', 'n_tokens_mistral': 673, 'n_tokens_neox': 646, 'n_words': 132}