diff --git a/Formula/l/logalize.rb b/Formula/l/logalize.rb new file mode 100644 index 000000000000..759ca03f0d18 --- /dev/null +++ b/Formula/l/logalize.rb @@ -0,0 +1,39 @@ +class Logalize < Formula + desc "Fast and extensible log colorizer. Alternative to ccze" + homepage "https://github.com/deponian/logalize" + url "https://github.com/deponian/logalize.git", + tag: "v0.4.1", + revision: "2d74f36f36037d1a09371f044a85b2b8f192905f" + license "MIT" + head "https://github.com/deponian/logalize.git", branch: "main" + + depends_on "go" => :build + + def install + system "make", "VERSION=#{version}", "build" + bin.install "dist/#{version}/logalize" + + system "make", "VERSION=#{version}", "manpage" + man1.install "manpages/logalize.1.gz" + + system "make", "completions" + bash_completion.install "completions/logalize.bash" => "logalize" + zsh_completion.install "completions/logalize.zsh" => "_logalize" + fish_completion.install "completions/logalize.fish" + end + + test do + (testpath/".logalize.yaml").write <<~EOF + words: + good: + - hello + themes: + test: + words: + good: + fg: "#00ff00" + style: bold + EOF + assert_match "\e[;1mhello\e[0m\n", pipe_output("#{bin}/logalize -t test", "hello") + end +end