homebrew-core/Formula/cheat.rb
2016-04-25 14:44:19 +02:00

46 lines
1.7 KiB
Ruby

class Cheat < Formula
desc "Create and view interactive cheat sheets for *nix commands"
homepage "https://github.com/chrisallenlane/cheat"
url "https://github.com/chrisallenlane/cheat/archive/2.1.24.tar.gz"
sha256 "b8458cde6ded905d4ae7a24187936f52713286bfdc3942033149dd2f2a871869"
head "https://github.com/chrisallenlane/cheat.git"
bottle do
cellar :any_skip_relocation
sha256 "c3e7039546197e8747966f52338033d203db340fc3816d2c81588cb87316f622" => :el_capitan
sha256 "9dfbfa311c6a57b9071170229c0af543422e68cb6a974e4d630d52b166a4e4eb" => :yosemite
sha256 "bf4fbbbff20150fb796dffd28b8038be00fcfe76161dee5b067f64a2fbbf1065" => :mavericks
end
depends_on :python if MacOS.version <= :snow_leopard
resource "docopt" do
url "https://pypi.python.org/packages/source/d/docopt/docopt-0.6.2.tar.gz"
sha256 "49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
end
resource "Pygments" do
url "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.1.3.tar.gz"
sha256 "88e4c8a91b2af5962bfa5ea2447ec6dd357018e86e94c7d14bd8cacbc5b55d81"
end
def install
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
resources.each do |r|
r.stage { system "python", *Language::Python.setup_install_args(libexec) }
end
system "python", *Language::Python.setup_install_args(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