diff --git a/Formula/hub.rb b/Formula/hub.rb index e3b04955f44..a091afc7d64 100644 --- a/Formula/hub.rb +++ b/Formula/hub.rb @@ -7,11 +7,22 @@ class Hub < Formula md5 'd3ff9bcf489466a408020867b77f1d4d' def install - system "rake", "install", "prefix=#{prefix}" + system rake_bin, "install", "prefix=#{prefix}" (prefix+'etc/bash_completion.d').install 'etc/hub.bash_completion.sh' (share+'zsh/site-functions').install 'etc/hub.zsh_completion' => '_hub' end + def rake_bin + require 'rbconfig' + ruby_rake = File.join RbConfig::CONFIG['bindir'], 'rake' + + if File.exist? ruby_rake + ruby_rake + else + '/usr/bin/rake' + end + end + def caveats; <<-EOS.undent Bash completion has been installed to: #{etc}/bash_completion.d