homebrew-core/Formula/richmd.rb

53 lines
2.2 KiB
Ruby

class Richmd < Formula
include Language::Python::Virtualenv
desc "Format Markdown in the terminal with Rich"
homepage "https://github.com/willmcgugan/rich"
url "https://files.pythonhosted.org/packages/e0/f4/df55dc69153e1d67525f1663aec11da8db80d281a4400810a4cbbd6af251/rich-9.12.4.tar.gz"
sha256 "1e000895221df23cd7f828a9511c15d10189850d4f923b6d8c3d29a32ca95265"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "904cc895c5880362cade7ce71736b2185566a55dbcb80cfaf0ef1d1c9fda35f6"
sha256 cellar: :any_skip_relocation, big_sur: "d1dc1aa8ee8766a7570304e28525289ee53bad4f97c4b206a6151a8e9f11f85e"
sha256 cellar: :any_skip_relocation, catalina: "0de1b51e3e8078055ef27fd28fbdf5f9731654d588ab8cc903a816d66fc5417a"
sha256 cellar: :any_skip_relocation, mojave: "adcfa1bf6d99c7933a72a60576eb248c2f8b0f1abd1e986be5f6cd3eb497866d"
end
depends_on "python@3.9"
resource "colorama" do
url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz"
sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"
end
resource "commonmark" do
url "https://files.pythonhosted.org/packages/60/48/a60f593447e8f0894ebb7f6e6c1f25dafc5e89c5879fdc9360ae93ff83f0/commonmark-0.9.1.tar.gz"
sha256 "452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/19/d0/dec5604a275b19b0ebd2b9c43730ce39549c8cd8602043eaf40c541a7256/Pygments-2.8.0.tar.gz"
sha256 "37a13ba168a02ac54cc5891a42b1caec333e59b66addb7fa633ea8a6d73445c0"
end
resource "typing-extensions" do
url "https://files.pythonhosted.org/packages/16/06/0f7367eafb692f73158e5c5cbca1aec798cdf78be5167f6415dd4205fa32/typing_extensions-3.7.4.3.tar.gz"
sha256 "99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"
end
def install
virtualenv_install_with_resources
(bin/"richmd").write <<~SH
#!/bin/bash
#{libexec/"bin/python"} -m rich.markdown $@
SH
end
test do
(testpath/"foo.md").write("- Hello, World")
assert_equal "• Hello, World", shell_output("#{bin}/richmd foo.md").strip
end
end