<commit_before>module Exceptioner::Transport

  class Base
    
    cattr_accessor :sender

    cattr_accessor :recipients

    cattr_accessor :prefix

    cattr_accessor :subject


    def self.deliver(exception, options = {})
      raise Exceptioner::ExceptionerError, 'Implement deliver class method in your Exceptioner::Transport::Base subclass'
    end
    
    protected
    def self.default_options
      {
        :sender => sender || 'exceptioner',
        :recipients => recipients,
        :prefix => prefix || '[ERROR] ',
        :subject => subject
      }
    end

    def self.prefixed_subject(exception, options)
      "#{options[:prefix]}#{exception.message}"
    end

  end

end
<commit_msg>moved rendering action to Transport::Base<commit_after>module Exceptioner::Transport

  class Base
    
    cattr_accessor :sender

    cattr_accessor :recipients

    cattr_accessor :prefix

    cattr_accessor :subject


    def self.deliver(exception, options = {})
      raise Exceptioner::ExceptionerError, 'Implement deliver class method in your Exceptioner::Transport::Base subclass'
    end
    
    protected
    def self.default_options
      {
        :sender => sender || 'exceptioner',
        :recipients => recipients,
        :prefix => prefix || '[ERROR] ',
        :subject => subject
      }
    end

    def self.prefixed_subject(exception, options)
      "#{options[:prefix]}#{exception.message}"
    end
    
    def self.render(exception, options = {})
      ERB.new(template, nil, '>').result(binding)
    end

    def self.template
      @template ||= File.read(File.expand_path(File.join(File.dirname(__FILE__), 'templates', 'exception.erb')))
    end
    

  end

end

{'fraction_non_alphanumeric': 0.10687022900763359, 'fraction_numerical': 0.0, 'mean_word_length': 2.8727272727272726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '3202197', 'n_tokens_mistral': 500, 'n_tokens_neox': 483, 'n_words': 112}