<commit_before>require 'formula'

module Homebrew extend self
  def deps
    if ARGV.include? '--all'
      Formula.each do |f|
        # TODO add a space after the colon??
        puts "#{f.name}:#{f.deps*' '}"
      end
    else
      func = if ARGV.one? then :deps else :recursive_deps end
      puts ARGV.formulae.map(&func).intersection.sort
    end
  end
end

class Array
  def intersection
    a = []
    each{ |b| a |= b }
    each{ |c| a &= c }
    a
  end
end
<commit_msg>Make brew deps Leopard compatible<commit_after>require 'formula'

module Homebrew extend self
  def deps
    if ARGV.include? '--all'
      Formula.each do |f|
        # TODO add a space after the colon??
        puts "#{f.name}:#{f.deps*' '}"
      end
    else
      puts ARGV.formulae.map{ |f| ARGV.one? ? f.deps : f.recursive_deps }.intersection.sort
    end
  end
end

class Array
  def intersection
    a = []
    each{ |b| a |= b }
    each{ |c| a &= c }
    a
  end
end

{'fraction_non_alphanumeric': 0.12291666666666666, 'fraction_numerical': 0.0, 'mean_word_length': 2.1716171617161715, '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': '6172844', 'n_tokens_mistral': 360, 'n_tokens_neox': 357, 'n_words': 109}