<commit_before>require "alerty/plugin/mail/version"

require 'alerty'
require 'mail'

class Alerty
  class Plugin
    class Mail
      def initialize(config)
        raise ConfigError.new('mail: send_from is not configured') unless config.send_from
        raise ConfigError.new('mail: send_to is not configured') unless config.send_to
        delivery_method = config.delivery_method.to_sym || :sendmail
        delivery_settings = config.delivery_settings
        num_retries = config.num_retries || 3

        @mail = ::Mail.new do
          from    config.send_from
          to      config.send_to
        end
        if delivery_settings
          @mail.delivery_method(delivery_method, delivery_settings)<commit_msg>Fix delivery_settings was not working<commit_after>require "alerty/plugin/mail/version"

require 'alerty'
require 'mail'

class Alerty
  class Plugin
    class Mail
      def initialize(config)
        raise ConfigError.new('mail: send_from is not configured') unless config.send_from
        raise ConfigError.new('mail: send_to is not configured') unless config.send_to
        delivery_method = config.delivery_method.to_sym || :sendmail
        delivery_settings = config.delivery_settings
        num_retries = config.num_retries || 3

        @mail = ::Mail.new do
          from    config.send_from
          to      config.send_to
        end
        if delivery_settings
          @mail.delivery_method(delivery_method, delivery_settings.map {|k, v| [k.to_sym, v] }.to_h)
{'fraction_non_alphanumeric': 0.07651363938789088, 'fraction_numerical': 0.0013306719893546241, 'mean_word_length': 2.8863049095607236, 'pattern_counts': {'":': 0, '<': 3, '<?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': '87456', 'n_tokens_mistral': 437, 'n_tokens_neox': 431, 'n_words': 108}