<commit_before>class BuildMailer < ActionMailer::Base
  default :from => '<EMAIL>'

  def finished_email(build)
    @build     = build
    subject    = "#{build.repository.slug}##{build.number} (#{build.commit[0, 7]}): the build has #{build.passed? ? 'passed' : 'failed' }"
    recipients = [build.committer_email, build.author_email, build.repository.owner_email].select(&:present?).join(',')
    mail(:to => recipients, :subject => subject)
  end
end<commit_msg>don't send emails twice (would have thought sendgrid does that for us)<commit_after>class BuildMailer < ActionMailer::Base
  default :from => '<EMAIL>'

  def finished_email(build)
    @build     = build
    subject    = "#{build.repository.slug}##{build.number} (#{build.commit[0, 7]}): the build has #{build.passed? ? 'passed' : 'failed' }"
    recipients = unique_recipients(build)
    mail(:to => recipients, :subject => subject)
  end

  protected

    def unique_recipients(build)
      recipients = [build.committer_email, build.author_email, build.repository.owner_email]
      recipients.select(&:present?).join(',').split(',').map(&:strip).uniq.join(',')
    end
end
{'fraction_non_alphanumeric': 0.1649122807017544, 'fraction_numerical': 0.0035087719298245615, 'mean_word_length': 4.485576923076923, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '5187272', 'n_tokens_mistral': 375, 'n_tokens_neox': 357, 'n_words': 77}