<commit_before>namespace :vlad do
  def check_usage(site)
    if (site.nil? || site.size == 0)
      puts "Usage: rake vlad:custom:setup[<domain-key>]\n  e.g. rake vlad:custom:setup[www]"
      puts "       rake vlad:deploy[<domain-key>]\n  e.g. rake vlad:deploy[www]"
      exit(-1)
    end
  end

  def require_site(site)
    check_usage(site)

    set :domain, @domain_map[site]
    set :rails_env, site
  end

  def custom_release(branch)
    if (branch.nil? || branch.size == 0)
      set :branch, 'master'
    else
      set :branch, branch
    end

    set :release_name, release_name + "_" + branch
  end

  remote_task "seed" do
    run "cd #{current_path} && rake RAILS_ENV=#{rails_env} db:seed"
  end

  remote_task "symlink_database_yml" do
    file = "database.yml"
    run "ln -s #{shared_path}/config/#{file} #{release_path}/config/#{file}"
  end

  remote_task :set_perms do
    begin
      run [ "sudo find #{release_path} -type f -exec chmod #{file_chmod_to} {} \\;",
            "sudo find #{release_path} -type d -exec chmod #{dir_chmod_to} {} \\;",
            "sudo chown -R #{chown_to} #{release_path}"].join(" && ")
    rescue => e
      raise e
    end
  end

  task :bundle do
    if (application.size <= 0)
      puts "You must set the application name."
      exit(-1)
    end

    unless (local_repo_git_path.nil?)<commit_msg>fix for prior fixes that were based on erroneous error report<commit_after>namespace :vlad do
  def check_usage(site)
    if (site.nil? || site.size == 0)
      puts "Usage: rake vlad:custom:setup[<domain-key>]\n  e.g. rake vlad:custom:setup[www]"
      puts "       rake vlad:deploy[<domain-key>]\n  e.g. rake vlad:deploy[www]"
      exit(-1)
    end
  end

  def require_site(site)
    check_usage(site)

    set :domain, @domain_map[site]
    set :rails_env, site
  end

  def custom_release(branch)
    if (branch.nil? || branch.size == 0)
      set :branch, 'master'
    else
      set :branch, branch
    end

    set :release_name, release_name + "_" + branch
  end

  remote_task "seed" do
    run "cd #{current_path} && rake RAILS_ENV=#{rails_env} db:seed"
  end

  remote_task "symlink_database_yml" do
    file = "database.yml"
    run "ln -s #{shared_path}/config/#{file} #{release_path}/config/#{file}"
  end

  remote_task :set_perms do
    begin
      run [ "sudo find #{release_path} -type f -exec chmod #{file_chmod_to} {} \\;",
            "sudo find #{release_path} -type d -exec chmod #{dir_chmod_to} {} \\;",
            "sudo chown -R #{chown_to} #{release_path}"].join(" && ")
    rescue => e
      raise e
    end
  end

  task :bundle do
    if (application.size <= 0)
      puts "You must set the application name."
      exit(-1)
    end

    if (!local_repo_git_path.nil? && local_repo_git_path.size > 0)
{'fraction_non_alphanumeric': 0.13885898815931108, 'fraction_numerical': 0.003946896304269824, 'mean_word_length': 2.7074468085106385, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '70140', 'n_tokens_mistral': 1036, 'n_tokens_neox': 995, 'n_words': 259}