<commit_before>class Pitman
  DEFAULT_GEMS = %w(bigdecimal io-console json minitest
                    psych rake rdoc test-unit)

  def self.gems_list
    `gem list`.split("\n").collect { |str| str.split(" (").first.strip }
  end

  def self.parse(file)
    File.read(file)
      .split("\n")
      .select  { |str| str =~ /\(.+\)/ }
      .collect { |str| str.split(" ").first }
      .uniq
  end

  def self.used_gems(root)
    dirs = root.children.select { |c| c.directory? }

    gems = dirs.collect do |dir|
      Dir.chdir(dir) do
        next unless File.exist?('Gemfile.lock')
        parse('Gemfile.lock')
      end
    end

    gems.flatten
  end

  def self.collect(root)
    used = used_gems(root)
    all  = gems_list

    all - (used + DEFAULT_GEMS)
  end
end
<commit_msg>Remove extra split rule<commit_after>class Pitman
  DEFAULT_GEMS = %w(bigdecimal io-console json minitest
                    psych rake rdoc test-unit)

  def self.gems_list
    `gem list`.split("\n").collect { |str| str.split(" ").first }
  end

  def self.parse(file)
    File.read(file)
      .split("\n")
      .select  { |str| str =~ /\(.+\)/ }
      .collect { |str| str.split(" ").first }
      .uniq
  end

  def self.used_gems(root)
    dirs = root.children.select { |c| c.directory? }

    gems = dirs.collect do |dir|
      Dir.chdir(dir) do
        next unless File.exist?('Gemfile.lock')
        parse('Gemfile.lock')
      end
    end

    gems.flatten
  end

  def self.collect(root)
    used = used_gems(root)
    all  = gems_list

    all - (used + DEFAULT_GEMS)
  end
end

{'fraction_non_alphanumeric': 0.14186193793540217, 'fraction_numerical': 0.0, 'mean_word_length': 2.1411530815109345, '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': '860539', 'n_tokens_mistral': 596, 'n_tokens_neox': 567, 'n_words': 129}