class BunyanView < Formula desc "A full-featured Rust port of the Node Bunyan structured log file viewer" homepage "https://github.com/dekobon/bunyan-view" version "$VERSION" package_name = "$PACKAGE_NAME" src_repo = "$SRC_REPO" if OS.mac? and Hardware::CPU.intel? url "#{src_repo}/releases/download/v#{version}/#{package_name}_v#{version}_x86_64-apple-darwin.tar.gz" sha256 "$X86_64_APPLE_DARWIN_SHA256" elsif OS.mac? and Hardware::CPU.arm? url "#{src_repo}/releases/download/v#{version}/#{package_name}_#{version}_aarch64-apple-darwin.tar.gz" sha256 "$AARCH64_APPLE_DARWIN_SHA256" elsif OS.linux? and Hardware::CPU.intel? url "#{src_repo}/releases/download/v#{version}/#{package_name}_#{version}_x86_64-unknown-linux-gnu.tar.gz" sha256 "$X86_64_UNKNOWN_LINUX_GNU_SHA256" elsif OS.linux? and Hardware::CPU.arm? and Hardware::CPU.is_64_bit? url "#{src_repo}/releases/download/v#{version}/#{package_name}_#{version}_aarch64-unknown-linux-gnu.tar.gz" sha256 "$AARCH64_UNKNOWN_LINUX_GNU_SHA256" else odie "Unsupported architecture" end def install bin.install "bunyan" man1.install "bunyan.1.gz" end end