aboutsummaryrefslogtreecommitdiffstats
path: root/Formula/justify.rb
blob: 6f7327fbacfb9b7e811a84e454ebc05136acabd3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Justify < Formula
  desc "Format and justify text to a specified line width"
  homepage "https://github.com/eugenetriguba/justify"
  url "https://github.com/eugenetriguba/justify/archive/refs/tags/v0.1.3.tar.gz"
  sha256 "42aa1b4183e859400031d3dd83662563a0a10ce0e17a6663450f1429b69ad20f"
  license "MIT"

  depends_on "cmake" => :build

  def install
    system "cmake", "-B", "build", "-DCMAKE_BUILD_TYPE=Release", *std_cmake_args
    system "cmake", "--build", "build"
    bin.install "build/justify"
    man1.install "doc/justify.1"
  end

  test do
    (testpath/"input.txt").write("Hello world")
    assert_match "Hello world", shell_output("#{bin}/justify < input.txt")
  end
end