2016-09-30 03:11:52 +00:00
|
|
|
class Armor < Formula
|
2016-10-08 17:30:46 +00:00
|
|
|
desc "Uncomplicated HTTP server, supports HTTP/2 and auto TLS"
|
2016-09-30 03:11:52 +00:00
|
|
|
homepage "https://github.com/labstack/armor"
|
2017-03-07 18:52:29 +00:00
|
|
|
url "https://github.com/labstack/armor/archive/v0.2.8.tar.gz"
|
|
|
|
sha256 "a9de72d2a88f7e3790ef1f6410923aaaa596756af141085854ee26e65a63233d"
|
2016-09-30 03:11:52 +00:00
|
|
|
head "https://github.com/labstack/armor.git"
|
|
|
|
|
2016-10-01 06:46:28 +00:00
|
|
|
bottle do
|
2017-02-01 05:31:49 +00:00
|
|
|
cellar :any_skip_relocation
|
2017-03-07 18:55:41 +00:00
|
|
|
sha256 "d68eb622d91728677955805b66b79222f08c949e339e027252da1f35aadad400" => :sierra
|
|
|
|
sha256 "c3758dbaa2683ff2c61b9c0d6ae6ffce01d975509fd52695e0d97111130b481b" => :el_capitan
|
|
|
|
sha256 "4c6de98f1658118b4135369f03d1a214f0cbe6b91f0d0fa4bab8d81c1b095ed5" => :yosemite
|
2016-10-01 06:46:28 +00:00
|
|
|
end
|
|
|
|
|
2016-09-30 03:11:52 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
armorpath = buildpath/"src/github.com/labstack/armor"
|
|
|
|
armorpath.install buildpath.children
|
|
|
|
|
|
|
|
cd armorpath do
|
|
|
|
system "go", "build", "-o", bin/"armor", "cmd/armor/main.go"
|
|
|
|
prefix.install_metafiles
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
begin
|
|
|
|
pid = fork do
|
|
|
|
exec "#{bin}/armor"
|
|
|
|
end
|
|
|
|
sleep 1
|
|
|
|
output = shell_output("curl -sI http://localhost:8080")
|
|
|
|
assert_match /200 OK/m, output
|
|
|
|
ensure
|
|
|
|
Process.kill("HUP", pid)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|