homebrew-core/Formula/fugu.rb

47 lines
1.4 KiB
Ruby
Raw Normal View History

require "language/go"
class Fugu < Formula
desc "Docker command wrapper."
homepage "https://github.com/mattes/fugu"
url "https://github.com/mattes/fugu/archive/v1.1.1.tar.gz"
sha256 "94ec61037c3afa1267ea990ffd03ba1d0d1628926b3fdde0133fece36fa81929"
2015-08-06 19:05:28 +00:00
bottle do
2015-11-14 11:12:41 +00:00
cellar :any_skip_relocation
revision 1
sha256 "319b2c0dbb6a216501fa4bd22deb7981fcb66cc43c05887c617f76466ccabc77" => :el_capitan
sha256 "7eb31174fe5f1ed36f3026e5002d610468b38b1a968ae7fe58edb77439b6bc9b" => :yosemite
sha256 "0ff5162567bcba3ab4673942708b3c6de207b2e01aec45faed761f8832942817" => :mavericks
2015-08-06 19:05:28 +00:00
end
depends_on "go" => :build
2015-11-14 10:29:04 +00:00
depends_on "godep" => :build
depends_on "docker" => :recommended
go_resource "github.com/kr/fs" do
url "https://github.com/kr/fs.git", :revision => "2788f0dbd16903de03cb8186e5c7d97b69ad387b"
end
def install
2015-11-14 10:29:04 +00:00
ENV["GOPATH"] = buildpath
mkdir_p buildpath/"src/github.com/mattes/"
ln_s buildpath, buildpath/"src/github.com/mattes/fugu"
Language::Go.stage_deps resources, buildpath/"src"
cd buildpath/"fugu" do
2015-11-14 10:29:04 +00:00
system "godep", "go", "build", "-o", bin/"fugu", "main.go", "usage.go", "version.go"
end
end
test do
(testpath/"fugu.yml").write <<-EOS.undent
label1:
image: ubuntu
name: my-ubuntu
label2:
name: another-ubuntu
EOS
assert_match /label2/, shell_output("#{bin}/fugu show-labels --source file://#{testpath}/fugu.yml")
end
end