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 1 head "https://github.com/tools/godep.git" bottle do cellar :any_skip_relocation sha256 "1a05b356c49868e120909ae04769dca1b3acbdf896f26b1057e3b9669c368004" => :high_sierra sha256 "9b7011920cf9878c063aeb241690fd58dae8f7c1c5e87d5e43fed9a6212d97f7" => :sierra sha256 "a03c372636c38c891ffcd65cb2167bd24752f878ad83be48de38c6d25c9494ae" => :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