<commit_before>require 'rubygems'
require 'zip/zip'

desc "Generate file for sheet exports"
task sheet_export: :environment do
  export = Export.find_by_id(ENV["EXPORT_ID"])
  sheet_scope = Sheet.current.where(id: ENV["SHEET_IDS"].to_s.split(','))

  begin
    filename = "#{export.name.gsub(/[^a-zA-Z0-9_-]/, '_')} #{export.created_at.strftime("%I%M%P")}"

    all_files = [] # If numerous files are created then they need to be zipped!<commit_msg>Order sheet exports by design name and then sheet creation date<commit_after>require 'rubygems'
require 'zip/zip'

desc "Generate file for sheet exports"
task sheet_export: :environment do
  export = Export.find_by_id(ENV["EXPORT_ID"])
  sheet_scope = Sheet.current.where(id: ENV["SHEET_IDS"].to_s.split(',')).joins(:design).order('designs.name, sheets.created_at')

  begin
    filename = "#{export.name.gsub(/[^a-zA-Z0-9_-]/, '_')} #{export.created_at.strftime("%I%M%P")}"

    all_files = [] # If numerous files are created then they need to be zipped!
{'fraction_non_alphanumeric': 0.16334661354581673, 'fraction_numerical': 0.00398406374501992, 'mean_word_length': 5.128048780487805, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6013756', 'n_tokens_mistral': 361, 'n_tokens_neox': 345, 'n_words': 80}