<commit_before># require application helper so that we can include our helpers into it.
if defined?(Rails) and !Rails.root.nil?
  if (app_helper = Rails.root.join('app', 'helpers', 'application_helper.rb')).file?
    require app_helper.to_s
  end
end

module Refinery
  module Application
    class << self
      def refine!
        ::ApplicationHelper.send :include, ::Refinery::ApplicationHelper

        $stdout.puts "app inject"
        [::ApplicationController, ::Admin::BaseController].each do |c|
          c.send :include, ::Refinery::ApplicationController
          c.send :helper, :application
        end
        $stdout.puts "after app inject"

        ::Admin::BaseController.send :include, ::Refinery::Admin::BaseController
      end

      def included(base)
        self.instance_eval %(
          def self.method_missing(method_sym, *arguments, &block)
            #{base}.send(method_sym)
          end
        )

        # JavaScript files you want as :defaults (application.js is always included).
        base.config.action_view.javascript_expansions[:defaults] = %w()

        # Configure the default encoding used in templates for Ruby 1.9.
        base.config.encoding = "utf-8"

        # Configure sensitive parameters which will be filtered from the log file.
        base.config.filter_parameters += [:password, :password_confirmation]

        # Specify a cache store to use
        base.config.cache_store = :memory_store

        # Include the refinery controllers and helpers dynamically
        base.config.before_initialize do
          ::Refinery::Application.refine!
        end

        # This may seem like duplication but we need to do this in both steps
        # For development mode and for production mode.
        base.config.to_prepare do
          ::Refinery::Application.refine!
        end<commit_msg>Seems superfluous to have this.<commit_after>module Refinery
  module Application
    class << self
      def refine!
        ::ApplicationHelper.send :include, ::Refinery::ApplicationHelper

        $stdout.puts "app inject"
        [::ApplicationController, ::Admin::BaseController].each do |c|
          c.send :include, ::Refinery::ApplicationController
          c.send :helper, :application
        end
        $stdout.puts "after app inject"

        ::Admin::BaseController.send :include, ::Refinery::Admin::BaseController
      end

      def included(base)
        self.instance_eval %(
          def self.method_missing(method_sym, *arguments, &block)
            #{base}.send(method_sym)
          end
        )

        # JavaScript files you want as :defaults (application.js is always included).
        base.config.action_view.javascript_expansions[:defaults] = %w()

        # Configure the default encoding used in templates for Ruby 1.9.
        base.config.encoding = "utf-8"

        # Configure sensitive parameters which will be filtered from the log file.
        base.config.filter_parameters += [:password, :password_confirmation]

        # Specify a cache store to use
        base.config.cache_store = :memory_store

        # Include the refinery controllers and helpers dynamically
        base.config.to_prepare do
          ::Refinery::Application.refine!
        end
{'fraction_non_alphanumeric': 0.09110495537088335, 'fraction_numerical': 0.0018467220683287165, 'mean_word_length': 2.6434977578475336, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1342069', 'n_tokens_mistral': 865, 'n_tokens_neox': 840, 'n_words': 252}