<commit_before>#!/usr/bin/env ruby

require './Tenticle'
require 'yaml'
require 'command_line_reporter'

a = Tenticle::Cups.new(ARGV)  # Create a tenticle and init default options,
                              # check for incoming command line options,
                              # etc. etc.


# This was our stringything in Perl Octypus:
# q(/usr/local/bin/gless) . " " . qq($test $server GE_BROWSER='$brow' GE_PLATFORM='$plat' GE_BROWSER_VERSION='$ver');

#File.open('database.yml', 'w') do |file|
#  file.write(Psych.dump([b, c, d]))
#end

#a.err("This is diagnostic level, for FYI messages.", 2)
#a.err("Warning level, for things that aren't fatal.", 1)
#a.err("Exception level! Perfidy!", 0)
#a.err("This doesn't happen.", 5)

browser = a.options[:browser]
platform = a.options[:platform]
version = a.options[:browserversion]

fbrowser = "GE_BROWSER=\"#{browser}\""
fplatform = "GE_PLATFORM=\"#{platform}\""
fversion = "GE_BROWSER_VERSION=\"#{version}\""

latterhalf = [fbrowser, fplatform, fversion].join( " " )


# TODO: Refactor this later, and we can make it flexible enough to call single iteration
# versions of the function for single-element lists but looped versions for multi-element
# lists. It'll reduce overhead, too, maybe. Benchmark trials should give proof.

result = []

a.options[:tests].each {
    |test|

    a.err( "For each test, we are iterating.", 2 )

    a.options[:servers].each {
      |server|

      a.err( "For each server, we are iterating.", 2 )

      a.err( "Here's where we start the run of test #{ test } on server #{ server }.", 2)
      formerhalf = "/usr/local/bin/gless #{test} #{server} "
      a.err( "We'll use the execution string #{ formerhalf + latterhalf }", 2)
      execstring = formerhalf + latterhalf
<<<<<<< HEAD
      a.err( "This is our string post-concatenation: #{ execstring }", 2)
      tstamp = Time.new
#      result = "result"
      result = %x( #{execstring} 2>&1 )
      a.err( "Finished execution, outputting result.", 2 )
      result = result.gsub(/\e\[\d{1,2}m/, '')
      File.write( "./raw/Output #{ tstamp.to_a.join("-")}", result)
      
=======
      puts execstring
      %x( #{execstring} )
>>>>>>> f8437717a308a2f6d402a63926d4bc39102a12b7
<commit_msg>One more try.<commit_after>#!/usr/bin/env ruby

require './Tenticle'
require 'yaml'
require 'command_line_reporter'

a = Tenticle::Cups.new(ARGV)  # Create a tenticle and init default options,
                              # check for incoming command line options,
                              # etc. etc.


# This was our stringything in Perl Octypus:
# q(/usr/local/bin/gless) . " " . qq($test $server GE_BROWSER='$brow' GE_PLATFORM='$plat' GE_BROWSER_VERSION='$ver');

#File.open('database.yml', 'w') do |file|
#  file.write(Psych.dump([b, c, d]))
#end

#a.err("This is diagnostic level, for FYI messages.", 2)
#a.err("Warning level, for things that aren't fatal.", 1)
#a.err("Exception level! Perfidy!", 0)
#a.err("This doesn't happen.", 5)

browser = a.options[:browser]
platform = a.options[:platform]
version = a.options[:browserversion]

fbrowser = "GE_BROWSER=\"#{browser}\""
fplatform = "GE_PLATFORM=\"#{platform}\""
fversion = "GE_BROWSER_VERSION=\"#{version}\""

latterhalf = [fbrowser, fplatform, fversion].join( " " )


# TODO: Refactor this later, and we can make it flexible enough to call single iteration
# versions of the function for single-element lists but looped versions for multi-element
# lists. It'll reduce overhead, too, maybe. Benchmark trials should give proof.

result = []

a.options[:tests].each {
    |test|

    a.err( "For each test, we are iterating.", 2 )

    a.options[:servers].each {
      |server|

      a.err( "For each server, we are iterating.", 2 )

      a.err( "Here's where we start the run of test #{ test } on server #{ server }.", 2)
      formerhalf = "/usr/local/bin/gless #{test} #{server} "
      a.err( "We'll use the execution string #{ formerhalf + latterhalf }", 2)
      execstring = formerhalf + latterhalf
      a.err( "This is our string post-concatenation: #{ execstring }", 2)
      tstamp = Time.new
#      result = "result"
      result = %x( #{execstring} 2>&1 )
      a.err( "Finished execution, outputting result.", 2 )
      result = result.gsub(/\e\[\d{1,2}m/, '')
      File.write( "./raw/Output #{ tstamp.to_a.join("-")}", result)

{'fraction_non_alphanumeric': 0.16057050839659534, 'fraction_numerical': 0.013112491373360938, 'mean_word_length': 3.2419512195121953, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, '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': '1711996', 'n_tokens_mistral': 1524, 'n_tokens_neox': 1441, 'n_words': 414}