homebrew-core/Formula/agg.rb

27 lines
941 B
Ruby
Raw Normal View History

class Agg < Formula
desc "Asciicast to GIF converter"
homepage "https://github.com/asciinema/agg"
url "https://github.com/asciinema/agg/archive/refs/tags/v1.2.0.tar.gz"
sha256 "2c7ba642dd84025b3df7b70f52ddde8e7ecf14499520a15af7db348a148ed604"
license "Apache-2.0"
head "https://github.com/asciinema/agg.git", branch: "main"
depends_on "rust" => :build
def install
system "cargo", "install", *std_cargo_args
end
test do
(testpath/"test.cast").write <<~EOS
{"version": 2, "width": 80, "height": 24, "timestamp": 1504467315, "title": "Demo", "env": {"TERM": "xterm-256color", "SHELL": "/bin/zsh"}}
[0.248848, "o", "\u001b[1;31mHello \u001b[32mWorld!\u001b[0m\n"]
[1.001376, "o", "That was ok\rThis is better."]
[2.143733, "o", " "]
[6.541828, "o", "Bye!"]
EOS
system bin/"agg", "--verbose", "test.cast", "test.gif"
assert_predicate testpath/"test.gif", :exist?
end
end