<commit_before># This recipe contains Capistrano recipes for handling the uploads
# and picture cache files while deploying your application.

require 'fileutils'
require 'alchemy/tasks/helpers'
require 'alchemy/mount_point'

include Alchemy::Tasks::Helpers

::Capistrano::Configuration.instance(:must_exist).load do

  after "deploy:setup", "alchemy:shared_folders:create"
  after "deploy:finalize_update", "alchemy:shared_folders:symlink"
  before "deploy:start", "alchemy:db:seed"

  namespace :alchemy do

    namespace :shared_folders do

      # This task creates the shared folders for uploads, assets and picture cache while setting up your server.
      desc "Creates the uploads and picture cache directory in the shared folder. Called after deploy:setup"
      task :create, :roles => :app do
        run "mkdir -p #{shared_path}/uploads/pictures"
        run "mkdir -p #{shared_path}/uploads/attachments"
        run "mkdir -p #{shared_picture_cache_path}"
        run "mkdir -p #{shared_path}/cache/assets"
      end

      # This task sets the symlinks for uploads, assets and picture cache folder.
      desc "Sets the symlinks for uploads and picture cache folder. Called after deploy:finalize_update"
      task :symlink, :roles => :app do
        run "rm -rf #{release_path}/uploads"
        run "ln -nfs #{shared_path}/uploads #{release_path}/"
        run "mkdir -p #{public_path_with_mountpoint}"
        run "ln -nfs #{shared_picture_cache_path} #{public_path_with_mountpoint('pictures')}"
        run "mkdir -p #{release_path}/tmp/cache"
        run "ln -nfs #{shared_path}/cache/assets #{release_path}/tmp/cache/assets"
      end

      def shared_picture_cache_path
        @shared_picture_cache_path ||= begin
          File.join(shared_path, 'cache', Alchemy::MountPoint.get, 'pictures')
        end
      end

      def public_path_with_mountpoint(suffix = '')<commit_msg>Symlink tmp/cache on deployments<commit_after># This recipe contains Capistrano recipes for handling the uploads
# and picture cache files while deploying your application.

require 'fileutils'
require 'alchemy/tasks/helpers'
require 'alchemy/mount_point'

include Alchemy::Tasks::Helpers

::Capistrano::Configuration.instance(:must_exist).load do

  after "deploy:setup", "alchemy:shared_folders:create"
  after "deploy:finalize_update", "alchemy:shared_folders:symlink"
  before "deploy:start", "alchemy:db:seed"

  namespace :alchemy do

    namespace :shared_folders do

      # This task creates the shared folders for uploads, assets and picture cache while setting up your server.
      desc "Creates the uploads and picture cache directory in the shared folder. Called after deploy:setup"
      task :create, :roles => :app do
        run "mkdir -p #{shared_path}/uploads/pictures"
        run "mkdir -p #{shared_path}/uploads/attachments"
        run "mkdir -p #{shared_picture_cache_path}"
        run "mkdir -p #{shared_path}/cache"
      end

      # This task symlinks the uploads, picture and general cache folder to the new release.
      desc "Sets the symlinks for uploads and picture cache folder. Called after deploy:finalize_update"
      task :symlink, :roles => :app do
        run "rm -rf #{release_path}/uploads"
        run "ln -nfs #{shared_path}/uploads #{release_path}/"
        run "mkdir -p #{public_path_with_mountpoint}"
        run "ln -nfs #{shared_picture_cache_path} #{public_path_with_mountpoint('pictures')}"
        run "ln -nfs #{shared_path}/cache #{release_path}/tmp/cache"
      end

      def shared_picture_cache_path
        @shared_picture_cache_path ||= begin
          File.join(shared_path, 'cache', Alchemy::MountPoint.get, 'pictures')
        end
      end

      def public_path_with_mountpoint(suffix = '')
{'fraction_non_alphanumeric': 0.09893617021276596, 'fraction_numerical': 0.0, 'mean_word_length': 3.6953807740324596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '325485', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1083, 'n_words': 335}