<commit_before># -*- coding: utf-8 -*-
class StatisticsController < ApplicationController
  before_filter { add_body_class('edit') }
  before_filter { sub_layout("admin") if admin? }
  before_filter :require_admin

  def index
    render text: "index"
  end

  def ldap_diff
    render text: "ldap diff"
    # headers['Content-Disposition'] = 'attachment; filename="ldap_diff-' + Time.now().to_i.to_s + '.xls"'
    # headers['Cache-Control'] = ''
    # respond_to do |format|
    #   format.xls { render layout: false, content_type: "application/vnd.ms-excel" }
    # end
  end
end


<commit_msg>Added statistics file download<commit_after># -*- coding: utf-8 -*-
class StatisticsController < ApplicationController
  before_filter { add_body_class('edit') }
  before_filter { sub_layout("admin") if admin? }
  before_filter :require_admin

  def index
  end

  def ldap_diff
    send_file File.join(Rails.root, "data", "ldap_diff.xls"), type: :xls, disposition: "attachment", filename: "ldap_diff.xls"
  end
end

{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.001976284584980237, 'mean_word_length': 4.116161616161616, 'pattern_counts': {'":': 0, '<': 5, '<?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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3092443', 'n_tokens_mistral': 338, 'n_tokens_neox': 328, 'n_words': 78}