homebrew-core/Formula/cgrep.rb

43 lines
1.2 KiB
Ruby
Raw Normal View History

2014-06-21 08:38:24 +00:00
require "language/haskell"
class Cgrep < Formula
include Language::Haskell::Cabal
desc "Context-aware grep for source code"
2014-06-21 08:38:24 +00:00
homepage "https://github.com/awgn/cgrep"
url "https://github.com/awgn/cgrep/archive/v6.5.10.tar.gz"
sha256 "a83b099e4fcccc886dcbbd4e9400f68c04ad0385f3b24b1a454e2fbf4bba5e41"
2014-12-03 22:44:40 +00:00
head "https://github.com/awgn/cgrep.git"
2014-06-21 08:38:24 +00:00
bottle do
2015-11-17 11:28:59 +00:00
sha256 "1191b0ff23a78058a6b85c66c1f0d0715c8894e242d7e760d49c9e146324e974" => :el_capitan
sha256 "54ffbd47e3f17bcc14910d66104e843f532cd982767e9005c5542e2fbaa4936b" => :yosemite
sha256 "2463d1e60d5f57a4d141eae5ca204a2c844096f79b5fc1a434a081bdbb4713c8" => :mavericks
end
2014-06-21 08:38:24 +00:00
depends_on "ghc" => :build
depends_on "cabal-install" => :build
depends_on "pcre"
2014-06-21 08:38:24 +00:00
setup_ghc_compilers
2014-06-21 08:38:24 +00:00
def install
install_cabal_package
2014-06-21 08:38:24 +00:00
end
test do
path = testpath/"test.rb"
path.write <<-EOS.undent
# puts test comment.
puts "test literal."
2014-06-21 08:38:24 +00:00
EOS
assert_match ":1",
shell_output("script -q /dev/null #{bin}/cgrep --count --comment test #{path}")
assert_match ":1",
shell_output("script -q /dev/null #{bin}/cgrep --count --literal test #{path}")
assert_match ":1",
shell_output("script -q /dev/null #{bin}/cgrep --count --code puts #{path}")
2014-06-21 08:38:24 +00:00
end
end