<commit_before>require 'pathname'
require 'rubygems'
require 'rspec'

require 'virtus'

ENV['TZ'] = 'UTC'

SPEC_ROOT = Pathname(__FILE__).dirname.expand_path

Pathname.glob((SPEC_ROOT + '**/shared/**/*.rb').to_s).each { |file| require file }

RSpec.configure do |config|

  # Remove anonymous Attribute classes from Attribute descendants
  config.after :all do
    stack = [ Virtus::Attribute ]
    while klass = stack.pop
      klass.descendants.delete_if { |descendant| descendant.name.empty? }
      stack.concat(klass.descendants)
    end
  end
<commit_msg>Fix cleaning up anonymous classes in spec helper for 1.9.2<commit_after>require 'pathname'
require 'rubygems'
require 'rspec'

require 'virtus'

ENV['TZ'] = 'UTC'

SPEC_ROOT = Pathname(__FILE__).dirname.expand_path

Pathname.glob((SPEC_ROOT + '**/shared/**/*.rb').to_s).each { |file| require file }

RSpec.configure do |config|

  # Remove anonymous Attribute classes from Attribute descendants
  config.after :all do
    stack = [ Virtus::Attribute ]
    while klass = stack.pop
      klass.descendants.delete_if do |descendant|
        descendant.name.nil? || descendant.name.empty?
      end
      stack.concat(klass.descendants)
    end
  end

{'fraction_non_alphanumeric': 0.12334437086092716, 'fraction_numerical': 0.0024834437086092716, 'mean_word_length': 3.9549180327868854, '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': '4077343', 'n_tokens_mistral': 399, 'n_tokens_neox': 389, 'n_words': 94}