2009-12-11 16:13:57 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Hub < Formula
|
2013-07-13 01:22:29 +00:00
|
|
|
homepage 'http://hub.github.com/'
|
2014-07-11 19:09:00 +00:00
|
|
|
url 'https://github.com/github/hub/archive/v1.12.2.tar.gz'
|
|
|
|
sha1 '65359d3dcc8e1a0986aab3726f6047bfb9df3d7c'
|
2014-10-20 22:03:44 +00:00
|
|
|
|
|
|
|
head do
|
2014-12-03 22:44:40 +00:00
|
|
|
url "https://github.com/github/hub.git"
|
2014-10-20 22:03:44 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
end
|
2012-11-22 18:58:28 +00:00
|
|
|
|
2013-12-22 01:18:21 +00:00
|
|
|
option 'without-completions', 'Disable bash/zsh completions'
|
|
|
|
|
2009-12-11 16:13:57 +00:00
|
|
|
def install
|
2014-10-20 22:03:44 +00:00
|
|
|
if build.head?
|
|
|
|
system "script/build"
|
|
|
|
bin.install "hub"
|
|
|
|
else
|
|
|
|
rake "install", "prefix=#{prefix}"
|
|
|
|
end
|
2013-12-22 01:18:21 +00:00
|
|
|
|
|
|
|
if build.with? 'completions'
|
|
|
|
bash_completion.install 'etc/hub.bash_completion.sh'
|
|
|
|
zsh_completion.install 'etc/hub.zsh_completion' => '_hub'
|
|
|
|
end
|
2012-03-20 22:51:50 +00:00
|
|
|
end
|
|
|
|
|
2013-01-27 22:38:17 +00:00
|
|
|
test do
|
|
|
|
HOMEBREW_REPOSITORY.cd do
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "bin/brew", shell_output("#{bin}/hub ls-files -- bin").strip
|
2012-07-06 08:37:57 +00:00
|
|
|
end
|
|
|
|
end
|
2009-12-11 16:13:57 +00:00
|
|
|
end
|