dufs 0.31.0 (new formula)

Closes #118734.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
MoonFruit 2022-12-22 12:31:50 +08:00 committed by BrewTestBot
parent 08e7183dcc
commit d90e490c43
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 32 additions and 0 deletions

32
Formula/dufs.rb Normal file
View File

@ -0,0 +1,32 @@
class Dufs < Formula
desc "Static file server"
homepage "https://github.com/sigoden/dufs"
url "https://github.com/sigoden/dufs/archive/refs/tags/v0.31.0.tar.gz"
sha256 "f5078fb245d0aeccbcfe966a0aa89fb2ee5af7a88016534ab66776971c0c3d2e"
license any_of: ["Apache-2.0", "MIT"]
depends_on "rust" => :build
def install
system "cargo", "install", *std_cargo_args
generate_completions_from_executable(bin/"dufs", "--completions")
end
test do
port = free_port
pid = fork do
exec "#{bin}/dufs", bin.to_s, "-b", "127.0.0.1", "--port", port.to_s
end
sleep 2
begin
read = (bin/"dufs").read
assert_equal read, shell_output("curl localhost:#{port}/dufs")
ensure
Process.kill("SIGINT", pid)
Process.wait(pid)
end
end
end