<commit_before>require 'mail'
require 'yaml'

Dir[File.expand_path("../idid/**/*.rb", __FILE__)].each {|f| require f}

module Idid
  class << self
    attr_accessor :configuration

    def send *words
      setup_delivery
      Mail.deliver do
        from    Idid.configuration.email
        to      "#{<EMAIL>"
        subject "I did this"
        body    words.flatten.join(" ")
      end
    end

    def setup_delivery
      method = Idid.configuration.delivery['method']
      options = Idid.configuration.delivery['options'] || {}

      options.keys.each do |key|
        options[(key.to_sym rescue key) || key] = options.delete(key)
      end

      puts options

      case method
      when 'smtp'
        setup_smtp options
      when 'sendmail'
        setup_sendmail
      when 'exim'
        setup_exim options
      end
    end

    def setup_smtp options = {}
      Mail.defaults do
        delivery_method :smtp, Idid::Configuration::SMTP_DEFAULTS.merge(options)
      end
    end

    def setup_sendmail
      Mail.defaults do
        delivery_method :sendmail
      end
    end

    def setup_exim options={}
      Mail.defaults do
        delivery_method :exim, Idid::Configuration::EXIM_DEFAULTS.merge(options)
      end
    end<commit_msg>Removed puts of options<commit_after>require 'mail'
require 'yaml'

Dir[File.expand_path("../idid/**/*.rb", __FILE__)].each {|f| require f}

module Idid
  class << self
    attr_accessor :configuration

    def send *words
      setup_delivery
      Mail.deliver do
        from    Idid.configuration.email
        to      "#{<EMAIL>"
        subject "I did this"
        body    words.flatten.join(" ")
      end
    end

    def setup_delivery
      method = Idid.configuration.delivery['method']
      options = Idid.configuration.delivery['options'] || {}

      options.keys.each do |key|
        options[(key.to_sym rescue key) || key] = options.delete(key)
      end

      case method
      when 'smtp'
        setup_smtp options
      when 'sendmail'
        setup_sendmail
      when 'exim'
        setup_exim options
      end
    end

    def setup_smtp options = {}
      Mail.defaults do
        delivery_method :smtp, Idid::Configuration::SMTP_DEFAULTS.merge(options)
      end
    end

    def setup_sendmail
      Mail.defaults do
        delivery_method :sendmail
      end
    end

    def setup_exim options={}
      Mail.defaults do
        delivery_method :exim, Idid::Configuration::EXIM_DEFAULTS.merge(options)
      end
    end
{'fraction_non_alphanumeric': 0.09307875894988067, 'fraction_numerical': 0.0, 'mean_word_length': 2.1875792141951838, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '7074727', 'n_tokens_mistral': 778, 'n_tokens_neox': 767, 'n_words': 186}