<commit_before>require 'redis'
require 'logger'
require 'active_support/core_ext/module'
require 'yaml'

require_relative 'ratoap/version'
require_relative 'ratoap/configuration'
require_relative 'ratoap/redis_script'

module Ratoap

  mattr_accessor :logger
  mattr_accessor :redis

  self.logger = Logger.new(STDOUT)

  def self.load
    Configurtion.load_and_override

    self.redis = config.redis_proc.call

    RedisScript.load

  end

  def self.run_test
    require "ratoap-driver-vagrant"
    puts RedisScript.data
  end

  def self.config
    Configurtion.config
  end

  def self.configure(&block)
    Configurtion.configure(&block)
  end

end<commit_msg>add open3<commit_after>require 'redis'
require 'logger'
require 'active_support/core_ext/module'
require 'yaml'

require_relative 'ratoap/version'
require_relative 'ratoap/configuration'
require_relative 'ratoap/redis_script'

module Ratoap

  mattr_accessor :logger
  mattr_accessor :redis

  self.logger = Logger.new(STDOUT)

  def self.load
    Configurtion.load_and_override

    self.redis = config.redis_proc.call

    RedisScript.load

  end

  def self.run_test
    require "open3"
    require "ratoap-driver-vagrant"

    Open3.popen3("ratoap-driver-vagrant") do |stdin, stdout, stderr, wait_thr|

      pid = wait_thr.pid

      puts pid

      stdin.close


      stdout.close
      stderr.close

      exit_status = wait_thr.value

      puts exit_status
    end
  end

  def self.config
    Configurtion.config
  end

  def self.configure(&block)
    Configurtion.configure(&block)
  end

end
{'fraction_non_alphanumeric': 0.0789306174411203, 'fraction_numerical': 0.002546148949713558, 'mean_word_length': 3.5565217391304347, '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': '6666247', 'n_tokens_mistral': 572, 'n_tokens_neox': 544, 'n_words': 108}