homebrew-core/Formula/t-rec.rb

34 lines
1.2 KiB
Ruby

class TRec < Formula
desc "Blazingly fast terminal recorder that generates animated gif images for the web"
homepage "https://github.com/sassman/t-rec-rs"
url "https://github.com/sassman/t-rec-rs/archive/v0.2.2.tar.gz"
sha256 "57c89a5befeaab63201ee45f47d08a1fe3861947478c729a6f4a9318613e01fa"
license "GPL-3.0-only"
bottle do
cellar :any_skip_relocation
sha256 "c895fe703a54317c8a9fbeabadf8bbf1910c18f7f7163a818796d5d70c7ace10" => :big_sur
sha256 "6039e8741541b9e2a63e98f144f6ed400389d276c8bbba651b0a407fbff9fca4" => :catalina
sha256 "83733e285f7bb41e547e117e6e8ee8a5d1a7b1dda87e322006826c0b55fc41e6" => :mojave
end
depends_on "rust" => :build
depends_on "imagemagick"
def install
system "cargo", "install", *std_cargo_args
end
test do
# let's fetch the window id
o = shell_output("#{bin}/t-rec -l | tail -1").strip
win_id = o.split(/\s|\n/)[-1]
# verify that it's an appropriate id
assert_equal win_id && Integer(win_id).positive?, true
# verify also error behaviour, as suggested
o = shell_output("WINDOWID=999999 #{bin}/t-rec 2>&1", 1).strip
assert_equal "Error: Cannot grab screenshot from CGDisplay of window id 999999", o
end
end