<commit_before>require 'SUPPORT'
require 'awesome_print'

namespace :support do
  desc "Test server connectivity"
  task :test, :server_name, :user_role do |t, args|
    args.with_defaults(:server_name => "primary",:user_role => "install")
    server = SUPPORT::Server.new(args[:server_name],args[:user_role])
    begin
      response = server.exec{ "uname -a" }
      ap response.stdout
    rescue => e
      raise e
    end
  end

  desc "Initialize a new SUPPORT Server"
  task :setup, :server_name, :user_role do |t, args|
    args.with_defaults(:server_name => "primary",:user_role => "install")
    server = SUPPORT::Server.new(args[:server_name],args[:user_role])
    puts "[#{server.hostname}]"
    puts "  Copying SSH Key..."
    response = server.scp_pubkey
    if response.success == true
      puts "  >> SSH Key successfully uploaded."
    else
      puts "  >> There was an error uploading your SSH Key."
      raise ap response
    end
  end
end<commit_msg>Refactor rake tasks to use new user setup<commit_after>require 'SUPPORT'
require 'awesome_print'

namespace :support do
  desc "Test server connectivity"
  task :test, :server_name, :user_role do |t, args|
    args.with_defaults(:server_name => "primary",:user_role => "install")
    server = SUPPORT::Server.new(args[:server_name])
    server.current_user = args[:user_role]
    begin
      response = server.exec{ "uname -a" }
      ap response.stdout
    rescue => e
      raise e
    end
  end

  desc "Initialize a new SUPPORT Server"
  task :setup, :server_name, :user_role do |t, args|
    args.with_defaults(:server_name => "primary",:user_role => "install")
    server = SUPPORT::Server.new(args[:server_name])
    server.current_user = args[:user_role]
    puts "[#{server.hostname}]"
    puts "  Copying SSH Key..."
    response = server.scp_pubkey
    if response.success == true
      puts "  >> SSH Key successfully uploaded."
    else
      puts "  >> There was an error uploading your SSH Key."
      raise ap response
    end
  end
end
{'fraction_non_alphanumeric': 0.11956521739130435, 'fraction_numerical': 0.0, 'mean_word_length': 3.3454935622317596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '6918929', 'n_tokens_mistral': 644, 'n_tokens_neox': 639, 'n_words': 182}