<commit_before># This is a minimal Rails application with Rails 3 and 4 compatibility.
#
# copied with modifications from https://github.com/thoughtbot/clearance/blob/master/spec/dummy/application.rb
require "rails/all"

module Dummy
  APP_ROOT = File.expand_path("..", __FILE__).freeze

  I18n.enforce_available_locales = true

  class Application < Rails::Application
    config.action_controller.allow_forgery_protection = false
    config.action_controller.perform_caching = false
    config.action_dispatch.show_exceptions = false
    config.action_mailer.default_url_options = { host: "dummy.example.com" }
    config.action_mailer.delivery_method = :test
    config.active_support.deprecation = :stderr
    config.active_support.test_order = :random
    config.assets.enabled = true
    config.cache_classes = true
    config.consider_all_requests_local = true
    config.eager_load = false
    config.encoding = "utf-8"
    config.paths["app/controllers"] << "#{APP_ROOT}/app/controllers"
    config.paths["app/models"] << "#{APP_ROOT}/app/models"
    config.paths["app/views"] << "#{APP_ROOT}/app/views"
    config.paths["config/database"] = "#{APP_ROOT}/config/database.yml"
    config.paths["db"] = "#{APP_ROOT}/db"
    config.paths["db/migrate"] = "#{APP_ROOT}/db/migrate"
    config.paths["log"] = "tmp/log/development.log"
    config.secret_token = "SECRET_TOKEN_IS_MIN_30_CHARS_LONG"

    if Rails::VERSION::MAJOR >= 4
      config.secret_key_base = "SECRET_KEY_BASE"
    end

    def require_environment!
      initialize!
    end

    def initialize!(&block)
      FileUtils.mkdir_p(Rails.root.join("db").to_s)
      super unless @initialized
    end
  end
end<commit_msg>Update dummy application to be Rails 5/6 compatible<commit_after># This is a minimal Rails application with Rails 3 and 4 compatibility.
#
# copied with modifications from https://github.com/thoughtbot/clearance/blob/master/spec/dummy/application.rb
require "rails/all"

module Dummy
  APP_ROOT = File.expand_path("..", __FILE__).freeze

  I18n.enforce_available_locales = true

  class Application < Rails::Application
    config.action_controller.allow_forgery_protection = false
    config.action_controller.perform_caching = false
    config.action_dispatch.show_exceptions = false
    config.action_mailer.default_url_options = { host: "dummy.example.com" }
    config.action_mailer.delivery_method = :test
    config.active_support.deprecation = :stderr
    config.active_support.test_order = :random
    config.cache_classes = true
    config.consider_all_requests_local = true
    config.eager_load = false
    config.encoding = "utf-8"
    config.paths["app/controllers"] << "#{APP_ROOT}/app/controllers"
    config.paths["app/models"] << "#{APP_ROOT}/app/models"
    config.paths["app/views"] << "#{APP_ROOT}/app/views"
    config.paths["app/assets"] << "#{APP_ROOT}/app/assets"
    config.paths["config/database"] = "#{APP_ROOT}/config/database.yml"
    config.paths["db"] = "#{APP_ROOT}/db"
    config.paths["db/migrate"] = "#{APP_ROOT}/db/migrate"
    config.paths["log"] = "tmp/log/development.log"
    config.paths.add "config/routes.rb", with: "#{APP_ROOT}/config/routes.rb"
    config.secret_key_base = "SECRET_KEY_BASE"

    if config.active_record.sqlite3.respond_to?(:represent_boolean_as_integer)
      if Rails::VERSION::MAJOR < 6
        config.active_record.sqlite3.represent_boolean_as_integer = true
      end
    end

    if Rails::VERSION::MAJOR >= 6
      config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
    end

    config.active_job.queue_adapter = :inline

    def require_environment!
      initialize!
    end

    def initialize!(&block)
      FileUtils.mkdir_p(Rails.root.join("db").to_s)
      super unless @initialized
    end
  end
end


# require "rails/all"

# module Dummy
#   APP_ROOT = File.expand_path("..", __FILE__).freeze

#   I18n.enforce_available_locales = true

#   class Application < Rails::Application
#     config.action_controller.allow_forgery_protection = false
#     config.action_controller.perform_caching = false
#     config.action_dispatch.show_exceptions = false
#     config.action_mailer.default_url_options = { host: "dummy.example.com" }
#     config.action_mailer.delivery_method = :test
#     config.active_support.deprecation = :stderr
#     config.active_support.test_order = :random
#     config.assets.enabled = true
#     config.cache_classes = true
#     config.consider_all_requests_local = true
#     config.eager_load = false
#     config.encoding = "utf-8"
#     config.paths["app/controllers"] << "#{APP_ROOT}/app/controllers"
#     config.paths["app/models"] << "#{APP_ROOT}/app/models"
#     config.paths["app/views"] << "#{APP_ROOT}/app/views"
#     config.paths["config/database"] = "#{APP_ROOT}/config/database.yml"
#     config.paths["db"] = "#{APP_ROOT}/db"
#     config.paths["db/migrate"] = "#{APP_ROOT}/db/migrate"
#     config.paths["log"] = "tmp/log/development.log"
#     config.secret_token = "SECRET_TOKEN_IS_MIN_30_CHARS_LONG"

#     if Rails::VERSION::MAJOR >= 4
#       config.secret_key_base = "SECRET_KEY_BASE"
#     end

#     def require_environment!
#       initialize!
#     end

#     def initialize!(&block)
#       FileUtils.mkdir_p(Rails.root.join("db").to_s)
#       super unless @initialized
#     end
#   end
# end
{'fraction_non_alphanumeric': 0.13115982761851228, 'fraction_numerical': 0.00468427955780401, 'mean_word_length': 3.8838060384263495, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '6325854', 'n_tokens_mistral': 1795, 'n_tokens_neox': 1740, 'n_words': 273}