<commit_before>require 'table_display'

# all Enumerable classes should get TableDisplay functionality...
Enumerable.send(:include, TableDisplay)

# including those that have already included Enumerable by the time this plugin is loaded.
# Ruby doesn't recursively update through the module tree, so although any new classes/modules
# that include Enumerable will get TableDisplay, we have to do it ourself for older ones.
ObjectSpace.each_object(Module) {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}
ObjectSpace.each_object(Class)  {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}

# Rails 2.3 named_scopes certainly quack like enumerables, but surprisingly they don't themself include Enumerable.
if ActiveRecord::NamedScope.const_defined?(:Scope)
  ActiveRecord::NamedScope::Scope.send(:include, TableDisplay)
end<commit_msg>fix init against later versions of rails renaming NamedScope<commit_after>require 'table_display'

# all Enumerable classes should get TableDisplay functionality...
Enumerable.send(:include, TableDisplay)

# including those that have already included Enumerable by the time this plugin is loaded.
# Ruby doesn't recursively update through the module tree, so although any new classes/modules
# that include Enumerable will get TableDisplay, we have to do it ourself for older ones.
ObjectSpace.each_object(Module) {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}
ObjectSpace.each_object(Class)  {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}

# Rails 2.3 named_scopes certainly quack like enumerables, but surprisingly they don't themself include Enumerable.
if ActiveRecord.const_defined?(:NamedScope) && ActiveRecord::NamedScope.const_defined?(:Scope)
  ActiveRecord::NamedScope::Scope.send(:include, TableDisplay)
end
{'fraction_non_alphanumeric': 0.0881557598702001, 'fraction_numerical': 0.002163331530557058, 'mean_word_length': 6.773109243697479, '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': '4051709', 'n_tokens_mistral': 501, 'n_tokens_neox': 485, 'n_words': 176}