<commit_before>if(ENV['ARUBA_REPORT_DIR'])
  ENV['ARUBA_REPORT_TEMPLATES'] ||= File.dirname(__FILE__) + '/../../templates'
  
  require 'fileutils'
  require 'erb'
  require 'bcat/ansi'
  require 'rdiscount'
  require 'aruba/process'

  module Aruba
    module Reporting
      def pygmentize(file)
        pygmentize = Process.new(%{pygmentize -f html -O encoding=utf-8 "#{file}"}, 3, 0.5)
        pygmentize.run! do |p|
          exit_status = p.stop(false)
          if(exit_status == 0)
            p.stdout(false)
          elsif(p.stderr =~ /no lexer/) # Pygment's didn't recognize it
            IO.read(file)
          else
            STDERR.puts "\e[31m#{p.stderr} - is pygments installed?\e[0m"
            exit $?.exitstatus
          end
        end
      end<commit_msg>We always want ANSI colors for reporting<commit_after>if(ENV['ARUBA_REPORT_DIR'])
  ENV['ARUBA_REPORT_TEMPLATES'] ||= File.dirname(__FILE__) + '/../../templates'
  
  require 'fileutils'
  require 'erb'
  require 'bcat/ansi'
  require 'rdiscount'
  require 'aruba/process'

  module Aruba
    module Reporting
      def pygmentize(file)
        pygmentize = Process.new(%{pygmentize -f html -O encoding=utf-8 "#{file}"}, 3, 0.5)
        pygmentize.run! do |p|
          exit_status = p.stop(false)
          if(exit_status == 0)
            p.stdout(true)
          elsif(p.stderr =~ /no lexer/) # Pygment's didn't recognize it
            IO.read(file)
          else
            STDERR.puts "\e[31m#{p.stderr} - is pygments installed?\e[0m"
            exit $?.exitstatus
          end
        end
      end
{'fraction_non_alphanumeric': 0.13316582914572864, 'fraction_numerical': 0.010050251256281407, 'mean_word_length': 2.179640718562874, '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': '1320834', 'n_tokens_mistral': 576, 'n_tokens_neox': 541, 'n_words': 117}