From 6d1f4a1e9205be72084790391a6fc85bb39a3835 Mon Sep 17 00:00:00 2001 From: ivaquero Date: Sun, 20 Oct 2024 23:39:29 +0800 Subject: [PATCH] tex-fmt 0.4.5 (new formula) --- Formula/t/tex-fmt.rb | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Formula/t/tex-fmt.rb diff --git a/Formula/t/tex-fmt.rb b/Formula/t/tex-fmt.rb new file mode 100644 index 000000000000..0267d12ec40e --- /dev/null +++ b/Formula/t/tex-fmt.rb @@ -0,0 +1,39 @@ +class TexFmt < Formula + desc "Extremely fast LaTeX formatter written in Rust" + homepage "https://github.com/WGUNDERWOOD/tex-fmt" + url "https://github.com/WGUNDERWOOD/tex-fmt/archive/refs/tags/v0.4.5.tar.gz" + sha256 "3dde1f19e9228a2a284d73c63b193fdf775cb993945fb328cd01e3a6cc834bf1" + license "MIT" + head "https://github.com/WGUNDERWOOD/tex-fmt.git", branch: "main" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args + end + + test do + (testpath/"test.tex").write <<~EOS + \\documentclass{article} + \\title{tex-fmt Homebrew Test} + \\begin{document} + \\maketitle + \\begin{itemize} + \\item Hello + \\item World + \\end{itemize} + \\end{document} + EOS + assert_match <<~EOS, shell_output("#{bin}/tex-fmt #{testpath}/test.tex") + \\documentclass{article} + \\title{tex-fmt Homebrew Test} + \\begin{document} + \\maketitle + \\begin{itemize} + \\item Hello + \\item World + \\end{itemize} + \\end{document} + EOS + end +end