From 4491dfec6f2bc0f4aec01d4067f099918d4717e5 Mon Sep 17 00:00:00 2001 From: Denis Gladkikh Date: Mon, 22 Jun 2015 09:35:58 -0700 Subject: [PATCH] gotags 1.3.0 (new formula) Closes Homebrew/homebrew#40979. Signed-off-by: Mike McQuaid --- Formula/gotags.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Formula/gotags.rb diff --git a/Formula/gotags.rb b/Formula/gotags.rb new file mode 100644 index 0000000000..70560b9cb5 --- /dev/null +++ b/Formula/gotags.rb @@ -0,0 +1,29 @@ +class Gotags < Formula + desc "ctags-compatible tag generator for Go" + homepage "https://github.com/jstemmer/gotags" + url "https://github.com/jstemmer/gotags/archive/v1.3.0.tar.gz" + sha256 "414e1f96b560b089f11f814cd9000974a8ee376bb2cd9119cce60368e89ba226" + + head "https://github.com/jstemmer/gotags.git" + + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + + system "go", "build", "-o", "gotags" + bin.install "gotags" + end + + test do + (testpath/"test.go").write <<-EOS.undent + package main + + type Foo struct { + Bar int + } + EOS + + assert_match (/^Bar.*test.go.*$/), shell_output("#{bin}/gotags #{testpath}/test.go") + end +end