aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/deheader.rb
blob: 1d14393bad054c9fbd9a52c3dd6e9f0da7068f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Deheader < Formula
  homepage "http://www.catb.org/~esr/deheader"
  url "http://www.catb.org/~esr/deheader/deheader-1.0.tar.gz"
  sha1 "dc9fc816af1631a84ace7f94a85a3a424d72dbed"
  head "https://git.gitorious.org/deheader/deheader.git"

  def install
    bin.install "deheader"
    man1.install "deheader.1"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      #include <stdio.h>
      #include <string.h>
      int main(void) {
        printf("%s", "foo");
        return 0;
      }
    EOS
    assert_equal "121", shell_output("deheader test.c | tr -cd 0-9")
  end
end