homebrew-core/Formula/git-review.rb

48 lines
1.7 KiB
Ruby
Raw Normal View History

require "formula"
class GitReview < Formula
homepage "https://git.openstack.org/cgit/openstack-infra/git-review"
url "https://pypi.python.org/packages/source/g/git-review/git-review-1.24.tar.gz"
sha1 "9183b505366b842cff32132ee88d8eff44bb7c89"
revision 1
2014-12-02 13:28:23 +00:00
bottle do
cellar :any
2015-03-14 22:16:45 +00:00
sha256 "a84e6f24cbcddb1f7516ce45cff341f2f70f17ebb7f3a4770ffea4dfd70823ab" => :yosemite
sha256 "6820a4fff886ccde7796f1550699fc7507b5b27bbfd222e2f11cc3f6d16a9539" => :mavericks
sha256 "08eebfba51435d1ab6ef64a5323d129d7bd0a94c0f8d98d75f205b9ccb291e3a" => :mountain_lion
2014-12-02 13:28:23 +00:00
end
depends_on :python if MacOS.version <= :snow_leopard
resource "requests" do
url "https://pypi.python.org/packages/source/r/requests/requests-2.6.0.tar.gz"
sha256 "1cdbed1f0e236f35ef54e919982c7a338e4fea3786310933d3a7887a04b74d75"
end
def install
ENV.prepend_create_path "PYTHONPATH", "#{libexec}/vendor/lib/python2.7/site-packages"
resource("requests").stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
ENV.prepend_create_path "PYTHONPATH", "#{libexec}/lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
man1.install gzip("git-review.1")
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
2014-12-02 14:30:14 +00:00
system "git", "init"
system "git", "remote", "add", "gerrit", "https://github.com/Homebrew/homebrew.github.io"
(testpath/".git/hooks/commit-msg").write "# empty - make git-review happy"
(testpath/"foo").write "test file"
system "git", "add", "foo"
system "git", "commit", "-m", "test"
system "#{bin}/git-review", "--dry-run"
end
end