class DockerSquash < Formula desc "Docker image squashing tool" homepage "https://github.com/goldmann/docker-squash" url "https://github.com/goldmann/docker-squash/archive/1.0.6.tar.gz" sha256 "8430390edc2f19f368bacae57c17363bd64f76dbcd0cf00f4ec5ce6f8cbe9abd" bottle do cellar :any_skip_relocation sha256 "6efcced412dd3b8cd77ac3f22a025324d9db1490e21650c80dec1ae173c7fc5f" => :high_sierra sha256 "6efcced412dd3b8cd77ac3f22a025324d9db1490e21650c80dec1ae173c7fc5f" => :sierra sha256 "af38522bfcdf5259a5394090d1d208b33f6755519c15d07f7654360b69ed04b2" => :el_capitan end depends_on "python@2" if MacOS.version <= :snow_leopard depends_on "docker" => :recommended depends_on "docker-machine" => :recommended resource "pip" do url "https://files.pythonhosted.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz" sha256 "09f243e1a7b461f654c26a725fa373211bb7ff17a9300058b205c61658ca940d" end resource "setuptools" do url "https://files.pythonhosted.org/packages/6c/54/f7e9cea6897636a04e74c3954f0d8335cc38f7d01e27eec98026b049a300/setuptools-38.5.1.zip" sha256 "6425484c08e99a98a42209c25c3d325f749230b55284d66192784f941a7e6628" end resource "backports.ssl_match_hostname" do url "https://files.pythonhosted.org/packages/76/21/2dc61178a2038a5cb35d14b61467c6ac632791ed05131dda72c20e7b9e23/backports.ssl_match_hostname-3.5.0.1.tar.gz" sha256 "502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2" end resource "certifi" do url "https://files.pythonhosted.org/packages/23/3f/8be01c50ed24a4bd6b8da799839066ce0288f66f5e11f0367323467f0cbc/certifi-2017.11.5.tar.gz" sha256 "5ec74291ca1136b40f0379e1128ff80e866597e4e2c1e755739a913bbc3613c0" end resource "chardet" do url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz" sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" end resource "docker" do url "https://files.pythonhosted.org/packages/20/73/3bb05004dcc734182d57a1c8a802732e05788678a71bfa12348a614d5d73/docker-2.6.1.tar.gz" sha256 "6f417527b3cfd7ba1f5be5fb1d9a2500706b5968f66773131d81c18e19b7a325" end resource "docker-pycreds" do url "https://files.pythonhosted.org/packages/95/2e/3c99b8707a397153bc78870eb140c580628d7897276960da25d8a83c4719/docker-pycreds-0.2.1.tar.gz" sha256 "93833a2cf280b7d8abbe1b8121530413250c6cd4ffed2c1cf085f335262f7348" end resource "six" do url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz" sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" end resource "requests" do url "https://files.pythonhosted.org/packages/b0/e1/eab4fc3752e3d240468a8c0b284607899d2fbfb236a56b7377a329aa8d09/requests-2.18.4.tar.gz" sha256 "9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" end resource "urllib3" do url "https://files.pythonhosted.org/packages/ee/11/7c59620aceedcc1ef65e156cc5ce5a24ef87be4107c2b74458464e437a5d/urllib3-1.22.tar.gz" sha256 "cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f" end resource "websocket_client" do url "https://files.pythonhosted.org/packages/06/19/f00725a8aee30163a7f257092e356388443034877c101757c1466e591bf8/websocket_client-0.44.0.tar.gz" sha256 "15f585566e2ea7459136a632b9785aa081093064391878a448c382415e948d72" end resource "ipaddress" do url "https://files.pythonhosted.org/packages/4e/13/774faf38b445d0b3a844b65747175b2e0500164b7c28d78e34987a5bfe06/ipaddress-1.0.18.tar.gz" sha256 "5d8534c8e185f2d8a1fda1ef73f2c8f4b23264e8e30063feeb9511d492a413e1" end resource "idna" do url "https://files.pythonhosted.org/packages/f4/bd/0467d62790828c23c47fc1dfa1b1f052b24efdf5290f071c7a91d0d82fd3/idna-2.6.tar.gz" sha256 "2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f" end def install ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" resources.each do |r| 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}/docker-squash not_an_image 2>&1", 1) assert_match "Could not create Docker client", output end end