2014-06-29 02:34:13 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class ThePlatinumSearcher < Formula
|
|
|
|
homepage "https://github.com/monochromegane/the_platinum_searcher"
|
2014-07-16 05:13:12 +00:00
|
|
|
url "https://github.com/monochromegane/the_platinum_searcher/archive/v1.6.5.tar.gz"
|
|
|
|
sha1 "51658e4825b5f719fb37072da1b5035b5fde5734"
|
2014-06-29 02:34:13 +00:00
|
|
|
head "https://github.com/monochromegane/the_platinum_searcher.git"
|
|
|
|
|
|
|
|
depends_on "go" => :build
|
|
|
|
depends_on :hg => :build
|
|
|
|
|
2014-06-30 07:05:12 +00:00
|
|
|
bottle do
|
2014-07-16 05:21:18 +00:00
|
|
|
revision 1
|
|
|
|
sha1 "9e69bb5e18cacc5f6e4e9fc07ef31bd54a875b08" => :mavericks
|
|
|
|
sha1 "2443a197a960177d7a38930f82b209f8e3ce7c56" => :mountain_lion
|
|
|
|
sha1 "b97b398a0622bb48f31cf6cfd7905354a223912e" => :lion
|
2014-06-30 07:05:12 +00:00
|
|
|
end
|
|
|
|
|
2014-06-29 02:34:13 +00:00
|
|
|
def install
|
|
|
|
(buildpath + "src/github.com/monochromegane/the_platinum_searcher").install "search"
|
|
|
|
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
|
|
|
|
system "go", "get", "github.com/shiena/ansicolor"
|
|
|
|
system "go", "get", "github.com/monochromegane/terminal"
|
|
|
|
system "go", "get", "github.com/jessevdk/go-flags"
|
|
|
|
system "go", "get", "code.google.com/p/go.text/transform"
|
|
|
|
|
|
|
|
system "go", "build", "-o", "pt"
|
|
|
|
bin.install "pt"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
path = testpath/"hello_world.txt"
|
2014-07-16 21:50:31 +00:00
|
|
|
path.write "Hello World!"
|
2014-06-29 02:34:13 +00:00
|
|
|
|
2014-07-07 20:08:15 +00:00
|
|
|
lines = `#{bin}/pt 'Hello World!' #{path}`.strip.split(":")
|
|
|
|
assert_equal "Hello World!", lines[2]
|
2014-06-29 02:34:13 +00:00
|
|
|
end
|
|
|
|
end
|