<commit_before>require 'rvm/capistrano'
require 'bundler/capistrano'

set :application, 'genie-compiler'
set :repository,  '<EMAIL>:jimjh/genie-compiler.git'
set :user,        'passenger'

set :scm,        :git
set :deploy_via, :remote_cache
set :use_sudo,   false

set :rvm_ruby_string, 'ruby-1.9.3-p362'
set :rvm_type,        :system

set :app_port, 3300

role :app, 'beta.geniehub.org'

after 'deploy:restart', 'deploy:cleanup'
after 'deploy:setup',   'deploy:upstart'

def with_user(user)
  old_user = user
  set :user, user
  close_sessions
  yield
  set :user, old_user
  close_sessions
end

def close_sessions
  sessions.values.each { |session| session.close }
  sessions.clear
end

# Same as +put+, but use sudo to move the file to a privileged directory.
# @option [String] opts :sudoer      name of user with sudo privileges
def sudo_put(data, path, opts = {})
  sudoer = opts.delete(:sudoer) || user
  filename = File.basename path
  dirname  = File.dirname  path
  temp     = "#{shared_path}/#{filename}"
  put data, temp, opts
  with_user sudoer do
    run "#{sudo} mv #{temp} #{dirname}"
  end
end

namespace :deploy do

  task :start do
    with_user('codex') { run 'sudo service lamp start' }
  end

  task :stop do
    with_user('codex') { run 'sudo service lamp stop' }
  end

  task :restart, :roles => :app, :except => { :no_release => true } do
    with_user('codex') { run 'sudo service lamp restart' }
  end

  task :upstart do
    location = fetch(:template_dir, 'config') + '/lamp.conf'
    template = File.read location
    config   = ERB.new template
    sudo_put config.result(binding), '/etc/init/lamp.conf', sudoer: 'codex'
  end

end
<commit_msg>something changed? now I need to set the shell<commit_after>require 'rvm/capistrano'
require 'bundler/capistrano'

set :application, 'genie-compiler'
set :repository,  '<EMAIL>:jimjh/genie-compiler.git'
set :user,        'passenger'
set :default_shell, '/bin/bash -l'

set :scm,        :git
set :deploy_via, :remote_cache
set :use_sudo,   false

set :rvm_ruby_string, 'ruby-1.9.3-p362'
set :rvm_type,        :system

set :app_port, 3300

role :app, 'beta.geniehub.org'

after 'deploy:restart', 'deploy:cleanup'
after 'deploy:setup',   'deploy:upstart'

def with_user(user)
  old_user = user
  set :user, user
  close_sessions
  yield
  set :user, old_user
  close_sessions
end

def close_sessions
  sessions.values.each { |session| session.close }
  sessions.clear
end

# Same as +put+, but use sudo to move the file to a privileged directory.
# @option [String] opts :sudoer      name of user with sudo privileges
def sudo_put(data, path, opts = {})
  sudoer = opts.delete(:sudoer) || user
  filename = File.basename path
  dirname  = File.dirname  path
  temp     = "#{shared_path}/#{filename}"
  put data, temp, opts
  with_user sudoer do
    run "#{sudo} mv #{temp} #{dirname}"
  end
end

namespace :deploy do

  task :start do
    with_user('codex') { run 'sudo service lamp start' }
  end

  task :stop do
    with_user('codex') { run 'sudo service lamp stop' }
  end

  task :restart, :roles => :app, :except => { :no_release => true } do
    with_user('codex') { run 'sudo service lamp restart' }
  end

  task :upstart do
    location = fetch(:template_dir, 'config') + '/lamp.conf'
    template = File.read location
    config   = ERB.new template
    sudo_put config.result(binding), '/etc/init/lamp.conf', sudoer: 'codex'
  end

end

{'fraction_non_alphanumeric': 0.12390414962010521, 'fraction_numerical': 0.0058445353594389245, 'mean_word_length': 3.638211382113821, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '605998', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1207, 'n_words': 356}