2017-10-24 03:31:23 +00:00
|
|
|
class GoJira < Formula
|
|
|
|
desc "Simple jira command-line client in Go"
|
|
|
|
homepage "https://github.com/Netflix-Skunkworks/go-jira"
|
2018-04-16 06:28:58 +00:00
|
|
|
url "https://github.com/Netflix-Skunkworks/go-jira/archive/v1.0.17.tar.gz"
|
|
|
|
sha256 "c1127af5ff8d19ab3f6b5bf424f262495143448608ec59beadcefb5e645feddb"
|
2017-10-24 03:31:23 +00:00
|
|
|
|
2017-11-02 17:36:42 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2018-04-16 07:05:25 +00:00
|
|
|
sha256 "998f112c60677a6148d494a228cb0c7ce52b1305ca592f390303aa4bbeafa1c3" => :high_sierra
|
|
|
|
sha256 "f69c2762ed8579b1e90039f87a4729e08713c44b3769a10a4d05ea39534532d6" => :sierra
|
|
|
|
sha256 "feac86e0055b80f2553211f21db03a8e56eb6e1f7e229afff6aa395c576a3aff" => :el_capitan
|
2017-11-02 17:36:42 +00:00
|
|
|
end
|
|
|
|
|
2017-10-24 03:31:23 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
dir = buildpath/"src/gopkg.in/Netflix-Skunkworks/go-jira.v1"
|
|
|
|
dir.install buildpath.children
|
|
|
|
|
|
|
|
cd dir do
|
|
|
|
system "go", "build", "-o", bin/"jira", "-ldflags", "-w -s", "cmd/jira/main.go"
|
|
|
|
prefix.install_metafiles
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/jira", "export-templates"
|
|
|
|
template_dir = testpath/".jira.d/templates/"
|
|
|
|
|
|
|
|
files = Dir.entries(template_dir)
|
|
|
|
# not an exhaustive list, see https://github.com/Netflix-Skunkworks/go-jira/blob/4d74554300fa7e5e660cc935a92e89f8b71012ea/jiracli/templates.go#L239
|
|
|
|
expected_templates = %w[comment components create edit issuetypes list view worklog debug]
|
|
|
|
|
|
|
|
assert_equal([], expected_templates - files)
|
2018-03-06 09:29:45 +00:00
|
|
|
assert_equal("{{ . | toJson}}\n", IO.read("#{template_dir}/debug"))
|
2017-10-24 03:31:23 +00:00
|
|
|
end
|
|
|
|
end
|