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",
|
2015-05-10 14:41:09 +00:00
|
|
|
:tag => "v0.6.0",
|
|
|
|
:revision => "633b1667ef223e6eda7bcfd2d2d746f59036571f"
|
2015-03-27 11:00:15 +00:00
|
|
|
|
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
|
2015-05-10 15:02:29 +00:00
|
|
|
sha256 "b2bfea971d1cce8f221a524d3ddd10f5b2e6775acfe29754d765785d875a6bb6" => :yosemite
|
|
|
|
sha256 "f159386dfbfb7d225010f3fa24e9b0dc911a718bd81a059be243edb6af4f880c" => :mavericks
|
|
|
|
sha256 "84a24c63e3b05ce812ffb7453f1fd5edfb47dfe053bd6c02401f264dd9febc60" => :mountain_lion
|
2015-03-27 11:00:15 +00:00
|
|
|
end
|
|
|
|
|
2015-08-10 08:57:28 +00:00
|
|
|
devel do
|
|
|
|
url "https://github.com/Hackerpilot/DCD.git",
|
|
|
|
:tag => "v0.7.0-alpha1",
|
|
|
|
:revision => "fb5ad8ea350cc639de86d972b89f961922719b58"
|
|
|
|
version "0.7.0-a1"
|
|
|
|
end
|
|
|
|
|
2015-03-27 11:00:15 +00:00
|
|
|
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
|
|
|
|
puts "==> dcd-server -p9167"
|
|
|
|
# would use spawn, can't on M-L as ruby 1.8
|
|
|
|
server = fork do
|
|
|
|
exec "dcd-server", "-p9167"
|
|
|
|
end
|
|
|
|
# Give it generous time to load
|
|
|
|
sleep 0.5
|
|
|
|
# query the server from a client
|
|
|
|
system "dcd-client", "-q", "-p9167"
|
|
|
|
rescue
|
|
|
|
if server
|
|
|
|
# clean up the server process
|
|
|
|
Process.kill "TERM", server
|
|
|
|
end
|
|
|
|
raise
|
|
|
|
end
|
|
|
|
# Ditto
|
|
|
|
Process.kill "TERM", server
|
|
|
|
end
|
|
|
|
end
|