<commit_before>namespace :magerun do
  desc <<-DESC
    Installs n98-magerun.phar to the shared directory
    In order to use the .phar file, the magerun command needs to be mapped:
      SSHKit.config.command_map[:magerun] = "\#{shared_path.join('n98-magerun.phar')}"
    This is best used before deploy:starting:
      namespace :deploy do
        after :starting, 'magerun:install'
      end
  DESC
  task :install do
    on roles fetch(:magerun_roles) do
      within shared_path do
        unless test '[', '-e', 'n98-magerun.phar', ']'
          execute :curl, '--insecure', '-s', '-o', 'n98-magerun.phar', '-L', fetch(:magerun_download_url)
          execute :chmod, '+x', 'n98-magerun.phar'
        end
      end
    end
  end

  task :run, :command do |t, args|
    args.with_defaults(:command => :list)
    on roles fetch(:magerun_roles) do
      within fetch(:magerun_rootdir) do
        execute :'n98-magerun.phar', args[:command], *args.extras
      end
    end
  end

  desc 'Run the self-update command for n98-magerun.phar'
  task :self_update do
    invoke 'magerun:run', :selfupdate
  end

end

namespace :load do
  task :defaults do

    set :magerun_roles, :all
    set :magerun_download_url, 'https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'
    set :magerun_rootdir, ->{"#{release_path}"}<commit_msg>No need to quote release_path in a string<commit_after>namespace :magerun do
  desc <<-DESC
    Installs n98-magerun.phar to the shared directory
    In order to use the .phar file, the magerun command needs to be mapped:
      SSHKit.config.command_map[:magerun] = "\#{shared_path.join('n98-magerun.phar')}"
    This is best used before deploy:starting:
      namespace :deploy do
        after :starting, 'magerun:install'
      end
  DESC
  task :install do
    on roles fetch(:magerun_roles) do
      within shared_path do
        unless test '[', '-e', 'n98-magerun.phar', ']'
          execute :curl, '--insecure', '-s', '-o', 'n98-magerun.phar', '-L', fetch(:magerun_download_url)
          execute :chmod, '+x', 'n98-magerun.phar'
        end
      end
    end
  end

  task :run, :command do |t, args|
    args.with_defaults(:command => :list)
    on roles fetch(:magerun_roles) do
      within fetch(:magerun_rootdir) do
        execute :'n98-magerun.phar', args[:command], *args.extras
      end
    end
  end

  desc 'Run the self-update command for n98-magerun.phar'
  task :self_update do
    invoke 'magerun:run', :selfupdate
  end

end

namespace :load do
  task :defaults do

    set :magerun_roles, :all
    set :magerun_download_url, 'https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'
    set :magerun_rootdir, ->{release_path}
{'fraction_non_alphanumeric': 0.12393636699963004, 'fraction_numerical': 0.014798372179060304, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3926631', 'n_tokens_mistral': 1002, 'n_tokens_neox': 966, 'n_words': 252}