aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorDavid Larson2014-06-28 19:34:13 -0700
committerMike McQuaid2014-06-30 08:07:06 +0100
commit0641864c6f4f2495344ed0ab1762085badc79dc6 (patch)
treeb2411bd8d2f8814e4a385b4e8de26b735f3441d5 /Library/Formula
parentfc9b23b7a561df241f912b03dcfc898dff06aafa (diff)
downloadhomebrew-0641864c6f4f2495344ed0ab1762085badc79dc6.tar.bz2
the_platinum_searcher 1.6.4 (new formula)
`the_platinum_searcher` (`pt`) is code search tool, similar to `ack` and `the_silver_searcher` (`ag`), but is written in Go to enable easier multi-platform support.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/the_platinum_searcher.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/Library/Formula/the_platinum_searcher.rb b/Library/Formula/the_platinum_searcher.rb
new file mode 100644
index 000000000..418de40d7
--- /dev/null
+++ b/Library/Formula/the_platinum_searcher.rb
@@ -0,0 +1,34 @@
+require "formula"
+
+class ThePlatinumSearcher < Formula
+ homepage "https://github.com/monochromegane/the_platinum_searcher"
+ url "https://github.com/monochromegane/the_platinum_searcher/archive/v1.6.4.tar.gz"
+ sha1 "362df20068c9ea19dfb3126c267012356dc7958c"
+ head "https://github.com/monochromegane/the_platinum_searcher.git"
+
+ depends_on "go" => :build
+ depends_on :hg => :build
+
+ 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"
+ data = "Hello World!"
+ path.open("wb") { |f| f.write data}
+
+ lines = `#{bin}/pt 'Hello World!' #{path}`.strip.split(":")
+ assert_equal "Hello World!", lines[2]
+ end
+end