Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
Last active January 3, 2016 15:32
Show Gist options
  • Select an option

  • Save mrrooijen/a2fa17aba564820f5231 to your computer and use it in GitHub Desktop.

Select an option

Save mrrooijen/a2fa17aba564820f5231 to your computer and use it in GitHub Desktop.
Homebrew Cloc formula with --HEAD support.
class Cloc < Formula
desc "Statistics utility to count lines of code"
homepage "https://github.com/AlDanial/cloc/"
url "https://github.com/AlDanial/cloc/releases/download/1.64/cloc-1.64.pl"
sha256 "79edea7ea1f442b1632001e23418193ae4571810e60de8bd25e491036d60eb3d"
head "https://github.com/AlDanial/cloc.git"
bottle :unneeded
def install
if build.stable?
bin.install "cloc-#{version}.pl" => "cloc"
end
if build.head?
bin.install "cloc"
end
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
brew install --HEAD https://gist.githubusercontent.com/meskyanichi/a2fa17aba564820f5231/raw/eb548d450d6c12b29e0500dc5a1376f527ec80ac/cloc.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment