2011-11-12 17:23:20 +00:00
|
|
|
class Bgrep < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Like grep but for binary strings"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "https://github.com/tmbinc/bgrep"
|
|
|
|
url "https://github.com/tmbinc/bgrep/archive/bgrep-0.2.tar.gz"
|
|
|
|
sha256 "24c02393fb436d7a2eb02c6042ec140f9502667500b13a59795388c1af91f9ba"
|
2015-12-08 23:34:24 +00:00
|
|
|
head "https://github.com/tmbinc/bgrep.git"
|
2011-11-12 17:23:20 +00:00
|
|
|
|
2015-10-07 05:43:03 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-09-28 16:56:36 +00:00
|
|
|
sha256 "eaed7c05fd07c77cd5aeb6f1232abcf5c9678b86fdaf7e7daf5049476acc690c" => :sierra
|
2015-10-07 05:43:03 +00:00
|
|
|
sha256 "29f0b2d7ab307eae228a03d4f42f677d9ff0884edc5c96771da36182cb592cd2" => :el_capitan
|
|
|
|
sha256 "af4dab94130c48930d064074da8492c5531842a348747b0dd39420db738f6ae9" => :yosemite
|
|
|
|
sha256 "b166d637dda09833c3b2c3396670347b087fef6366576303f87fb704b1d3eede" => :mavericks
|
|
|
|
end
|
|
|
|
|
2011-11-12 17:23:20 +00:00
|
|
|
def install
|
2015-10-05 12:03:06 +00:00
|
|
|
system ENV.cc, ENV.cflags, "-o", "bgrep", "bgrep.c"
|
2011-11-12 17:23:20 +00:00
|
|
|
bin.install "bgrep"
|
|
|
|
end
|
2014-02-06 20:05:53 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
path = testpath/"hi.prg"
|
2014-05-04 19:12:41 +00:00
|
|
|
path.binwrite [0x00, 0xc0, 0xa9, 0x48, 0x20, 0xd2, 0xff,
|
2016-08-04 10:12:57 +00:00
|
|
|
0xa9, 0x49, 0x20, 0xd2, 0xff, 0x60].pack("C*")
|
2014-02-06 20:05:53 +00:00
|
|
|
|
2015-12-08 23:34:24 +00:00
|
|
|
assert_equal "#{path}: 00000004\n#{path}: 00000009\n",
|
|
|
|
shell_output("#{bin}/bgrep 20d2ff #{path}")
|
2014-02-06 20:05:53 +00:00
|
|
|
end
|
2011-11-12 17:23:20 +00:00
|
|
|
end
|