2016-04-19 20:54:17 +00:00
|
|
|
class Webdis < Formula
|
|
|
|
desc "Redis HTTP interface with JSON output"
|
|
|
|
homepage "http://webd.is/"
|
|
|
|
url "https://github.com/nicolasff/webdis/archive/0.1.2.tar.gz"
|
|
|
|
sha256 "8e46093af006e35354f6b3d58a70e3825cd0c074893be318f1858eddbe1cda86"
|
|
|
|
|
2016-04-21 13:17:41 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha256 "39585b1ba1b3a8e34c2a2d08e6e347284fd3dceca217c83638dfb9fa8e684550" => :el_capitan
|
|
|
|
sha256 "053f0bf229a602f8fae49b654545826d4c95c5c020f50edd71bfc083a4152d93" => :yosemite
|
|
|
|
sha256 "93d36ebff19cbe0c7d50075a3c3c85d3542c105713728808c84bf0d5fa81828f" => :mavericks
|
|
|
|
end
|
|
|
|
|
2016-04-19 20:54:17 +00:00
|
|
|
depends_on "libevent"
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
bin.install "webdis"
|
|
|
|
|
2016-04-21 14:47:22 +00:00
|
|
|
inreplace "webdis.prod.json", "/var/log/webdis.log", "#{var}/log/webdis.log"
|
2016-04-19 20:54:17 +00:00
|
|
|
etc.install "webdis.json", "webdis.prod.json"
|
|
|
|
end
|
|
|
|
|
|
|
|
def post_install
|
|
|
|
(var/"log").mkpath
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
begin
|
|
|
|
server = fork do
|
|
|
|
exec "#{bin}/webdis", "#{etc}/webdis.json"
|
|
|
|
end
|
|
|
|
sleep 0.5
|
|
|
|
# Test that the response is from webdis
|
2016-04-21 14:47:22 +00:00
|
|
|
assert_match(/Server: Webdis/, shell_output("curl --silent -XGET -I http://localhost:7379/PING"))
|
2016-04-19 20:54:17 +00:00
|
|
|
ensure
|
|
|
|
Process.kill "TERM", server
|
|
|
|
Process.wait server
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|