<commit_before>require 'net/ssh'
require 'ostruct'

class Deploy < OpenStruct
  def initialize
    super
    @ssh_sessions = {}
    self.branch = BRANCH
    self.rails_env = DEPLOY_RAILS_ENV
    self.shared = %w(/tmp /log /public/system)
    self.user   = `who am i`.split(' ').first
    self.rake_deploy_path = `pwd`.strip

    self.deploy_to = DEPLOY_TO
    self.git_repo = GIT_REPO
    self.git_assets_repo  GIT_ASSETS_REPO
    self.sudo = DEPLOY_SUDO
    self.release_name ||= Time.now.utc.strftime("%Y%m%d%H%M%S")
    self.release_path ||= "#{self.deploy_to}/releases/#{self.release_name}"
    self.current_path ||= "#{self.deploy_to}/current"
    self.share_path   ||= "#{self.deploy_to}/share"
  end
  
  # Run a command in a remote server:
  # run("ls") Run ls in current deploy.host
  # run("my_host.com", "ls") run ls in "my_host.com"
  # run("my_host.com", "guillermo", "ls") run ls in "my_shot.com" as user "guillermo"
  def run(*args)
    case args.size
    when 3<commit_msg>Change rakefile from variables to constants<commit_after>require 'net/ssh'
require 'ostruct'

class Deploy < OpenStruct
  def initialize
    super
    @ssh_sessions = {}
    self.branch = BRANCH
    self.rails_env = DEPLOY_RAILS_ENV
    self.shared = %w(/tmp /log /public/system)
    self.user   = `who am i`.split(' ').first
    self.rake_deploy_path = `pwd`.strip

    self.deploy_to = DEPLOY_TO
    self.git_repo = GIT_REPO
    self.git_assets_repo = GIT_ASSETS_REPO
    self.sudo = DEPLOY_SUDO
    self.release_name ||= Time.now.utc.strftime("%Y%m%d%H%M%S")
    self.release_path ||= "#{self.deploy_to}/releases/#{self.release_name}"
    self.current_path ||= "#{self.deploy_to}/current"
    self.share_path   ||= "#{self.deploy_to}/share"
  end
  
  # Run a command in a remote server:
  # run("ls") Run ls in current deploy.host
  # run("my_host.com", "ls") run ls in "my_host.com"
  # run("my_host.com", "guillermo", "ls") run ls in "my_shot.com" as user "guillermo"
  def run(*args)
    case args.size
    when 3
{'fraction_non_alphanumeric': 0.14385266301642607, 'fraction_numerical': 0.0009955201592832255, 'mean_word_length': 3.388646288209607, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5970175', 'n_tokens_mistral': 806, 'n_tokens_neox': 763, 'n_words': 160}