Add Formula for ahoy: A tool for making cli apps from yaml configs.

See https://github.com/ahoy-cli/ahoy

Sponsored by Vimeo

Closes #36128.

Signed-off-by: Claudia <claui@users.noreply.github.com>
This commit is contained in:
Frank Carey 2019-01-17 15:41:52 -05:00 committed by Claudia
parent c65e2f83d9
commit 9877ab76a6
No known key found for this signature in database
GPG key ID: 246AC3C0F10BE51F

41
Formula/ahoy.rb Normal file
View file

@ -0,0 +1,41 @@
class Ahoy < Formula
desc "Creates self documenting CLI programs from commands in YAML files"
homepage "http://www.ahoycli.com/"
url "https://github.com/ahoy-cli/ahoy/archive/2.0.0.tar.gz"
sha256 "cc3e426083bf7b7309e484fa69ed53b33c9b00adf9be879cbe74c19bdaef027c"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
bin_path = buildpath/"src/github.com/ahoy-cli/ahoy"
bin_path.install Dir["*"]
cd bin_path do
system "go", "build", "-o", bin/"ahoy", "-ldflags", "-X main.version=#{version}", "."
end
end
def caveats; <<~EOS
===== UPGRADING FROM 1.x TO 2.x =====
If you are upgrading from ahoy 1.x, note that you'll
need to upgrade your ahoyapi settings in your .ahoy.yml
files to 'v2' instead of 'v1'.
See other changes at:
https://github.com/ahoy-cli/ahoy
EOS
end
test do
(testpath/".ahoy.yml").write <<~EOS
ahoyapi: v2
commands:
hello:
cmd: echo "Hello Homebrew!"
EOS
assert_equal "Hello Homebrew!\n", `#{bin}/ahoy hello`
end
end