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 1 head "https://github.com/tools/godep.git" bottle do cellar :any_skip_relocation sha256 "b95f7d571487a25827e078c0540a50769b113ba38c9036f31dc03fc38095b301" => :sierra sha256 "8ecef19b29c614746ee6a53e016b913e1eb690ec979c77ccc8df716fcaa45919" => :el_capitan sha256 "46f1d914fb950c44bcddde06f34f1b556105f2109243169765560c6b099f9bde" => :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 File.exist?("src/golang.org/x/tools/README"), "Failed to find 'src/golang.org/x/tools/README!' file" end end