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

dependencies = 
  "aclocal",
  "autoconf",
  "automake",
  "autoreconf"

commands =
  "aclocal",
  "autoconf",
  "automake --add-missing",
  "autoreconf",
  "automake",
  "./configure"

missing_deps = Array.new

dependencies.each do |dependency|
  puts "build-env: checking #{dependency}"
  if `which #{dependency}`.empty?
    missing_deps.push dependency
  end
end

if not missing_deps.empty?
  puts "build-env failed..."

  missing_deps.each do |missing|
    puts "Install #{missing}"
  end
  exit 1
end

commands.each do |command|
  puts "build-env: #{command}"
  `#{command}`
end

puts "Your environment setup is complete. Run `make` to build hkl project."

<commit_msg>Spruces up build-env with sweet colors<commit_after>#!/usr/bin/env ruby

dependencies = 
  "aclocal",
  "autoconf",
  "automake",
  "autoreconf"

commands =
  "aclocal",
  "autoconf",
  "automake --add-missing",
  "autoreconf",
  "automake",
  "./configure"

# ASCII text coloring
def purpify(text)
  "\033[1;35m" + text + "\033[0m"
end

def greenify(text)
  "\033[0;32m" + text + "\033[0m"
end

def redify(text)
  "\033[0;31m" + text + "\033[0m"
end

# Check dependencies
missing_dependencies = Array.new

dependencies.each do |dependency|
  puts "#{purpify "build-env:"} #{greenify "checking #{dependency}"}"
  if not system("which #{dependency}", :out => "/dev/null")
    missing_dependencies.push dependency
  end
end

if not missing_dependencies.empty?
  puts redify "build-env failed..."

  missing_dependencies.each do |missing|
    puts redify "Missing #{missing}"
  end

  puts redify "Install the missing dependencies and run again."
  exit 1
end

# Execute build commands
commands.each do |command|
  puts "#{purpify "build-env:"} #{greenify "#{command}"}"
  system("#{command}")
end

puts greenify "\nYour environment setup is complete. Run `make` to build hkl.\n"


{'fraction_non_alphanumeric': 0.1472457627118644, 'fraction_numerical': 0.01694915254237288, 'mean_word_length': 3.958005249343832, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '856483', 'n_tokens_mistral': 699, 'n_tokens_neox': 669, 'n_words': 183}