homebrew-core/Formula/algernon.rb
2018-11-04 11:48:04 +00:00

44 lines
1.4 KiB
Ruby

class Algernon < Formula
desc "Pure Go web server with Lua, Markdown, HTTP/2 and template support"
homepage "https://algernon.roboticoverlords.org/"
url "https://github.com/xyproto/algernon.git",
:tag => "1.12.0",
:revision => "330e7d5840fd1225c6b81f4a1af441eba1d6f31a"
version_scheme 1
head "https://github.com/xyproto/algernon.git"
bottle do
cellar :any_skip_relocation
sha256 "a6a2e073d76fc09a6027e225820e3df656d13a73e0c706828723af353016db4a" => :mojave
sha256 "11007b7b8f0fbd77f2c8b080f1e513cec337e7245f16380926de5c392356a4a9" => :high_sierra
sha256 "d068c0ece61f471a0a7d18fe7ea0031f8074f5ead4c17c778edf5cef680e438a" => :sierra
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/xyproto/algernon").install buildpath.children
cd "src/github.com/xyproto/algernon" do
system "go", "build", "-o", "algernon"
bin.install "desktop/mdview"
bin.install "algernon"
prefix.install_metafiles
end
end
test do
begin
pid = fork do
exec "#{bin}/algernon", "-s", "-q", "--httponly", "--boltdb", "tmp.db",
"--addr", ":45678"
end
sleep 20
output = shell_output("curl -sIm3 -o- http://localhost:45678")
assert_match /200 OK.*Server: Algernon/m, output
ensure
Process.kill("HUP", pid)
end
end
end