Skip to content

Commit

Permalink
cgrep 6.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dholm authored and MikeMcQuaid committed Jun 21, 2014
1 parent b30a027 commit 8afa5f4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Formula/cgrep.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8afa5f4

Please sign in to comment.