homebrew-core/Formula/pygments.rb

39 lines
1.2 KiB
Ruby

class Pygments < Formula
include Language::Python::Virtualenv
desc "Generic syntax highlighter"
homepage "https://pygments.org/"
url "https://files.pythonhosted.org/packages/5d/0e/ff13c055b014d634ed17e9e9345a312c28ec6a06448ba6d6ccfa77c3b5e8/Pygments-2.7.2.tar.gz"
sha256 "381985fcc551eb9d37c52088a32914e00517e57f4a21609f48141ba08e193fa0"
license "BSD-2-Clause"
head "https://github.com/pygments/pygments.git"
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
sha256 "8e900db6179b52b2a216430b5b1f7c5962f421c6bea365023cfa22f4198f9aee" => :catalina
sha256 "0a869fbf52f375e695e13bac636e543f5696fd40372bb6a5085618976d09a617" => :mojave
sha256 "9f8e6c987e2d6e4f296266501489a0b8f8708588a824cdf1555277f77e6c3036" => :high_sierra
end
depends_on "python@3.9"
def install
bash_completion.install "external/pygments.bashcomp" => "pygmentize"
virtualenv_install_with_resources
end
test do
(testpath/"test.py").write <<~EOS
import os
print(os.getcwd())
EOS
system bin/"pygmentize", "-f", "html", "-o", "test.html", testpath/"test.py"
assert_predicate testpath/"test.html", :exist?
end
end