aboutsummaryrefslogtreecommitdiffstats
path: root/Formula/justify.rb
blob: 5701e70cb8acdd7c7bc0e40c9128d54a6168ebf2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Justify < Formula
  desc "Format and justify text to a specified line width"
  homepage "https://git.sr.ht/~eugenetriguba/justify"
  url "https://git.sr.ht/~eugenetriguba/justify/archive/46d26b24a1abd7c501967278a1df628e929205ca.tar.gz"
  version "0.1.3"
  sha256 "7cd4cb65e95554b532008facececca9818ff1d1ec3ab4281424ace5a08e4b3ab"
  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