53 lines
2.2 KiB
Ruby
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/23/4d/85d622a12208a1fb09540554f812e867db983d4aa7fddf763cf26d9407f5/rich-9.12.2.tar.gz"
|
|
sha256 "493b4288273aa46475230733358696457e5df9215c898b164a324b7d9d694e88"
|
|
license "MIT"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "bdc1f7a9b5bef6b1b5fdb90b718d94184820ed8279386d5962fdcc76017da3f3"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "4b4eb860374f3260daa35ede9683246bfee7acef4936beae1e18abf81bfe8ca4"
|
|
sha256 cellar: :any_skip_relocation, catalina: "df2f3fb04861b77ae822f8ab160e8bb226d2493218e0bb8ea907572877817bbe"
|
|
sha256 cellar: :any_skip_relocation, mojave: "f0ecb594bf101d0f91b8932699e133d86054f69941186d0f4070a4765f83800c"
|
|
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
|