2015-03-27 11:00:15 +00:00
|
|
|
class Dcd < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Auto-complete program for the D programming language"
|
2015-03-27 11:00:15 +00:00
|
|
|
homepage "https://github.com/Hackerpilot/DCD"
|
|
|
|
url "https://github.com/Hackerpilot/DCD.git",
|
2016-03-03 10:35:02 +00:00
|
|
|
:tag => "v0.8.0",
|
|
|
|
:revision => "f8f3024dda05e7f3d1a112adde1f99ec98649e78"
|
2015-07-26 21:05:44 +00:00
|
|
|
head "https://github.com/Hackerpilot/dcd.git", :shallow => false
|
|
|
|
|
2015-03-27 11:00:15 +00:00
|
|
|
bottle do
|
2016-01-16 08:01:14 +00:00
|
|
|
sha256 "4b6835271045a2cebcb9729712e30b56eab55dd08ff38acb1106382c15092771" => :el_capitan
|
|
|
|
sha256 "f3e08b029bdddeee54ccb243888516dc912af3c72accff0785f77be9ecf80239" => :yosemite
|
|
|
|
sha256 "779c9f5801b4108efafadd225c15fce5e518c2766fb049f2f076b357c4cbe918" => :mavericks
|
2015-03-27 11:00:15 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
depends_on "dmd" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
bin.install "bin/dcd-client", "bin/dcd-server"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
begin
|
|
|
|
# spawn a server, using a non-default port to avoid
|
|
|
|
# clashes with pre-existing dcd-server instances
|
|
|
|
server = fork do
|
2015-08-21 12:09:30 +00:00
|
|
|
exec "#{bin}/dcd-server", "-p9167"
|
2015-03-27 11:00:15 +00:00
|
|
|
end
|
|
|
|
# Give it generous time to load
|
|
|
|
sleep 0.5
|
|
|
|
# query the server from a client
|
2015-08-21 12:09:30 +00:00
|
|
|
system "#{bin}/dcd-client", "-q", "-p9167"
|
2015-08-21 03:01:34 +00:00
|
|
|
ensure
|
|
|
|
Process.kill "TERM", server
|
|
|
|
Process.wait server
|
2015-03-27 11:00:15 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|