class Hub < Formula desc "Add GitHub support to git on the command-line" homepage "https://hub.github.com/" url "https://github.com/github/hub/archive/v2.6.0.tar.gz" sha256 "c4df5ce953aa5dd5c4fa57ada96559b4b76bbd30a9e961e10e881be869cf4f2c" head "https://github.com/github/hub.git" bottle do cellar :any_skip_relocation sha256 "5cf7e0ce208621db5d7f34befbf99dae405d00a1d70c43572afa1a0b4e843359" => :mojave sha256 "6abd961ef398b2f99b79f97ad6a574279473402e4533da34880092cfb8a66951" => :high_sierra sha256 "96ebcd7cc838502eb823af6a40520847b88cecc70a2d2b1565ce09bb2c5cac7e" => :sierra end depends_on "go" => :build # System Ruby uses old TLS versions no longer supported by RubyGems. depends_on "ruby" => :build if MacOS.version <= :sierra def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/github/hub").install buildpath.children cd "src/github.com/github/hub" do begin deleted = ENV.delete "SDKROOT" ENV["GEM_HOME"] = buildpath/"gem_home" system "gem", "install", "bundler" ENV.prepend_path "PATH", buildpath/"gem_home/bin" system "make", "man-pages" ensure ENV["SDKROOT"] = deleted end system "make", "install", "prefix=#{prefix}" prefix.install_metafiles bash_completion.install "etc/hub.bash_completion.sh" zsh_completion.install "etc/hub.zsh_completion" => "_hub" fish_completion.install "etc/hub.fish_completion" => "hub.fish" end end test do system "git", "init" %w[haunted house].each { |f| touch testpath/f } system "git", "add", "haunted", "house" system "git", "commit", "-a", "-m", "Initial Commit" assert_equal "haunted\nhouse", shell_output("#{bin}/hub ls-files").strip end end