diff options
| author | David Holm | 2014-06-21 10:38:24 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2014-06-21 14:42:03 +0100 |
| commit | 8d3e6a08ee1c7b9cb24e0d099cd78848ff8cfb48 (patch) | |
| tree | a02c7456369513e4f7bcdda9aedf044d9ac36a30 /Library/Formula/cgrep.rb | |
| parent | 311c206e82386107364cd0e6b042e88d87bd7a68 (diff) | |
| download | homebrew-8d3e6a08ee1c7b9cb24e0d099cd78848ff8cfb48.tar.bz2 | |
cgrep 6.4.2
Diffstat (limited to 'Library/Formula/cgrep.rb')
| -rw-r--r-- | Library/Formula/cgrep.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Library/Formula/cgrep.rb b/Library/Formula/cgrep.rb new file mode 100644 index 000000000..19c7c9725 --- /dev/null +++ b/Library/Formula/cgrep.rb @@ -0,0 +1,34 @@ +require "formula" +require "language/haskell" + +class Cgrep < Formula + include Language::Haskell::Cabal + + homepage "https://github.com/awgn/cgrep" + url "https://github.com/awgn/cgrep/archive/v6.4.2.tar.gz" + sha1 "209bc29721bcfdc5652839c54c89ceb2d5a86bf9" + head "https://github.com/awgn/cgrep.git", :branch => "master" + + depends_on "ghc" => :build + depends_on "cabal-install" => :build + + def install + install_cabal_package + end + + test do + test_string = "String in" + path = testpath/"test.rb" + path.write <<-EOS.undent + # puts #{test_string} comment. + puts "#{test_string} literal." + EOS + + comment = `cgrep --comment "#{test_string}" #{path}` + assert_equal 1, comment.lines.count + literal = `cgrep --literal "#{test_string}" #{path}` + assert_equal 1, literal.lines.count + code = `cgrep --code puts #{path}` + assert_equal 1, code.lines.count + end +end |
