2016-09-30 03:11:52 +00:00
|
|
|
class Armor < Formula
|
|
|
|
desc "Simple HTTP server, supports HTTP/2 and auto TLS"
|
|
|
|
homepage "https://github.com/labstack/armor"
|
2016-10-03 22:16:51 +00:00
|
|
|
url "https://github.com/labstack/armor/archive/v0.1.2.tar.gz"
|
|
|
|
sha256 "b9106fd828c34f2dce89d7edee0cb3f60788471ba284cbc0fe381990652d463f"
|
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
|
|
|
|
cellar :any_skip_relocation
|
2016-10-03 23:17:13 +00:00
|
|
|
sha256 "c2267210faf6149fc85fc40659862d26c5e68cb28cb206a8447575237b797870" => :sierra
|
|
|
|
sha256 "235767c93510ee17d61c110ad84afd49e9b2c6441cbe0b4802bdf3956fc6f44c" => :el_capitan
|
|
|
|
sha256 "2c43df2b2ed545c3386b5155a49a98b045820019595f7f67d9b6ac2bb1def3f2" => :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
|