<commit_before>require 'erb'

set :deploy_status_template, "public/deployment_status.html"

namespace :deploy do
  desc 'Create deployment status page'
  task :status_page do
    unless release_path
      warn("This task is meant to be run with a full deployment")
    end

    application = fetch(:application, 'unknown')
    branch = fetch(:branch, 'unknown')
    real_revision = fetch(:current_revision, 'unknown')
    release_timestamp = fetch(:release_timestamp, 'unknown')
    deployed_by = fetch(:deployed_by, ENV['USER'])

    result = StringIO.new(ERB.new(template).result(binding))
    output_path = "#{release_path}/#{fetch(:deploy_status_template)}"
    on roles(:app) do
      upload! result, output_path
      execute :chmod, '644', output_path
    end
  end
end
after "deploy:published", "deploy:status_page"

def template
  input_path = File.join(File.dirname(__FILE__), "../deployment_status/view.html.erb")
  File.read(input_path)
end<commit_msg>move destination variable into load:defualts<commit_after>require 'erb'

namespace :deploy do
  desc 'Create deployment status page'
  task :status_page do
    unless release_path
      warn("This task is meant to be run with a full deployment")
    end

    application = fetch(:application, 'unknown')
    branch = fetch(:branch, 'unknown')
    real_revision = fetch(:current_revision, 'unknown')
    release_timestamp = fetch(:release_timestamp, 'unknown')
    deployed_by = fetch(:deployed_by, ENV['USER'])

    result = StringIO.new(ERB.new(template).result(binding))
    output_path = "#{release_path}/#{fetch(:deploy_status_template)}"
    on roles(:app) do
      upload! result, output_path
      execute :chmod, '644', output_path
    end
  end
end
after "deploy:published", "deploy:status_page"

namespace :load do
  task :defaults do
    set :deploy_status_template, "public/deployment_status.html"
  end
end

def template
  input_path = File.join(File.dirname(__FILE__), "../deployment_status/view.html.erb")
  File.read(input_path)
end
{'fraction_non_alphanumeric': 0.11580516898608349, 'fraction_numerical': 0.002982107355864811, 'mean_word_length': 4.545454545454546, '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': '2356362', 'n_tokens_mistral': 630, 'n_tokens_neox': 615, 'n_words': 155}