<commit_before># frozen_string_literal: true

class Serializr
  class Railtie < ::Rails::Railtie
    initializer 'serializr.initialize' do
      require 'serializr/integration'

      # For Rails 5, automatically include this in the API controllers.
      if defined?(ActionController::API)
        ActionController::API.include(::Serializr::Integration)
      end

      ActionController::Base.include(::Serializr::Integration)
    end
  end
end<commit_msg>Introduce automatic integration configuration<commit_after># frozen_string_literal: true

class Serializr
  class Railtie < ::Rails::Railtie
    config.serializr = config.serializer = ActiveSupport::OrderedOptions.new
    config.serializr.integration = true

    initializer 'serializr.initialize' do
      if config.serializr.integration
        require 'serializr/integration'

        # For Rails 5, automatically include this in the API controllers.
        if defined?(ActionController::API)
          ActionController::API.include(::Serializr::Integration)
        end

        ActionController::Base.include(::Serializr::Integration)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0852575488454707, 'fraction_numerical': 0.0017761989342806395, 'mean_word_length': 3.795744680851064, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2098558', 'n_tokens_mistral': 324, 'n_tokens_neox': 304, 'n_words': 72}