38 lines
1.3 KiB
Ruby
38 lines
1.3 KiB
Ruby
class Heksa < Formula
|
|
desc "CLI hex dumper with colors"
|
|
homepage "https://github.com/raspi/heksa"
|
|
url "https://github.com/raspi/heksa.git",
|
|
tag: "v1.13.0",
|
|
revision: "4342bec6160ca58e90890e87f276044e7aca3831"
|
|
license "Apache-2.0"
|
|
head "https://github.com/raspi/heksa.git"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "c4e1fa619ea432a08a79cfcce85ec55ee1fc159ed7b1d46a798d2a0edae5e822"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "e48a732eb3825a7cbd0a2b96d6692592f9c15d365d964cce4bb8f92cba432a50"
|
|
sha256 cellar: :any_skip_relocation, catalina: "771946a21e72b9d5eea465ca9fd213615b0eba272820691905522bea993ce6a3"
|
|
sha256 cellar: :any_skip_relocation, mojave: "7592f466b87e68f8e4f4762bc0ed6cf14ac92a127ef6fdd0cfbe3d4fdb550b05"
|
|
sha256 cellar: :any_skip_relocation, high_sierra: "14394cbe0fe767fd205e96ec62b27e7223ad48231f61d30271b5516bc99e652a"
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
system "make", "build"
|
|
bin.install "bin/heksa"
|
|
end
|
|
|
|
test do
|
|
require "pty"
|
|
|
|
r, _w, pid = PTY.spawn("#{bin}/heksa -l 16 -f asc -o no #{test_fixtures("test.png")}")
|
|
|
|
# remove ANSI colors
|
|
output = r.read.gsub(/\e\[([;\d]+)?m/, "")
|
|
assert_match(/^.PNG/, output)
|
|
|
|
Process.wait(pid)
|
|
assert_equal 0, $CHILD_STATUS.exitstatus
|
|
end
|
|
end
|