<commit_before>class PostMessage < SlackService
  def post!
    result 500, 'Missing Webhook URL' unless webhook_url.present?

    notifier = Slack::Notifier.new webhook_url

    notifier.channel = value_for(:channel, 'hub')
    notifier.username = value_for(:username, 'Slack EP')

    args = {
        icon_emoji: value_for(:icon_emoji),
        attachments: [value_for(:attachments)]
    }

    notifier.ping message[:body], args
  end

  private

  def value_for(param, default = nil)
    @payload[:message][param.to_sym] || @config[param.to_s] || default
  end

  def message
    @payload[:message]
  end
end<commit_msg>Send attachments without array wrapping<commit_after>class PostMessage < SlackService
  def post!
    result 500, 'Missing Webhook URL' unless webhook_url.present?

    notifier = Slack::Notifier.new webhook_url

    notifier.channel = value_for(:channel)
    notifier.username = value_for(:username)

    args = {
        icon_emoji: value_for(:icon_emoji),
        attachments: value_for(:attachments)
    }

    notifier.ping message[:body], args
  end

  private

  def value_for(param, default = nil)
    @payload[:message][param.to_sym] || @config[param.to_s] || default
  end

  def message
    @payload[:message]
  end
end
{'fraction_non_alphanumeric': 0.10836653386454183, 'fraction_numerical': 0.004780876494023904, 'mean_word_length': 3.651851851851852, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2805424', 'n_tokens_mistral': 418, 'n_tokens_neox': 395, 'n_words': 90}