forked from Homebrew/homebrew-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadr-tools.rb
29 lines (24 loc) · 838 Bytes
/
adr-tools.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class AdrTools < Formula
desc "CLI tool for working with Architecture Decision Records."
homepage "https://github.com/npryce/adr-tools"
url "https://github.com/npryce/adr-tools/archive/2.1.0.tar.gz"
sha256 "1ef028cfeaa1b262a5c62845aa8965be169705370983f9ff73b17ec77bf75f70"
bottle :unneeded
def install
config = buildpath/"src/adr-config"
# Unlink and re-write to matches homebrew's installation conventions
config.unlink
config.write <<-EOS.undent
#!/bin/bash
echo 'adr_bin_dir=\"#{bin}\"'
echo 'adr_template_dir=\"#{prefix}\"'
EOS
prefix.install Dir["src/*.md"]
bin.install Dir["src/*"]
end
test do
file = "0001-record-architecture-decisions.md"
assert_match file, shell_output("#{bin}/adr-init")
assert_match file, shell_output("#{bin}/adr-list")
end
end