<commit_before>=begin rdoc
  The connection to the messenger from poolparty, the client
=end
module PoolParty
  module Messenger
    
    # TODO: Fix cookie setting
    def self.erl_command(hostname, extra="")
      command_line_opts = "-pa #{append_dir}/ebin -kernel inet_dist_listen_min 7000 inet_dist_listen_max 7050 -sname #{hostname} -setcookie poolparty"
      
      "erl #{command_line_opts} #{extra} 2>&1"
    end
    
    def self.append_dir
      ::File.expand_path(::File.join( ::File.dirname(__FILE__), "..", "..", "erlang/messenger" ))
    end
    
    def self.messenger_send!(cmd="", testing=false)
      command = Messenger.erl_command("client#{Time.now.to_i}", "-hidden -s pm_client -run pm_client #{cmd} -s erlang halt -noshell")
      testing ? command : %x[#{command}]
    end
    
    # Helper methods
    def self.startup_remote_messenger(hostname, testing=false)
      messenger_send!("")
      testing ? command : %x[#{command}]
    end
    
  end<commit_msg>Updated messenger<commit_after>=begin rdoc
  The connection to the messenger from poolparty, the client
=end
module PoolParty
  def reconfigure_cloud!
    Messenger.messenger_send!("reconfigure_cloud")
  end
  module Messenger
    
    # TODO: Fix cookie setting
    def self.erl_command(hostname, extra="")
      command_line_opts = "-pa #{append_dir}/ebin -kernel inet_dist_listen_min 7000 inet_dist_listen_max 7050 -sname #{hostname} -setcookie poolparty"
      
      "erl #{command_line_opts} #{extra} 2>&1"
    end
    
    def self.append_dir
      ::File.expand_path(::File.join( ::File.dirname(__FILE__), "..", "..", "erlang/messenger" ))
    end
    
    def self.messenger_send!(cmd="", testing=false)
      command = Messenger.erl_command("client#{Time.now.to_i}", "-hidden -s pm_client -run pm_client #{cmd} -s erlang halt -noshell")
      testing ? command : %x[#{command}]
    end
    
    # Helper methods
    def self.startup_remote_messenger(hostname, testing=false)
      # messenger_send!("")
      # testing ? command : %x[#{command}]
    end
    
  end
{'fraction_non_alphanumeric': 0.12779397473275025, 'fraction_numerical': 0.009718172983479106, 'mean_word_length': 3.298538622129436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '752569', 'n_tokens_mistral': 696, 'n_tokens_neox': 669, 'n_words': 156}