class ThePlatinumSearcher < Formula desc "Multi-platform code-search similar to ack and ag" homepage "https://github.com/monochromegane/the_platinum_searcher" url "https://github.com/monochromegane/the_platinum_searcher/archive/v2.1.5.tar.gz" sha256 "dfed3b92f35501d063a2c646d5dfd51f2ee12cee53dd9e1d04a6c7710b71050f" head "https://github.com/monochromegane/the_platinum_searcher.git" bottle do cellar :any_skip_relocation rebuild 1 sha256 "1df209ab319d3dda7050c4f9d63138712bba558193a08cf9bfb39bc06a7af3e4" => :high_sierra sha256 "bbba09f3a7c2c6af71c778d64a363297c3d4f3f01d99a076d6cf709fc65ac85d" => :sierra sha256 "f3eb248d0506445f80e1ed80ea52e255551612dbcf8e425024ad4dd4b94b849f" => :el_capitan end depends_on "go" => :build depends_on "godep" => :build def install ENV["GOPATH"] = buildpath dir = buildpath/"src/github.com/monochromegane/the_platinum_searcher" dir.install buildpath.children cd dir do system "godep", "restore" system "go", "build", "-o", bin/"pt", ".../cmd/pt" prefix.install_metafiles end end test do path = testpath/"hello_world.txt" path.write "Hello World!" lines = `#{bin}/pt 'Hello World!' #{path}`.strip.split(":") assert_equal "Hello World!", lines[2] end end