47 lines
1.6 KiB
Ruby
47 lines
1.6 KiB
Ruby
class Httpie < Formula
|
|
homepage "https://github.com/jakubroztocil/httpie"
|
|
url "https://github.com/jakubroztocil/httpie/archive/0.8.0.tar.gz"
|
|
sha1 "bfffe9d782a896ca57f3dafef3d02bf81a07e5a8"
|
|
|
|
head "https://github.com/jakubroztocil/httpie.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
revision 2
|
|
sha1 "c9101c6d2acadf79f9deed22e4dbd9488f82136a" => :yosemite
|
|
sha1 "b1dc7275b82ae7444be68df3d10b3edd9f7e0c34" => :mavericks
|
|
sha1 "b6da6d0dd125252c75be5cbd5a6cf2a56f3e5461" => :mountain_lion
|
|
end
|
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
resource "pygments" do
|
|
url "https://pypi.python.org/packages/source/P/Pygments/Pygments-1.6.tar.gz"
|
|
sha1 "53d831b83b1e4d4f16fec604057e70519f9f02fb"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://pypi.python.org/packages/source/r/requests/requests-2.3.0.tar.gz"
|
|
sha1 "f57bc125d35ec01a81afe89f97dc75913a927e65"
|
|
end
|
|
|
|
def install
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
|
|
%w[pygments requests].each do |r|
|
|
resource(r).stage do
|
|
system "python", *Language::Python.setup_install_args(libexec/"vendor")
|
|
end
|
|
end
|
|
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
|
|
system "python", *Language::Python.setup_install_args(libexec)
|
|
|
|
bin.install Dir["#{libexec}/bin/*"]
|
|
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
|
|
end
|
|
|
|
test do
|
|
output = shell_output("#{bin}/http https://raw.githubusercontent.com/Homebrew/homebrew/master/Library/Formula/httpie.rb")
|
|
assert output.include?("PYTHONPATH")
|
|
end
|
|
end
|