Skip to content

Commit

Permalink
Add bundler.vim support
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Aug 22, 2011
1 parent d894e24 commit 744a258
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.markdown
Expand Up @@ -5,7 +5,8 @@ With rake.vim, you can use all those parts of
[rails.vim](https://github.com/tpope/vim-rails) that you wish you could
use on your other Ruby projects on anything with a `Rakefile`, including
`:R`/`:A`, `:Rlib` and friends, and of course `:Rake`. It's great when
paired with `gem open` and `bundle open`.
paired with `gem open` and `bundle open` and complemented nicely by
[bundler.vim](https://github.com/tpope/vim-bundler).

Installation
------------
Expand Down
3 changes: 2 additions & 1 deletion doc/rake.txt
Expand Up @@ -18,7 +18,8 @@ COMMANDS *rake-commands*

*rake-:Rake*
:Rake [task] Invoke |:make| followed by |:cwindow| with rake as the
'makeprg'.
'makeprg'. Uses `bundle exec rake` if bundler.vim is
installed and active for the current project.

*rake-:Rcd*
:Rcd [directory] |:cd| relative to the project.
Expand Down
6 changes: 5 additions & 1 deletion plugin/rake.vim
Expand Up @@ -273,7 +273,11 @@ function! s:Rake(bang,arg)
let old_errorformat = &l:errorformat
call s:push_chdir()
try
let &l:makeprg = 'rake'
if exists('b:bundle_root') && b:bundle_root == s:project().path()
let &l:makeprg = 'bundle exec rake'
else
let &l:makeprg = 'rake'
endif
let &l:errorformat = '%D(in\ %f),'
\.'%\\s%#from\ %f:%l:%m,'
\.'%\\s%#from\ %f:%l:,'
Expand Down

0 comments on commit 744a258

Please sign in to comment.