class OpenshiftCli < Formula desc "OpenShift command-line interface tools" homepage "https://www.openshift.com/" url "https://github.com/openshift/origin.git", :tag => "v1.2.0", :revision => "2e62fabf9639c792410e98a9a1414937d4b786c9" head "https://github.com/openshift/origin.git" bottle do cellar :any_skip_relocation sha256 "cc52088d75660ee5d386ff75ac2d41a7e8cc2d336d90cf22bb2e1f8c19ffe29f" => :el_capitan sha256 "a8639329e7d86ffa5dcc9ef4a6077304a5d3c5699feba188983f9d7ca3451262" => :yosemite sha256 "f270ff2b41dfb00201066e2730f60abc0fa1f271a91c3de931eadb90f2ce9d78" => :mavericks end depends_on "go" => :build def install # this is necessary to avoid having the version marked as dirty (buildpath/".git/info/exclude").atomic_write "/.brew_home" system "make", "all", "WHAT=cmd/openshift", "GOFLAGS=-v", "OS_OUTPUT_GOPATH=1" arch = MacOS.prefer_64_bit? ? "amd64" : "x86" bin.install "_output/local/bin/darwin/#{arch}/openshift" bin.install_symlink "openshift" => "oc" bin.install_symlink "openshift" => "oadm" bash_completion.install Dir["contrib/completions/bash/*"] end test do assert_match /^oc v#{version}$/, shell_output("#{bin}/oc version") assert_match /^oadm v#{version}$/, shell_output("#{bin}/oadm version") assert_match /^openshift v#{version}$/, shell_output("#{bin}/openshift version") end end