class PrBro < Formula
  desc "Prioritize your GitHub PR review queue"
  homepage "https://github.com/toniperic/pr-bro"
  version "HOMEBREW_VERSION"
  license "MIT"

  on_intel do
    url "https://github.com/toniperic/pr-bro/releases/download/vHOMEBREW_VERSION/pr-bro-vHOMEBREW_VERSION-x86_64-apple-darwin.tar.gz"
    sha256 "INTEL_SHA256"
  end

  on_arm do
    url "https://github.com/toniperic/pr-bro/releases/download/vHOMEBREW_VERSION/pr-bro-vHOMEBREW_VERSION-aarch64-apple-darwin.tar.gz"
    sha256 "ARM_SHA256"
  end

  def install
    bin.install "pr-bro"
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/pr-bro --version")
  end

  def caveats
    <<~EOS
      pr-bro requires a GitHub Personal Access Token.

      More info: https://github.com/toniperic/pr-bro
    EOS
  end
end
