From 8678c0c27678fc7f3f030dcdac0bc1333733aff0 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Mon, 2 May 2011 12:03:02 -0700 Subject: Add bash completion to R This is the same completion script that Debian includes in the r-base-core package. Signed-off-by: Adam Vandenberg --- Library/Formula/r.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/r.rb b/Library/Formula/r.rb index b035c83b6..fcdbc3f33 100644 --- a/Library/Formula/r.rb +++ b/Library/Formula/r.rb @@ -4,6 +4,13 @@ def valgrind? ARGV.include? '--with-valgrind' end +class RBashCompletion < Formula + # This is the same script that Debian packages use. + url 'http://rcompletion.googlecode.com/svn-history/r12/trunk/bash_completion/R', :using => :curl + version 'r12' + md5 '3c8f6cf1c07e052074ee843be00fa5d6' +end + class R < Formula url 'http://cran.r-project.org/src/base/R-2/R-2.13.0.tar.gz' homepage 'http://www.R-project.org/' @@ -50,6 +57,10 @@ class R < Formula ln_s prefix+"R.framework/Resources/bin/Rscript", bin ln_s prefix+"R.framework/Resources/man1/R.1", man1 ln_s prefix+"R.framework/Resources/man1/Rscript.1", man1 + + bash_dir = prefix + 'etc/bash_completion.d' + bash_dir.mkpath + RBashCompletion.new.brew { bash_dir.install 'R' } end def caveats; <<-EOS.undent -- cgit v1.2.3