require "language/go" class Gauge < Formula desc "Test automation tool that supports executable documentation" homepage "http://getgauge.io" url "https://github.com/getgauge/gauge/archive/v0.5.0.tar.gz" sha256 "be7ed28de6f478ca08c361618e22226d73a84a5b679403ebdd21a4d8bfbb4dcd" head "https://github.com/getgauge/gauge.git" bottle do cellar :any_skip_relocation sha256 "1bb93557140d17321f4eabedc08e89f47f114856947b1e3f41a199a9f5983a11" => :el_capitan sha256 "4681d2a182665e0589b4343496ad87ddeb937f74ca973eeea882a68104dabd0c" => :yosemite sha256 "ff77e91da209db15a31193ef43c8c0502accf46384cf02c2901d63f973520d0d" => :mavericks end depends_on "go" => :build depends_on "godep" => :build go_resource "github.com/getgauge/gauge_screenshot" do url "https://github.com/getgauge/gauge_screenshot.git", :revision => "d04c2acc873b408211df8408f0217d4eafd327fe" end def install ENV["GOPATH"] = buildpath # Avoid executing `go get` inreplace "build/make.go", /\tgetGaugeScreenshot\(\)\n/, "" dir = buildpath/"src/github.com/getgauge/gauge" dir.install buildpath.children ln_s buildpath/"src", dir Language::Go.stage_deps resources, buildpath/"src" ln_s "gauge_screenshot", "src/github.com/getgauge/screenshot" cd dir do system "godep", "restore" system "go", "run", "build/make.go" system "go", "run", "build/make.go", "--install", "--prefix", prefix end end test do assert_match version.to_s, shell_output("#{bin}/gauge -v") end end