<commit_before># frozen_string_literal: true

require 'rails'
require 'roundabout/engine'

module Roundabout
  class Railtie < ::Rails::Railtie #:nodoc:
    initializer 'roundabout' do
      if ENV['ROUNDABOUT']
        if Rails::VERSION::MAJOR >= 5
          ActiveSupport.on_load :action_dispatch_integration_test do
            require 'roundabout/monkey/capybara'
            require 'roundabout/rspec' if defined? RSpec
            require 'roundabout/minitest' if defined? Minitest
          end
        else
          ActiveSupport.on_load :active_support_test_case do
            require 'roundabout/monkey/capybara'
            require 'roundabout/rspec' if defined? RSpec
            require 'roundabout/minitest' if defined? Minitest
          end
        end

        ActiveSupport.on_load :action_controller do
          require 'roundabout/monkey/action_controller'
        end
      end

      ActiveSupport.on_load :after_initialize do
        if Rails.env.development?
          Rails.application.routes.append do
            mount Roundabout::Engine, at: '/roundabout'
          end
        end
      end
    end
  end
end
<commit_msg>Railties has a hook for this<commit_after># frozen_string_literal: true

require 'rails'
require 'roundabout/engine'

module Roundabout
  class Railtie < ::Rails::Railtie #:nodoc:
    initializer 'roundabout' do
      if ENV['ROUNDABOUT']
        if Rails::VERSION::MAJOR >= 5
          ActiveSupport.on_load :action_dispatch_integration_test do
            require 'roundabout/monkey/capybara'
            require 'roundabout/rspec' if defined? RSpec
            require 'roundabout/minitest' if defined? Minitest
          end
        else
          ActiveSupport.on_load :active_support_test_case do
            require 'roundabout/monkey/capybara'
            require 'roundabout/rspec' if defined? RSpec
            require 'roundabout/minitest' if defined? Minitest
          end
        end

        ActiveSupport.on_load :action_controller do
          require 'roundabout/monkey/action_controller'
        end
      end

      config.after_initialize do |app|
        if Rails.env.development?
          app.routes.append do
            mount Roundabout::Engine => '/roundabout'
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06884531590413943, 'fraction_numerical': 0.0008714596949891067, 'mean_word_length': 2.23836389280677, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '3594087', 'n_tokens_mistral': 663, 'n_tokens_neox': 641, 'n_words': 162}