<commit_before>require 'active_support/core_ext/object/blank'
require 'capistrano/monkey_patches/fix_capture_conflict'
require 'capistrano/ext/helpers'
require 'capistrano/ext/git'
require 'capistrano/ext/custom_colors'
require 'capistrano/ext/decouple_from_rails'
require 'capistrano/ext/contao_assets'
require 'capistrano/ext/database'
require 'capistrano/ext/server'
require 'capistrano/ext/deploy'

unless Capistrano::Configuration.respond_to?(:instance)
  abort 'capistrano/ext/contao requires capistrano 2'
end

Capistrano::Configuration.instance(:must_exist).load do
  namespace :contao do
    desc '[internal] Setup contao'
    task :setup, :roles => :app, :except => { :no_release => true } do
      # Empty task, the rest should hook to it
    end

    desc '[internal] Setup contao shared contents'
    task :setup_shared_folder, :roles => :app, :except => { :no_release => true } do
      shared_path = fetch :shared_path
      run <<-CMD
        #{try_sudo} mkdir -p #{shared_path}/logs &&
        #{try_sudo} mkdir -p #{shared_path}/config
      CMD

      # TODO: The deny access should follow denied_access config
      deny_htaccess = "order deny,allow\n"
      deny_htaccess << "deny from all"

      put deny_htaccess, "#{shared_path}/logs/.htaccess"<commit_msg>Set Rails environment to production whenever we are deploying<commit_after>require 'active_support/core_ext/object/blank'
require 'capistrano/monkey_patches/fix_capture_conflict'
require 'capistrano/ext/helpers'
require 'capistrano/ext/git'
require 'capistrano/ext/custom_colors'
require 'capistrano/ext/decouple_from_rails'
require 'capistrano/ext/contao_assets'
require 'capistrano/ext/database'
require 'capistrano/ext/server'
require 'capistrano/ext/deploy'

unless Capistrano::Configuration.respond_to?(:instance)
  abort 'capistrano/ext/contao requires capistrano 2'
end

Capistrano::Configuration.instance(:must_exist).load do
  Rails.env = 'production'

  namespace :contao do
    desc '[internal] Setup contao'
    task :setup, :roles => :app, :except => { :no_release => true } do
      # Empty task, the rest should hook to it
    end

    desc '[internal] Setup contao shared contents'
    task :setup_shared_folder, :roles => :app, :except => { :no_release => true } do
      shared_path = fetch :shared_path
      run <<-CMD
        #{try_sudo} mkdir -p #{shared_path}/logs &&
        #{try_sudo} mkdir -p #{shared_path}/config
      CMD

      # TODO: The deny access should follow denied_access config
      deny_htaccess = "order deny,allow\n"
      deny_htaccess << "deny from all"

      put deny_htaccess, "#{shared_path}/logs/.htaccess"
{'fraction_non_alphanumeric': 0.11220621683093253, 'fraction_numerical': 0.000758150113722517, 'mean_word_length': 4.256972111553785, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '5421692', 'n_tokens_mistral': 864, 'n_tokens_neox': 850, 'n_words': 209}