<commit_before># Copyright 2006-2008 by <NAME>. All rights reserved.
Capistrano::Configuration.instance(:must_exist).load do 

  set :database_yml_in_scm, true
  set :app_symlinks, nil
  set :rails_env, 'production'
  set :gems_for_project, nil # Array of gems to be installed for app
  set :shared_dirs, nil # Array of directories that should be created under shared/
                        # and linked to in the project

  # Hook into the default capistrano deploy tasks
  before 'deploy:setup', :except => { :no_release => true } do
    top.deprec.rails.setup_user_perms
    top.deprec.rails.setup_paths
    top.deprec.rails.setup_shared_dirs
    top.deprec.rails.install_gems_for_project
  end
  
  # Override default cap task using sudo to create dir
  namespace :deploy do
    task :setup, :except => { :no_release => true } do
      dirs = [deploy_to, releases_path, shared_path]
      dirs += %w(system log pids).map { |d| File.join(shared_path, d) }
      sudo "sh -c 'umask 02 && mkdir -p #{dirs.join(' ')}'"
    end
  end

  after 'deploy:setup', :except => { :no_release => true } do
    top.deprec.rails.setup_servers
    top.deprec.rails.create_config_dir
  end

  after 'deploy:symlink', :roles => :app do
    top.deprec.rails.symlink_shared_dirs
    top.deprec.rails.symlink_database_yml unless database_yml_in_scm
    top.deprec.mongrel.set_perms_for_mongrel_dirs
  end

  after :deploy, :roles => :app do
    deploy.cleanup
  end

  # redefine the reaper
  namespace :deploy do
    task :restart do
      top.deprec.mongrel.restart
      top.deprec.nginx.restart
    end
  end


  PROJECT_CONFIG_FILES[:nginx] = [

    {:template => 'rails_nginx_vhost.conf.erb',
      :path => "rails_nginx_vhost.conf", 
      :mode => 0644,
      :owner => 'root:root'}
    ]

  namespace :deprec do
    namespace :rails do

      task :install, :roles => :app do
        install_deps
        install_gems
      end

      task :install_deps do
        apt.install( {:base => %w(libmysqlclient15-dev sqlite3 libsqlite3-ruby libsqlite3-dev)}, :stable )
      end

      # install some required ruby gems
      task :install_gems do
        gem2.install 'sqlite3-ruby'
        gem2.install 'mysql'
        gem2.install 'rails'
        gem2.install 'rspec' # seems to be required to run rake db:migrate (???)
        # gem2.install 'builder' # XXX ? needed ?
      end
      
      task :install_gems_for_project do
          if gems_for_project
            gems_for_project.each { |gem| gem2.install(gem) }
          end
      end

      task :config_gen do
        PROJECT_CONFIG_FILES[:nginx].each do |file|
          deprec2.render_template(:nginx, file)
        end
        top.deprec.mongrel.config_gen_project
      end

      task :config, :roles => [:app, :web] do
        deprec2.push_configs(:nginx, PROJECT_CONFIG_FILES[:nginx])
        deprec2.push_configs(:monit, PROJECT_CONFIG_FILES[:monit])
        top.deprec.mongrel.config_project
        symlink_nginx_vhost
        symlink_monit_config
      end

      task :symlink_nginx_vhost, :roles => :web do
        sudo "ln -sf #{deploy_to}/nginx/rails_nginx_vhost.conf #{nginx_vhost_dir}/#{application}.conf"<commit_msg>added logrotate<commit_after># Copyright 2006-2008 by <NAME>. All rights reserved.
Capistrano::Configuration.instance(:must_exist).load do 

  set :database_yml_in_scm, true
  set :app_symlinks, nil
  set :rails_env, 'production'
  set :gems_for_project, nil # Array of gems to be installed for app
  set :shared_dirs, nil # Array of directories that should be created under shared/
                        # and linked to in the project

  # Hook into the default capistrano deploy tasks
  before 'deploy:setup', :except => { :no_release => true } do
    top.deprec.rails.setup_user_perms
    top.deprec.rails.setup_paths
    top.deprec.rails.setup_shared_dirs
    top.deprec.rails.install_gems_for_project
  end
  
  # Override default cap task using sudo to create dir
  namespace :deploy do
    task :setup, :except => { :no_release => true } do
      dirs = [deploy_to, releases_path, shared_path]
      dirs += %w(system log pids).map { |d| File.join(shared_path, d) }
      sudo "sh -c 'umask 02 && mkdir -p #{dirs.join(' ')}'"
    end
  end

  after 'deploy:setup', :except => { :no_release => true } do
    top.deprec.rails.setup_servers
    top.deprec.rails.create_config_dir
  end

  after 'deploy:symlink', :roles => :app do
    top.deprec.rails.symlink_shared_dirs
    top.deprec.rails.symlink_database_yml unless database_yml_in_scm
    top.deprec.mongrel.set_perms_for_mongrel_dirs
  end

  after :deploy, :roles => :app do
    deploy.cleanup
  end

  # redefine the reaper
  namespace :deploy do
    task :restart do
      top.deprec.mongrel.restart
      top.deprec.nginx.restart
    end
  end


  PROJECT_CONFIG_FILES[:nginx] = [

    {:template => 'rails_nginx_vhost.conf.erb',
      :path => "rails_nginx_vhost.conf", 
      :mode => 0644,
      :owner => 'root:root'},
      
    {:template => 'logrotate.erb',
      :path => "logrotate.conf", 
      :mode => 0644,
      :owner => 'root:root'}
      
    ]

  namespace :deprec do
    namespace :rails do

      task :install, :roles => :app do
        install_deps
        install_gems
      end

      task :install_deps do
        apt.install( {:base => %w(libmysqlclient15-dev sqlite3 libsqlite3-ruby libsqlite3-dev)}, :stable )
      end

      # install some required ruby gems
      task :install_gems do
        gem2.install 'sqlite3-ruby'
        gem2.install 'mysql'
        gem2.install 'rails'
        gem2.install 'rspec' # seems to be required to run rake db:migrate (???)
        # gem2.install 'builder' # XXX ? needed ?
      end
      
      task :install_gems_for_project do
          if gems_for_project
            gems_for_project.each { |gem| gem2.install(gem) }
          end
      end

      task :config_gen do
        PROJECT_CONFIG_FILES[:nginx].each do |file|
          deprec2.render_template(:nginx, file)
        end
        top.deprec.mongrel.config_gen_project
      end

      task :config, :roles => [:app, :web] do
        deprec2.push_configs(:nginx, PROJECT_CONFIG_FILES[:nginx])
        top.deprec.mongrel.config_project
        symlink_nginx_vhost
        symlink_logrotate_config
      end

      task :symlink_nginx_vhost, :roles => :web do
        sudo "ln -sf #{deploy_to}/nginx/rails_nginx_vhost.conf #{nginx_vhost_dir}/#{application}.conf"
      end
      
      task :symlink_logrotate_config, :roles => :web do
        sudo "ln -sf #{deploy_to}/nginx/logrotate.conf /etc/logrotate.d/nginx-#{application}"
{'fraction_non_alphanumeric': 0.10257186081694403, 'fraction_numerical': 0.009228441754916793, 'mean_word_length': 2.697427293064877, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '5080256', 'n_tokens_mistral': 2349, 'n_tokens_neox': 2192, 'n_words': 523}