TerminalImageViewer/tiv.rb

28 lines
784 B
Ruby
Raw Normal View History

2021-05-20 06:04:20 +02:00
class Tiv < Formula
2021-05-19 03:19:02 +02:00
desc "Display images in a terminal using block graphic characters"
homepage "https://github.com/stefanhaustein/TerminalImageViewer"
url "https://github.com/stefanhaustein/TerminalImageViewer/archive/refs/tags/v1.1.1.tar.gz"
sha256 "9a5f5c8688ef8db0e88dfcea6a1ae30da32268a7ab7972ff0de71955a75af0db"
license "Apache-2.0"
head "https://github.com/stefanhaustein/TerminalImageViewer.git", branch: "master"
2022-02-02 14:38:04 +01:00
2021-05-19 03:19:02 +02:00
depends_on "imagemagick"
2022-02-02 14:38:04 +01:00
on_linux do
depends_on "gcc"
end
fails_with gcc: "5"
2021-05-19 03:19:02 +02:00
def install
cd "src/main/cpp" do
system "make"
2021-05-19 03:19:02 +02:00
bin.install "tiv"
end
end
test do
2022-02-02 14:38:04 +01:00
assert_equal "\e[48;2;0;0;255m\e[38;2;0;0;255m \e[0m",
shell_output("#{bin}/tiv #{test_fixtures("test.png")}").strip
2021-05-19 03:19:02 +02:00
end
2022-02-02 14:38:04 +01:00
end