File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 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+ bottle do
9+ sha256 cellar : :any_skip_relocation , arm64_sequoia : "4bf57634a112496ca1987739aec06c616a8bf4361ca2d6b1143737eebc36e969"
10+ sha256 cellar : :any_skip_relocation , arm64_sonoma : "4bf57634a112496ca1987739aec06c616a8bf4361ca2d6b1143737eebc36e969"
11+ sha256 cellar : :any_skip_relocation , arm64_ventura : "4bf57634a112496ca1987739aec06c616a8bf4361ca2d6b1143737eebc36e969"
12+ sha256 cellar : :any_skip_relocation , sonoma : "aefac0f53a8554d8b4865645445625113fdc5b9bab1f088fca7a3a77e3ae071c"
13+ sha256 cellar : :any_skip_relocation , ventura : "aefac0f53a8554d8b4865645445625113fdc5b9bab1f088fca7a3a77e3ae071c"
14+ sha256 cellar : :any_skip_relocation , x86_64_linux : "f76fc66c6690bb07d598d4701db7c375b1f774c5d9047e7d2d2acc7837b31d66"
15+ end
16+
17+ depends_on "go" => :build
18+
19+ def install
20+ system "go" , "build" , *std_go_args ( ldflags : "-s -w" ) , "./cmd/templ"
21+ end
22+
23+ test do
24+ assert_match version . to_s , shell_output ( "#{ bin } /templ version" )
25+
26+ ( testpath /"test.templ" ) . write <<~TEMPL
27+ package main
28+
29+ templ Test() {
30+ <p class="testing">Hello, World</p>
31+ }
32+ TEMPL
33+
34+ output = shell_output ( "#{ bin } /templ generate -stdout -f #{ testpath } /test.templ" )
35+ assert_match "func Test() templ.Component {" , output
36+ end
37+ end
You can’t perform that action at this time.
0 commit comments