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 9 head "https://github.com/tools/godep.git" bottle do cellar :any_skip_relocation sha256 "8ccc6111eaf10695144664eb8198a58f1489352b1137a96b753a25fb9fba1c7f" => :high_sierra sha256 "010361b4b542221961e99acfbb23182e17bac2c3114729a0eefac58a0c0bf4e5" => :sierra sha256 "5dafe066854ef1ce180e992da2f46681335c9985312528ac4aab3d8267a9605a" => :el_capitan end depends_on "go" def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/tools/godep").install buildpath.children cd buildpath/"src/github.com/tools/godep" do system "go", "build", "-o", bin/"godep" prefix.install_metafiles end end test do ENV["GOPATH"] = testpath.realpath (testpath/"Godeps/Godeps.json").write <<~EOS { "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