-
Notifications
You must be signed in to change notification settings - Fork 0
/
tala.rb
39 lines (35 loc) · 1.32 KB
/
tala.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
30
31
32
33
34
35
36
37
38
39
class Tala < Formula
desc "Advanced diagram layout engine for D2"
homepage "https://github.com/terrastruct/TALA"
version "0.4.1"
if OS.mac?
if RUBY_PLATFORM.include?("x86_64")
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-macos-amd64.tar.gz"
sha256 "bfdd168f44df344b34158306373b5c6b7451c4911a49390a514a8d7014b3ea16"
else
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-macos-arm64.tar.gz"
sha256 "46013f575b95e02fb5122fcbfc148870ac67ef9703a63ee24fdf9512336f6a3c"
end
else
if RUBY_PLATFORM.include?("x86_64")
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-linux-amd64.tar.gz"
sha256 "2e1d37c7ee3b8104aa64b9d7d906abf0d5b8aa147c4d6377c870e8555264f288"
else
url "https://github.com/terrastruct/tala/releases/download/v#{version}/tala-v#{version}-linux-arm64.tar.gz"
sha256 "791397f2facb5cfe59940e670e9074600cef99b7729b73383193c54e0d3adfb2"
end
end
depends_on "d2"
def install
system "make", "install", "PREFIX=#{prefix}"
end
test do
ENV["D2_LAYOUT"] = "tala"
system "#{bin}/d2plugin-tala", "--version"
example = testpath/"example.d2"
example.write <<~EOS
x -> y -> z
EOS
system "d2", "example.d2"
end
end