File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-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+ 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
You can’t perform that action at this time.
0 commit comments