aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/hub.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/Library/Formula/hub.rb b/Library/Formula/hub.rb
index e3b04955f..a091afc7d 100644
--- a/Library/Formula/hub.rb
+++ b/Library/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