<commit_before>require "heaven/comparison/linked"

module Heaven
  module Notifier
    # A notifier for Slack
    class Slack < Notifier::Default
      def deliver(message)
        output_message   = ""
        filtered_message = slack_formatted(message)

        Rails.logger.info "slack: #{filtered_message}"
        Rails.logger.info "message: #{message}"

        if pending? || deployment_desc =~ /Auto-Deployed/
          output_message = "New deployment triggered :rocket: (##{deployment_number})"
        end

        slack_account.ping "",
          :channel     => "##{chat_room}",
          :username    => slack_bot_name,
          :icon_url    => slack_bot_icon,
          :attachments => [{
            :text    => filtered_message,
            :color   => green? ? "good" : "danger",
            :pretext => output_message
          }]
      end

      def default_message
        message = output_link("##{deployment_number}")
        message << " : #{user_link}"<commit_msg>Use markdown everywhere in slack notifier<commit_after>require "heaven/comparison/linked"

module Heaven
  module Notifier
    # A notifier for Slack
    class Slack < Notifier::Default
      def deliver(message)
        output_message   = ""
        filtered_message = slack_formatted(message)

        Rails.logger.info "slack: #{filtered_message}"
        Rails.logger.info "message: #{message}"

        if pending? || deployment_desc =~ /Auto-Deployed/
          output_message = "New deployment triggered :rocket: (##{deployment_number})"
        end

        slack_account.ping "",
          :channel     => "##{chat_room}",
          :username    => slack_bot_name,
          :icon_url    => slack_bot_icon,
          :attachments => [{
            :text      => filtered_message,
            :color     => green? ? "good" : "danger",
            :pretext   => output_message,
            :mrkdwn_in => ["text", "pretext"]
          }]
      end

      def default_message
        message = output_link("##{deployment_number}")
        message << " : #{user_link}"
{'fraction_non_alphanumeric': 0.11972855065438681, 'fraction_numerical': 0.0, 'mean_word_length': 2.195046439628483, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 18, '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': '3489018', 'n_tokens_mistral': 600, 'n_tokens_neox': 580, 'n_words': 123}