<commit_before>require "abstract_unit"
require "mocha/setup"

CACHE_DIR = "test_cache"
# Don't change "../tmp" cavalierly or you might hose something you don't want hosed
TEST_TMP_DIR = File.expand_path("../tmp", __FILE__)
FILE_STORE_PATH = File.join(TEST_TMP_DIR, CACHE_DIR)

class CachingController < ActionController::Base
  abstract!

  self.cache_store = :file_store, FILE_STORE_PATH
end

class CachePath
  def call(controller)
    ["controller", controller.params[:id]].compact.join("-")
  end
end

class ActionCachingTestController < CachingController
  rescue_from(Exception) { head 500 }
  rescue_from(ActionController::UnknownFormat) { head :not_acceptable }
  if defined? ActiveRecord<commit_msg>Fix mocha/setup deprecation warning<commit_after>require "abstract_unit"
require "mocha/minitest"

CACHE_DIR = "test_cache"
# Don't change "../tmp" cavalierly or you might hose something you don't want hosed
TEST_TMP_DIR = File.expand_path("../tmp", __FILE__)
FILE_STORE_PATH = File.join(TEST_TMP_DIR, CACHE_DIR)

class CachingController < ActionController::Base
  abstract!

  self.cache_store = :file_store, FILE_STORE_PATH
end

class CachePath
  def call(controller)
    ["controller", controller.params[:id]].compact.join("-")
  end
end

class ActionCachingTestController < CachingController
  rescue_from(Exception) { head 500 }
  rescue_from(ActionController::UnknownFormat) { head :not_acceptable }
  if defined? ActiveRecord
{'fraction_non_alphanumeric': 0.10215427380125087, 'fraction_numerical': 0.004169562195969423, 'mean_word_length': 6.024390243902439, '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': '1162961', 'n_tokens_mistral': 465, 'n_tokens_neox': 455, 'n_words': 108}