<commit_before>class WasabbiFileController < ApplicationController

  def send_file_data
    file_parts = params[:file_parts]
    if file_parts.is_a? String
      file_parts = file_parts.split "/"
    end

    if !file_parts
      raise render(:file => "#{Rails.root}/public/404.html", :layout => false, :status => 404)
    end

    path = File.expand_path(File.join(File.dirname(__FILE__), "..", "public", *file_parts))

    file_name, extension = if file_parts.last =~ /\.([^.]*)$/
      [file_parts.last, $1]
    else
      [[file_parts.last, params[:format]].join("."), params[:format]]
    end

    path.gsub!(/\.([^.]*)$/, "")

    path = [path, extension].join(".")

    unless %w(css).include?(extension)
      raise "bad extension: #{extension}"
    end

    if !File.exists? path
      render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404<commit_msg>Revert "Fix file controller bug"<commit_after>class WasabbiFileController < ApplicationController

  def send_file_data
    file_parts = params[:file_parts]
    if file_parts.is_a? String
      file_parts = file_parts.split "/"
    end

    if !file_parts
      raise render(:file => "#{Rails.root}/public/404.html", :layout => false, :status => 404)
    end

    path = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "public", *file_parts))

    file_name, extension = if file_parts.last =~ /\.([^.]*)$/
      [file_parts.last, $1]
    else
      [[file_parts.last, params[:format]].join("."), params[:format]]
    end

    path.gsub!(/\.([^.]*)$/, "")

    path = [path, extension].join(".")

    unless %w(css).include?(extension)
      raise "bad extension: #{extension}"
    end

    if !File.exists? path
      render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
{'fraction_non_alphanumeric': 0.1858014420410427, 'fraction_numerical': 0.014420410427066, 'mean_word_length': 3.1566820276497696, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '5514669', 'n_tokens_mistral': 632, 'n_tokens_neox': 588, 'n_words': 121}