aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2014-05-26 13:15:10 +0800
committerMike McQuaid2014-06-05 16:19:41 +0100
commitf2b4b42e7d18bb53ea2b12305d6a862d569b430d (patch)
tree5445cb39131d5c0965703e1fa3e87bb81a9eedc4 /Library
parent775680fbac2a84dee1fab731fb98bc2e45689db3 (diff)
downloadhomebrew-f2b4b42e7d18bb53ea2b12305d6a862d569b430d.tar.bz2
cheat 2.0.9 (new formula)
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/cheat.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/Library/Formula/cheat.rb b/Library/Formula/cheat.rb
new file mode 100644
index 000000000..74b52527a
--- /dev/null
+++ b/Library/Formula/cheat.rb
@@ -0,0 +1,42 @@
+require "formula"
+
+class Cheat < Formula
+ homepage "https://github.com/chrisallenlane/cheat"
+ url "https://github.com/chrisallenlane/cheat/archive/2.0.9.tar.gz"
+ sha1 "cf4a76badd8d0e58c9299037703ba4abbd2217df"
+ head "https://github.com/chrisallenlane/cheat.git"
+
+ depends_on :python if MacOS.version <= :snow_leopard
+
+ resource "docopt" do
+ url "https://pypi.python.org/packages/source/d/docopt/docopt-0.6.1.tar.gz"
+ sha1 "3d0ad1cf495d2c801327042e02d67b4ee4b85cd4"
+ end
+
+ resource "Pygments" do
+ url "https://pypi.python.org/packages/source/P/Pygments/Pygments-1.6.tar.gz"
+ sha1 "53d831b83b1e4d4f16fec604057e70519f9f02fb"
+ end
+
+ def install
+ ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
+ ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
+
+ install_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
+
+ %w[docopt Pygments].each do |r|
+ resource(r).stage { system "python", *install_args }
+ end
+
+ system "python", "setup.py", "install", "--prefix=#{prefix}"
+
+ bash_completion.install "cheat/autocompletion/cheat.bash"
+ zsh_completion.install "cheat/autocompletion/cheat.zsh" => "_cheat"
+
+ bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
+ end
+
+ test do
+ system "#{bin}/cheat", "tar"
+ end
+end