<commit_before>class EngineAssets::AssetsController < ApplicationController
  unloadable

  layout        nil
  before_filter :expire, :set_headers
  after_filter  :cache

  def show
    flat_file = EngineAssets::PublicLocator.locate(File.join(controller_name, [params[:path], params[:format]].join('.')))
    if(flat_file)
      render(:file => flat_file)
    else
      begin
        render(:template => File.join('engine_assets', controller_name, params[:path]), :layout => false)
      rescue ActionView::MissingTemplate
        head :not_found
      end
    end
  end


  private

  def expire
    # TODO<commit_msg>AssetsController extends from ActionController::Base, resolving class reloading issues.<commit_after>class EngineAssets::AssetsController < ActionController::Base
  layout        nil
  before_filter :expire, :set_headers
  after_filter  :cache

  def show
    flat_file = EngineAssets::PublicLocator.locate(File.join(controller_name, [params[:path], params[:format]].join('.')))
    if(flat_file)
      render(:file => flat_file)
    else
      begin
        render(:template => File.join('engine_assets', controller_name, params[:path]), :layout => false)
      rescue ActionView::MissingTemplate
        head :not_found
      end
    end
  end


  private

  def expire
    # TODO
{'fraction_non_alphanumeric': 0.10437452033768227, 'fraction_numerical': 0.0, 'mean_word_length': 3.6405693950177938, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6339356', 'n_tokens_mistral': 382, 'n_tokens_neox': 371, 'n_words': 83}