homebrew-core/Formula/percol.rb

52 lines
1.7 KiB
Ruby

class Percol < Formula
include Language::Python::Virtualenv
desc "Interactive grep tool"
homepage "https://github.com/mooz/percol"
url "https://files.pythonhosted.org/packages/50/ea/282b2df42d6be8d4292206ea9169742951c39374af43ae0d6f9fff0af599/percol-0.2.1.tar.gz"
sha256 "7a649c6fae61635519d12a6bcacc742241aad1bff3230baef2cedd693ed9cfe8"
license "MIT"
revision 3
head "https://github.com/mooz/percol.git"
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "a1d437af31e6c2c6b2fcb7fa5b6d7a81c1cc5014e647bf803618f1421d7b53c2" => :big_sur
sha256 "3ff2691bdcf6ec23e6a6714322591e95361e0d257672f85bbf0549dd9d3819e7" => :catalina
sha256 "5bb5d60ccdc9296979b17f056377fc73c9d970580654e342e89b0f7e2a23154c" => :mojave
end
depends_on "python@3.9"
uses_from_macos "expect" => :test
resource "cmigemo" do
url "https://files.pythonhosted.org/packages/2f/e4/374df50b655e36139334046f898469bf5e2d7600e1e638f29baf05b14b72/cmigemo-0.1.6.tar.gz"
sha256 "7313aa3007f67600b066e04a4805e444563d151341deb330135b4dcdf6444626"
end
resource "six" do
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
end
def install
virtualenv_install_with_resources
end
test do
(testpath/"textfile").write <<~EOS
Homebrew, the missing package manager for macOS.
EOS
(testpath/"expect-script").write <<~EOS
spawn #{bin}/percol --query=Homebrew textfile
expect "QUERY> Homebrew"
EOS
assert_match "Homebrew", shell_output("/usr/bin/expect -f expect-script")
end
end