From 0e633749da1b4e09ff23469d8dcfb7a90225cd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohnic=CC=81?= Date: Fri, 6 Jul 2012 10:37:57 +0200 Subject: [PATCH] hub: use system rake to avoid RVM's Bundler integration Fixes defunkt/hub#205 Closes Homebrew/homebrew#13238. Signed-off-by: Adam Vandenberg --- Formula/hub.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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