<commit_before>require 'set'

module Badgeable
  class Config
    
    class << self
      attr_accessor :badge_definitions

      def custom_attributes
        @custom_attributes ||= Set.new
      end
    end
    
    attr_reader :threshold, :klass, :conditions_array, :subject_proc
    
    def initialize
      @conditions_array = [Proc.new {true}]
      subject :user
    end
    
    def subject(sym = nil, &block)
      @subject_name = sym
      if block_given?
        @subject_proc = Proc.new {|instance|
          block.call(instance)
        }
      else
        @subject_proc = Proc.new { |instance|
          if klass.to_s.underscore.to_sym == @subject_name<commit_msg>ensure #icon and #description are in the initial set of custom attributes<commit_after>require 'set'

module Badgeable
  class Config
    
    class << self
      attr_accessor :badge_definitions

      def custom_attributes
        @custom_attributes ||= Set.new([:icon, :description])
      end
    end
    
    attr_reader :threshold, :klass, :conditions_array, :subject_proc
    
    def initialize
      @conditions_array = [Proc.new {true}]
      subject :user
    end
    
    def subject(sym = nil, &block)
      @subject_name = sym
      if block_given?
        @subject_proc = Proc.new {|instance|
          block.call(instance)
        }
      else
        @subject_proc = Proc.new { |instance|
          if klass.to_s.underscore.to_sym == @subject_name
{'fraction_non_alphanumeric': 0.08650519031141868, 'fraction_numerical': 0.0, 'mean_word_length': 2.293849658314351, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3675237', 'n_tokens_mistral': 441, 'n_tokens_neox': 434, 'n_words': 107}