<commit_before>namespace :kopal do
  desc "Creates/upgrades the database for Kopal. Called automatically with db:migrate."
  task :update => :environment do
    Rake::Task["gems:install"].invoke #Check gem dependencies and install/upgrade them.
    Kopal::Database.migrate
  end

  #desc "Fetches new release from Interner, then updates the plugin."
  task :upgrade => :environment do
    #TODO: Fetch the latest version number from Inernet, download and install it if necessary.
    Rake::Task["kopal:update"].invoke
  end

  #desc "Removes kopal specific tables from the database."
  task :clear_database do
  end

  #desc "Always call with \"--silent\" option. Backup the database in XML format." +
  #  "Example: rake --silent kopal:backup > kopal_backup.xml"
  task :backup do
    Kopal::Database.backup
  end

  task :restore do
    Kopal::Database.restore
  end

  #LATER: This should be a hidden task, shouldn't be available in the list.
  #desc "Changes prefix of the kopal tables for a given database. Pass old prefix as argument. Reads new prefix from kopal.databse.yml"
  task :change_prefix do
  end

  #TODO: To-implement.
  namespace :theme do
    task :list do
    end

    task :install do
    end

    task :remove do
    end
  end
end

Rake::Task["db:migrate"].enhance do
  Rake::Task["kopal:update"].invoke
end
<commit_msg>Some more concept tasks.<commit_after>namespace :kopal do
  desc "Creates/upgrades the database for Kopal. Called automatically with db:migrate."
  task :update => :environment do
    Rake::Task["gems:install"].invoke #Check gem dependencies and install/upgrade them.
    Kopal::Database.migrate
  end

  #desc "Fetches new release from Internet, then updates the plugin."
  task :upgrade => :environment do
    #TODO: Fetch the latest version number from Inernet, download and install it if necessary.
    Rake::Task["kopal:update"].invoke
  end

  #desc "Removes kopal specific tables from the database."
  task :clear_database do
  end

  #desc "Always call with \"--silent\" option. Backup the database in XML format." +
  #  "Example: rake --silent kopal:backup > kopal_backup.xml"
  task :backup do
    Kopal::Database.backup
  end

  task :restore do
    Kopal::Database.restore
  end

  #desc "Revives the database. Clears out all deprecations and errors if any."
  task :revive do
    #Backup the database. (Including password, so not like Kopal::Database.backup).
    #Clear the database.
    #Restore the database.
  end

  #LATER: This should be a hidden task, shouldn't be available in the list.
  #desc "Changes prefix of the kopal tables for a given database. Pass old prefix as argument. Reads new prefix from kopal.databse.yml"
  task :change_prefix do
  end

  #TODO: To-implement.
  namespace :theme do
    task :list do
    end

    task :install do
    end

    task :remove do
    end
  end
end

Rake::Task["db:migrate"].enhance do
  Rake::Task["kopal:update"].invoke
end

{'fraction_non_alphanumeric': 0.08852570650323459, 'fraction_numerical': 0.0, 'mean_word_length': 3.492354740061162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '200806', 'n_tokens_mistral': 937, 'n_tokens_neox': 883, 'n_words': 346}