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 11 head "https://github.com/tools/godep.git" bottle do cellar :any_skip_relocation sha256 "42c48bf1e0443485d7de7d6fe5b9437ca354ed4c69eedf1c8a698e6bbae98054" => :mojave sha256 "a8298d77b5f62d90cc53aa6fda7d081afe76f9f982a14ba36d1af3ff210fdc62" => :high_sierra sha256 "b0539e936d021048221a0b1ad86701186a705bd4ab4ec68966d8219292382dab" => :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