Skip to content

Commit 3cab602

Browse files
committed
goshs 1.0.8 (new formula)
Signed-off-by: Rui Chen <[email protected]>
1 parent f88bf06 commit 3cab602

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/autobump.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,7 @@ goreman
13901390
goresym
13911391
gorilla-cli
13921392
gosec
1393+
goshs
13931394
gossip
13941395
gostatic
13951396
gosu

Formula/g/goshs.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
class Goshs < Formula
2+
desc "Simple, yet feature-rich web server written in Go"
3+
homepage "https://goshs.de/en/index.html"
4+
url "https://github.com/patrickhener/goshs/archive/refs/tags/v1.0.8.tar.gz"
5+
sha256 "ee755ea7355eb6264e097c80c04d8a7affb091b4c732b102c685e762374f2f68"
6+
license "MIT"
7+
head "https://github.com/patrickhener/goshs.git", branch: "main"
8+
9+
depends_on "go" => :build
10+
11+
def install
12+
system "go", "build", *std_go_args(ldflags: "-s -w")
13+
end
14+
15+
test do
16+
assert_match version.to_s, shell_output("#{bin}/goshs -v")
17+
18+
(testpath/"test.txt").write "Hello, Goshs!"
19+
20+
port = free_port
21+
server_pid = spawn bin/"goshs", "-p", port.to_s, "-d", testpath, "-si"
22+
sleep 2
23+
output = shell_output("curl -s http://localhost:#{port}/test.txt")
24+
assert_match "Hello, Goshs!", output
25+
ensure
26+
Process.kill("TERM", server_pid)
27+
Process.wait(server_pid)
28+
end
29+
end

0 commit comments

Comments
 (0)