From 7860e8fd299bf795b290e7630a506dee36ed57a4 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Wed, 19 May 2021 09:19:02 +0800 Subject: [PATCH] Create tiv.rb --- tiv.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tiv.rb diff --git a/tiv.rb b/tiv.rb new file mode 100644 index 0000000..dbd158e --- /dev/null +++ b/tiv.rb @@ -0,0 +1,23 @@ +class tiv < Formula + desc "Display images in a terminal using block graphic characters" + homepage "https://github.com/stefanhaustein/TerminalImageViewer" + url "https://github.com/stefanhaustein/TerminalImageViewer/archive/v1.1.0.tar.gz" + sha256 "727ddaa048643cb0a13e23bc308415060d99d8b1853883ad339ad7b952050d61" + head "https://github.com/stefanhaustein/TerminalImageViewer.git" + depends_on "gcc" => :build unless OS.linux? + depends_on "imagemagick" + + def install + cd "src/main/cpp" do + system "make" + bin.install "tiv" + end + end + + test do + # Downloads a public domain test file from wikimedia commons and displays it. + # NOTE: Test will fail. Will fix when I get to my mac. + assert_equal "", + shell_output("#{bin}/tiv -0 -w 400 -h 400 https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png").strip + end +end