2015-06-05 13:59:04 +00:00
|
|
|
class Algernon < Formula
|
2016-06-03 21:51:36 +00:00
|
|
|
desc "HTTP/2 web server with built-in support for Lua and templates"
|
2015-06-05 13:59:04 +00:00
|
|
|
homepage "http://algernon.roboticoverlords.org/"
|
2016-10-30 10:11:48 +00:00
|
|
|
url "https://github.com/xyproto/algernon/archive/1.2.1.tar.gz"
|
|
|
|
sha256 "46577afcd255f9c4f193f2408c418e0ca5a66db9c9b4e553058fd4bef28631c1"
|
2016-09-20 07:30:47 +00:00
|
|
|
version_scheme 1
|
2015-06-05 13:59:04 +00:00
|
|
|
head "https://github.com/xyproto/algernon.git"
|
|
|
|
|
2015-06-10 12:12:48 +00:00
|
|
|
bottle do
|
2016-10-30 14:24:10 +00:00
|
|
|
sha256 "32f30f262a19cb122d1817f11dcdb9485e36f9fbc05e823e391e3ee59260d9a6" => :sierra
|
|
|
|
sha256 "46f66205f6de057ffc28e1739f50fe2a18029bccdcae8aa96930641d772e8cbd" => :el_capitan
|
|
|
|
sha256 "083a19038dc8025ddc0228211600e5dd5331a81e014e76976ae9282b4286d2ff" => :yosemite
|
2015-06-10 12:12:48 +00:00
|
|
|
end
|
|
|
|
|
2016-09-29 09:28:20 +00:00
|
|
|
depends_on "glide" => :build
|
2015-06-05 13:59:04 +00:00
|
|
|
depends_on "go" => :build
|
2016-01-14 10:12:39 +00:00
|
|
|
depends_on "readline"
|
2015-06-05 13:59:04 +00:00
|
|
|
|
|
|
|
def install
|
2016-09-29 09:28:20 +00:00
|
|
|
ENV["GLIDE_HOME"] = buildpath/"glide_home"
|
2015-06-05 13:59:04 +00:00
|
|
|
ENV["GOPATH"] = buildpath
|
2016-09-20 07:30:47 +00:00
|
|
|
(buildpath/"src/github.com/xyproto/algernon").install buildpath.children
|
|
|
|
cd "src/github.com/xyproto/algernon" do
|
2016-09-29 09:28:20 +00:00
|
|
|
system "glide", "install"
|
2016-09-20 07:30:47 +00:00
|
|
|
system "go", "build", "-o", "algernon"
|
2015-06-05 13:59:04 +00:00
|
|
|
|
2016-09-20 07:30:47 +00:00
|
|
|
bin.install "desktop/mdview"
|
|
|
|
bin.install "algernon"
|
|
|
|
prefix.install_metafiles
|
|
|
|
end
|
2015-06-05 13:59:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
begin
|
2016-09-20 07:30:47 +00:00
|
|
|
pid = fork do
|
2016-09-23 18:57:07 +00:00
|
|
|
exec "#{bin}/algernon", "-s", "-q", "--httponly", "--boltdb", "my.db",
|
|
|
|
"--addr", ":45678"
|
2015-06-05 13:59:04 +00:00
|
|
|
end
|
|
|
|
sleep(1)
|
2016-09-20 07:30:47 +00:00
|
|
|
output = shell_output("curl -sIm3 -o- http://localhost:45678")
|
|
|
|
assert_match /200 OK.*Server: Algernon/m, output
|
2015-06-05 13:59:04 +00:00
|
|
|
ensure
|
2016-09-20 07:30:47 +00:00
|
|
|
Process.kill("HUP", pid)
|
2015-06-05 13:59:04 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|