<commit_before>require 'capistrano/ext/multistage'
require "bundler/capistrano"

after "deploy:update_code", "deploy:symlink_configs"
after "deploy:update_code", "deploy:package_assets"

after "deploy",             "deploy:cleanup"
after "deploy:migrations",  "deploy:cleanup"

namespace :passenger do
  desc "Restart Application"
  task :restart, :roles => :app do
    run <<-CMD
      touch #{current_path}/tmp/restart.txt
    CMD
  end
end

namespace :deploy do
  %w(start restart).each do |name|
    task name, :roles => :app do
      passenger.restart
    end
  end
  
  task :compile_sass, :roles => :app, :except => {:no_release => true} do
    rails_env = fetch(:rails_env, "production")
    run "#{release_path}/script/rails runner -e #{rails_env} 'Sass::Plugin.update_stylesheets'"
  end
  
  task :package_assets, :depends => ["deploy:compile_sass"], :roles => :app, :except => {:no_release => true} do
    bundle_cmd = fetch(:bundle_cmd)
    run "cd #{release_path} && #{bundle_cmd} exec jammit -f"
  end

  task :symlink_configs, :roles => :app, :except => {:no_release => true} do
    run <<-CMD
      cd #{release_path} &&
      ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml &&
      ln -nfs #{shared_path}/config/config.yml #{release_path}/config/config.yml
    CMD
  end
end

set :stages, %w(staging production)
set :default_stage, "staging"

# NOTE: As of Capistrano 2.1, anyone using Windows should allocate a PTY explicitly.
# Otherwise, you will see command prompts (such as requests for SVN passwords) act funny.
default_run_options[:pty] = true<commit_msg>Seems like dependency is not working...<commit_after>require 'capistrano/ext/multistage'
require "bundler/capistrano"

after "deploy:update_code", "deploy:symlink_configs"
after "deploy:update_code", "deploy:compile_sass"
after "deploy:update_code", "deploy:package_assets"

after "deploy",             "deploy:cleanup"
after "deploy:migrations",  "deploy:cleanup"

namespace :passenger do
  desc "Restart Application"
  task :restart, :roles => :app do
    run <<-CMD
      touch #{current_path}/tmp/restart.txt
    CMD
  end
end

namespace :deploy do
  %w(start restart).each do |name|
    task name, :roles => :app do
      passenger.restart
    end
  end
  
  task :compile_sass, :roles => :app, :except => {:no_release => true} do
    rails_env = fetch(:rails_env, "production")
    run "#{release_path}/script/rails runner -e #{rails_env} 'Sass::Plugin.update_stylesheets'"
  end
  
  task :package_assets, :roles => :app, :except => {:no_release => true} do
    bundle_cmd = fetch(:bundle_cmd)
    run "cd #{release_path} && #{bundle_cmd} exec jammit -f"
  end

  task :symlink_configs, :roles => :app, :except => {:no_release => true} do
    run <<-CMD
      cd #{release_path} &&
      ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml &&
      ln -nfs #{shared_path}/config/config.yml #{release_path}/config/config.yml
    CMD
  end
end

set :stages, %w(staging production)
set :default_stage, "staging"

# NOTE: As of Capistrano 2.1, anyone using Windows should allocate a PTY explicitly.
# Otherwise, you will see command prompts (such as requests for SVN passwords) act funny.
default_run_options[:pty] = true
{'fraction_non_alphanumeric': 0.13453876800490347, 'fraction_numerical': 0.001225865767698437, 'mean_word_length': 4.107981220657277, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, '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': '2831441', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1080, 'n_words': 297}