class Godep < Formula desc "Dependency tool for go" homepage "https://godoc.org/github.com/tools/godep" url "https://github.com/tools/godep/archive/v80.tar.gz" sha256 "029adc1a0ce5c63cd40b56660664e73456648e5c031ba6c214ba1e1e9fc86cf6" revision 18 head "https://github.com/tools/godep.git" bottle do cellar :any_skip_relocation sha256 "64e8181653da8e688ed5d51aa3f22afced42f29d8b2e79fe49b8753581cc7abc" => :mojave sha256 "6dfd9d4555c93f91f790d01419c223864238124909f527911f80126131c9310c" => :high_sierra sha256 "63b559550d66b410f877aad0b3c87bfd8aa737d7481a118ea1d7eb04c2b8f8e7" => :sierra end depends_on "go" def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/tools/godep").install buildpath.children cd "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