<commit_before>require 'i18nliner/extensions/controller'
require 'i18nliner/extensions/view'
require 'i18nliner/extensions/model'

module I18nliner
  class Railtie < Rails::Railtie
    ActiveSupport.on_load :action_controller do
      ActionController::Base.send :include, I18nliner::Extensions::Controller
    end

    ActiveSupport.on_load :action_view do
      require 'i18nliner/erubis'
      ActionView::Template::Handlers::ERB.erb_implementation = I18nliner::Erubis
      ActionView::Base.send :include, I18nliner::Extensions::View
    end

    ActiveSupport.on_load :active_record do
      ActiveRecord::Base.send :include, I18nliner::Extensions::Model
    end

    rake_tasks do
      load "tasks/i18nliner.rake"
    end
  end
end


<commit_msg>wrap railtie loaders into an initializer block<commit_after>require 'i18nliner/extensions/controller'
require 'i18nliner/extensions/view'
require 'i18nliner/extensions/model'

module I18nliner
  class Railtie < Rails::Railtie
    initializer 'i18nliner' do
      ActiveSupport.on_load :action_controller do
        ActionController::Base.send :include, I18nliner::Extensions::Controller
      end

      ActiveSupport.on_load :action_view do
        require 'i18nliner/erubis'
        ActionView::Template::Handlers::ERB.erb_implementation = I18nliner::Erubis
        ActionView::Base.send :include, I18nliner::Extensions::View
      end

      ActiveSupport.on_load :active_record do
        ActiveRecord::Base.send :include, I18nliner::Extensions::Model
      end
    end

    rake_tasks do
      load "tasks/i18nliner.rake"
    end
  end
end



{'fraction_non_alphanumeric': 0.08625, 'fraction_numerical': 0.02625, 'mean_word_length': 4.018808777429467, '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': '6684797', 'n_tokens_mistral': 553, 'n_tokens_neox': 489, 'n_words': 96}