<commit_before>require 'rake/remote_task'

namespace :sooty do
  
  remote_task :setup do
    run setup_puppet_repo_cmd
    run install_puppet_cmd
  end

  remote_task :apply do
    sh create_puppet_archive_cmd
    rsync '/tmp/puppet.tar.gz', '/tmp'
    run puppet_apply_cmd
  end

  def setup_puppet_repo_cmd
    deb_file = 'puppetlabs-release_1.0-3_all.deb'
    
    repo_cmd = [
      "wget http://apt.puppetlabs.com/#{deb_file}",
      "sudo dpkg -i #{deb_file}", 
      "rm #{deb_file}"
    ].join(' && ')

    "test -f /etc/apt/sources.list.d/puppetlabs.list || { #{repo_cmd}; }"
  end

  def install_puppet_cmd
    install_cmd = [
      'sudo apt-get update',
      'sudo aptitude install -y puppet'
    ].join(' && ')

    "which puppet || { #{install_cmd}; }"
  end

  def create_puppet_archive_cmd
    cmds = [
      'rm -rf /tmp/puppet',
      'mkdir /tmp/puppet',
      "cp #{puppet_manifest} /tmp/puppet/manifest.pp"
    ]

    if defined? puppet_modules
      cmds += ["cp -r #{puppet_modules} /tmp/puppet/modules"]
    end
<commit_msg>Change deb to one that exists<commit_after>require 'rake/remote_task'

namespace :sooty do
  
  remote_task :setup do
    run setup_puppet_repo_cmd
    run install_puppet_cmd
  end

  remote_task :apply do
    sh create_puppet_archive_cmd
    rsync '/tmp/puppet.tar.gz', '/tmp'
    run puppet_apply_cmd
  end

  def setup_puppet_repo_cmd
    deb_file = 'puppetlabs-release-stable.deb'
    
    repo_cmd = [
      "wget http://apt.puppetlabs.com/#{deb_file}",
      "sudo dpkg -i #{deb_file}", 
      "rm #{deb_file}"
    ].join(' && ')

    "test -f /etc/apt/sources.list.d/puppetlabs.list || { #{repo_cmd}; }"
  end

  def install_puppet_cmd
    install_cmd = [
      'sudo apt-get update',
      'sudo aptitude install -y puppet'
    ].join(' && ')

    "which puppet || { #{install_cmd}; }"
  end

  def create_puppet_archive_cmd
    cmds = [
      'rm -rf /tmp/puppet',
      'mkdir /tmp/puppet',
      "cp #{puppet_manifest} /tmp/puppet/manifest.pp"
    ]

    if defined? puppet_modules
      cmds += ["cp -r #{puppet_modules} /tmp/puppet/modules"]
    end

{'fraction_non_alphanumeric': 0.13393279697113109, 'fraction_numerical': 0.001419782300047326, 'mean_word_length': 2.5891341256366722, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2790819', 'n_tokens_mistral': 856, 'n_tokens_neox': 813, 'n_words': 163}