<commit_before>require 'active_support/core_ext/module/delegation'

module EmailPrefixer
  class Interceptor
    def delivering_email(mail)
      mail.subject.prepend(subject_prefix)
    end
    alias_method :previewing_email, :delivering_email

    private

    delegate :application_name, :stage_name, to: :configuration

    def configuration
      EmailPrefixer.configuration
    end

    def subject_prefix
      prefixes = []
      prefixes << application_name
      prefixes << stage_name.upcase unless stage_name == "production"
      "[#{prefixes.join(' ')}] "
    end
  end
end<commit_msg>Use core Forwardable instead of active support extension<commit_after>module EmailPrefixer
  class Interceptor
    extend Forwardable
    def_delegators :@configuration, :application_name, :stage_name

    def initialize
      @configuration = EmailPrefixer.configuration
    end

    def delivering_email(mail)
      mail.subject.prepend(subject_prefix)
    end
    alias_method :previewing_email, :delivering_email

    private

    def subject_prefix
      prefixes = []
      prefixes << application_name
      prefixes << stage_name.upcase unless stage_name == 'production'
      "[#{prefixes.join(' ')}] "
    end
  end
end
{'fraction_non_alphanumeric': 0.07573289902280131, 'fraction_numerical': 0.0, 'mean_word_length': 3.501831501831502, 'pattern_counts': {'":': 0, '<': 11, '<?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': '799058', 'n_tokens_mistral': 352, 'n_tokens_neox': 343, 'n_words': 80}