2014-06-21 08:38:24 +00:00
|
|
|
require "language/haskell"
|
|
|
|
|
|
|
|
class Cgrep < Formula
|
|
|
|
include Language::Haskell::Cabal
|
|
|
|
|
|
|
|
homepage "https://github.com/awgn/cgrep"
|
2015-01-27 09:07:03 +00:00
|
|
|
url "https://github.com/awgn/cgrep/archive/v6.4.12.tar.gz"
|
|
|
|
sha1 "4933c1ae055d5c04f567c9405339ce4f972ef62b"
|
2014-12-03 22:44:40 +00:00
|
|
|
head "https://github.com/awgn/cgrep.git"
|
2014-06-21 08:38:24 +00:00
|
|
|
|
2014-06-21 13:24:52 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-01-27 09:46:16 +00:00
|
|
|
sha1 "f3879496816cd421a874c0c13f11749c2816bccc" => :yosemite
|
|
|
|
sha1 "935e68c7447007ddcffe49f48c4ceb9bab69a362" => :mavericks
|
|
|
|
sha1 "a446389f7b1977bf49b7ede278e731934659a647" => :mountain_lion
|
2014-06-21 13:24:52 +00:00
|
|
|
end
|
|
|
|
|
2014-06-21 08:38:24 +00:00
|
|
|
depends_on "ghc" => :build
|
|
|
|
depends_on "cabal-install" => :build
|
2014-07-21 18:07:23 +00:00
|
|
|
depends_on "gmp"
|
2014-06-21 08:38:24 +00:00
|
|
|
|
|
|
|
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
|