<commit_before>class DiffMailer < ActionMailer::Base
  def diff_notification(diff, changeset)

    # Only send to developers
    recipients changeset.repository.project.users.select{|u|
      u.mail &&
      u.roles_for_project(changeset.repository.project).map(&:name).include?("Developer")
    }.map{ |u|
      u.mail
    }

    project_name = changeset.repository.project.name
    author = changeset.author.to_s
    subject "Commit to #{project_name} by #{author}: #{changeset.short_comments}"
    #content_type 'multipart/alternative'

    part :content_type => "text/html",
      :body => render_message("diff_notification.text.html.rhtml",
                :project_name => project_name,
                :author => author,
                :diff => diff,
                :changeset => changeset)

    attachment 'text/plain' do |a|
      a.filename = "changeset_rev_#{changeset.revision}.diff"
      a.body = diff.join
    end
  end
end<commit_msg>Updated subject to match wiki notification format.<commit_after>class DiffMailer < ActionMailer::Base
  def diff_notification(diff, changeset)

    # Only send to developers
    recipients changeset.repository.project.users.select{|u|
      u.mail &&
      u.roles_for_project(changeset.repository.project).map(&:name).include?("Developer")
    }.map{ |u|
      u.mail
    }

    project_name = changeset.repository.project.name
    author = changeset.author.to_s
    subject "[#{project_name}] Commit by #{author}: #{changeset.short_comments}"
    #content_type 'multipart/alternative'

    part :content_type => "text/html",
      :body => render_message("diff_notification.text.html.rhtml",
                :project_name => project_name,
                :author => author,
                :diff => diff,
                :changeset => changeset)

    attachment 'text/plain' do |a|
      a.filename = "changeset_rev_#{changeset.revision}.diff"
      a.body = diff.join
    end
  end
end
{'fraction_non_alphanumeric': 0.12216494845360824, 'fraction_numerical': 0.0, 'mean_word_length': 2.8588469184890655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6926935', 'n_tokens_mistral': 597, 'n_tokens_neox': 575, 'n_words': 112}