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-11-26 12:39:10 +00:00
|
|
|
url "https://github.com/xyproto/algernon/archive/1.3.tar.gz"
|
2016-10-30 10:11:48 +00:00
|
|
|
sha256 "46577afcd255f9c4f193f2408c418e0ca5a66db9c9b4e553058fd4bef28631c1"
|
2016-11-26 12:39:10 +00:00
|
|
|
sha256 "a5a5976ce75c58b0a1ec10ee8185457fa590bc4e7473f061053bba85474208cc"
|
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-11-26 12:47:28 +00:00
|
|
|
sha256 "c01c2947279e6bbc29eaca07a022cb3276d82d6f7ff6dfa9f1057e12ed764c91" => :sierra
|
|
|
|
sha256 "ac0d53e57be4a00dd8ade3c9ea384730d00ba4f540b5db64d697692a66935446" => :el_capitan
|
|
|
|
sha256 "0f6c5ee39192dc9f48f735fd8d68656cc50fda5234758490f5f53d41a85469cd" => :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
|