<commit_before>class BinaryChecker
  def initialize(command)
    @command = command
  end

  def exist?
    # would love something better
    out = `command -v #{@command} >/dev/null 2>&1`
    $?.to_s.scan("0") != []
  end
end<commit_msg>inspect the environment for binarys, don't shell out<commit_after>class BinaryChecker
  def initialize(command)
    @command = command
  end

  def exist?
    # would love something better
    # out = `command -v #{@command} >/dev/null 2>&1`
    # $?.to_s.scan("0") != []
    !ENV['PATH'].split(':').
        each {|folder| puts File.exists?(folder+'/'+@command)}.
        inject(false){|a,b| a || b }
  end
end
{'fraction_non_alphanumeric': 0.16640986132511557, 'fraction_numerical': 0.009244992295839754, 'mean_word_length': 3.140127388535032, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3487216', 'n_tokens_mistral': 225, 'n_tokens_neox': 220, 'n_words': 58}