http-server 0.10.0 (new formula)

Closes #16760.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
Jordan Danford 2017-08-13 13:21:54 -07:00 committed by ilovezfs
parent a90ac31c69
commit 3f51a23dfe

29
Formula/http-server.rb Normal file
View file

@ -0,0 +1,29 @@
require "language/node"
class HttpServer < Formula
desc "Simple zero-configuration command-line HTTP server"
homepage "https://github.com/indexzero/http-server"
url "https://registry.npmjs.org/http-server/-/http-server-0.10.0.tgz"
sha256 "cf7bde2def672698f78463ce8bec54dfe6392c24552f2b1c5e2e5ce94428de23"
head "https://github.com/indexzero/http-server.git"
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
begin
pid = fork do
exec "#{bin}/http-server"
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