Skip to content

Commit f81f860

Browse files
committed
templ: 0.2.793 (new formula)
1 parent b1c8303 commit f81f860

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Formula/t/templ.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
class Templ < Formula
2+
desc "Language for writing HTML user interfaces in Go"
3+
homepage "https://templ.guide"
4+
url "https://github.com/a-h/templ/archive/refs/tags/v0.2.793.tar.gz"
5+
sha256 "be924c8b359748b0109c18831e1105618f6174a0f40645d5b82a91e7a9a8fffc"
6+
license "MIT"
7+
8+
depends_on "go" => :build
9+
10+
def install
11+
system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/templ"
12+
end
13+
14+
test do
15+
assert_match version.to_s, shell_output("#{bin}/templ version")
16+
17+
(testpath/"test.templ").write <<~TEMPL
18+
package main
19+
20+
templ Test() {
21+
<p class="testing">Hello, World</p>
22+
}
23+
TEMPL
24+
25+
output = shell_output("#{bin}/templ generate -stdout -f #{testpath}/test.templ")
26+
assert_match "func Test() templ.Component {", output
27+
end
28+
end

0 commit comments

Comments
 (0)