class Godep < Formula desc "Dependency tool for go" homepage "https://godoc.org/github.com/tools/godep" url "https://github.com/tools/godep/archive/v79.tar.gz" sha256 "3dd2e6c4863077762498af98fa0c8dc5fedffbca6a5c0c4bb42b452c8268383d" revision 3 head "https://github.com/tools/godep.git" bottle do cellar :any_skip_relocation sha256 "53dfaa177714f2e3a6e72f7a7d3b0787d300348776608006534c8c15cb0ea1d4" => :sierra sha256 "3dc3c55126a9f545286c4187c725756609723a04e1f1148156780caa79692dae" => :el_capitan sha256 "9440bf29437324b2ea44c59b83d8306e9290c6be25f1aa57e193488cc033a37e" => :yosemite end depends_on "go" def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/tools/godep").install buildpath.children cd("src/github.com/tools/godep") { system "go", "build", "-o", bin/"godep" } end test do ENV["GOPATH"] = testpath.realpath (testpath/"Godeps/Godeps.json").write <<-EOS.undent { "ImportPath": "github.com/tools/godep", "GoVersion": "go1.8", "Deps": [ { "ImportPath": "golang.org/x/tools/cover", "Rev": "3fe2afc9e626f32e91aff6eddb78b14743446865" } ] } EOS system bin/"godep", "restore" assert_predicate testpath/"src/golang.org/x/tools/README", :exist?, "Failed to find 'src/golang.org/x/tools/README!' file" end end