homebrew-core/Formula/httpie.rb
2016-07-02 18:18:00 +01:00

48 lines
2 KiB
Ruby

class Httpie < Formula
desc "User-friendly cURL replacement (command-line HTTP client)"
homepage "http://httpie.org/"
url "https://pypi.python.org/packages/70/91/47c81b650d3cf33e7e9e639c315903947466a1993053fe1ff019f555ca97/httpie-0.9.4.tar.gz"
sha256 "0fc288a85d6c018c64bbc86dfcc9c7fad063e79816840dfa91e8d6c43654761e"
head "https://github.com/jkbrzt/httpie.git"
bottle do
cellar :any_skip_relocation
sha256 "662e9987043a318140ac5f0240c490289594e0ab0eab49f998bd03e432141b6a" => :el_capitan
sha256 "a6f6d82d541e0ecb5aedd5e47ae472c4fcdb833177476559d7156f01afba9709" => :yosemite
sha256 "3b11b0441754a8c40bc550ba7f269d2d959210b69406f159c4e37ae9e62c205a" => :mavericks
end
depends_on :python3
resource "pygments" do
url "https://pypi.python.org/packages/b8/67/ab177979be1c81bc99c8d0592ef22d547e70bb4c6815c383286ed5dec504/Pygments-2.1.3.tar.gz"
sha256 "88e4c8a91b2af5962bfa5ea2447ec6dd357018e86e94c7d14bd8cacbc5b55d81"
end
resource "requests" do
url "https://pypi.python.org/packages/49/6f/183063f01aae1e025cf0130772b55848750a2f3a89bfa11b385b35d7329d/requests-2.10.0.tar.gz"
sha256 "63f1815788157130cee16a933b2ee184038e975f0017306d723ac326b5525b54"
end
def install
pyver = Language::Python.major_minor_version "python3"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{pyver}/site-packages"
%w[pygments requests].each do |r|
resource(r).stage do
system "python3", *Language::Python.setup_install_args(libexec/"vendor")
end
end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{pyver}/site-packages"
system "python3", *Language::Python.setup_install_args(libexec)
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
raw_url = "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/httpie.rb"
assert_match "PYTHONPATH", shell_output("#{bin}/http --ignore-stdin #{raw_url}")
end
end