aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/cloc.rb
blob: 33c18d4612f7d2d563126dad0a6feb16d401d048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Cloc < Formula
  homepage "http://cloc.sourceforge.net/"
  url "https://downloads.sourceforge.net/project/cloc/cloc/v1.62/cloc-1.62.pl"
  sha1 "78f6123c967f9b142f77cba48decd11d56ab6c38"

  def install
    bin.install "cloc-#{version}.pl" => "cloc"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      #include <stdio.h>
      int main(void) {
        return 0;
      }
    EOS

    assert_match "1,C,0,0,4", shell_output("#{bin}/cloc --csv .")
  end
end