<commit_before>class UsageError < RuntimeError; end
class FormulaUnspecifiedError < UsageError; end
class KegUnspecifiedError < UsageError; end

class MultipleVersionsInstalledError < RuntimeError
  attr :name

  def initialize name
    @name = name
    super "#{name} has multiple installed versions"
  end
end

class NotAKegError < RuntimeError; end

class NoSuchKegError < RuntimeError
  attr :name

  def initialize name
    @name = name
    super "No such keg: #{HOMEBREW_CELLAR}/#{name}"
  end
end

class FormulaUnavailableError < RuntimeError
  attr :name
  attr :dependent, true

  def dependent_s
    "(dependency of #{dependent})" if dependent and dependent != name
  end

  def to_s
    if name =~ %r{(\w+)/(\w+)/(\w+)} then <<-EOS.undent
      No available formula for #$3 #{dependent_s}
      Please tap it and then try again: brew tap #$1/#$2
      EOS
    else
      "No available formula for #{name} #{dependent_s}"
    end
  end

  def initialize name
    @name = name
  end<commit_msg>Allow dashes in tap-formula names<commit_after>class UsageError < RuntimeError; end
class FormulaUnspecifiedError < UsageError; end
class KegUnspecifiedError < UsageError; end

class MultipleVersionsInstalledError < RuntimeError
  attr :name

  def initialize name
    @name = name
    super "#{name} has multiple installed versions"
  end
end

class NotAKegError < RuntimeError; end

class NoSuchKegError < RuntimeError
  attr :name

  def initialize name
    @name = name
    super "No such keg: #{HOMEBREW_CELLAR}/#{name}"
  end
end

class FormulaUnavailableError < RuntimeError
  attr :name
  attr :dependent, true

  def dependent_s
    "(dependency of #{dependent})" if dependent and dependent != name
  end

  def to_s
    if name =~ %r{(\w+)/(\w+)/([^/]+)} then <<-EOS.undent
      No available formula for #$3 #{dependent_s}
      Please tap it and then try again: brew tap #$1/#$2
      EOS
    else
      "No available formula for #{name} #{dependent_s}"
    end
  end

  def initialize name
    @name = name
  end
{'fraction_non_alphanumeric': 0.09171597633136094, 'fraction_numerical': 0.0029585798816568047, 'mean_word_length': 3.430131004366812, 'pattern_counts': {'":': 0, '<': 21, '<?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': '5083625', 'n_tokens_mistral': 644, 'n_tokens_neox': 619, 'n_words': 221}