<commit_before>require_relative '../helpers/utils'

begin
  Capistrano::Configuration.instance.load do
    namespace :debot do
      desc "Install everything onto the server"
      task :install do
        run "#{sudo} apt-get -y update"
        run "#{sudo} apt-get -y install python-software-properties"
      end

      desc "Remove application from server"
      task :takedown do
        run "#{sudo} rm /etc/init.d/unicorn_#{domain}"
        run "#{sudo} rm /etc/nginx/sites-enabled/#{domain}"
        run "cd #{app_parent_directory}/#{domain}/ && #{sudo} rm -r *"
        run %Q{#{sudo} -u postgres psql -c "drop database #{postgresql_database};"}
        run %Q{#{sudo} -u postgres psql -c "drop role #{postgresql_user};"}
      end
      before "debot:takedown","unicorn:stop"
      after "debot:takedown", "nginx:restart"
    end

    namespace :go do
      desc "Switch to maintenance page and move routes file"
      task :down do
        run "mv #{current_path}/config/routes.rb #{current_path}/config/routes_down.rb"
        template "redirect_controller.rb.erb", "#{current_path}/app/controllers/redirect_controller.rb"
        template "routes.rb.erb", "#{current_path}/config/routes.rb"
        run "mv #{current_path}/public/index_live.html #{current_path}/public/index.html"
      end
      after "go:down", "debot:restart"

      desc "Switch to live content and re-instate routes file"
      task :live do
        run "rm #{current_path}/config/routes.rb #{current_path}/app/controllers/redirect_controller.rb"
        run "mv #{current_path}/config/routes_down.rb #{current_path}/config/routes.rb"
        run "mv #{current_path}/public/index.html #{current_path}/public/index_live.html"
      end
      after "go:live", "debot:restart"
    end
  end

rescue
end<commit_msg>Avoid conflict with redirect controller<commit_after>require_relative '../helpers/utils'

begin
  Capistrano::Configuration.instance.load do
    namespace :debot do
      desc "Install everything onto the server"
      task :install do
        run "#{sudo} apt-get -y update"
        run "#{sudo} apt-get -y install python-software-properties"
      end

      desc "Remove application from server"
      task :takedown do
        run "#{sudo} rm /etc/init.d/unicorn_#{domain}"
        run "#{sudo} rm /etc/nginx/sites-enabled/#{domain}"
        run "cd #{app_parent_directory}/#{domain}/ && #{sudo} rm -r *"
        run %Q{#{sudo} -u postgres psql -c "drop database #{postgresql_database};"}
        run %Q{#{sudo} -u postgres psql -c "drop role #{postgresql_user};"}
      end
      before "debot:takedown","unicorn:stop"
      after "debot:takedown", "nginx:restart"
    end

    namespace :go do
      desc "Switch to maintenance page and move routes file"
      task :down do
        run "mv #{current_path}/config/routes.rb #{current_path}/config/routes_down.rb"
        template "redirect_controller.rb.erb", "#{current_path}/app/controllers/redirect_controller.rb"
        template "routes.rb.erb", "#{current_path}/config/routes.rb"
        run "mv #{current_path}/public/index_live.html #{current_path}/public/index.html"
      end
      after "go:down", "debot:restart"

      desc "Switch to live content and re-instate routes file"
      task :live do
#        run "rm #{current_path}/config/routes.rb #{current_path}/app/controllers/redirect_controller.rb"
 #       run "mv #{current_path}/config/routes_down.rb #{current_path}/config/routes.rb"
        run "mv #{current_path}/public/index.html #{current_path}/public/index_live.html"
      end
      after "go:live", "debot:restart"
    end
  end

rescue
end
{'fraction_non_alphanumeric': 0.13314917127071824, 'fraction_numerical': 0.0, 'mean_word_length': 3.036789297658863, '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': '7287813', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1149, 'n_words': 285}