carlhuda/janus — pull request #308 by aniero (2011-12-04 23:07:40+00:00)
Title: [Experimental] Custom Rakefile support

### Subtitle: bringing back .janus.rake.

While the switch to Pathogen and submodules in the experimental branch is handy, I miss having a `.janus.rake` file. Without a separate file defining *my* extra plugins, I can't redistribute my submodule configuration and bootstrap onto new systems easily from my dotfiles repo. I could maintain a fork of janus, I suppose, but I'd rather use the original. So, here's my attempt at bringing back the `.janus.rake` file.

First, and I can open this as a separate bugfix / pull request, I had to fix the `.vimrc.after` load order, since it was being evaluated before the janus-specific settings plugin files were loaded, making it impossible to override the statusline etc.

I've re-added code to the Rakefile to load the `.janus.rake` file if present, and added a generic `plugin` method for use in the custom rake file for defining plugins, both as git submodules, and for curl / echo into files.

For example:

```ruby
plugin "camelcasemotion", "https://github.com/vim-scripts/camelcasemotion.git"
plugin "jasmine", "https://github.com/claco/jasmine.vim.git"

plugin "tabmerge" do
mkdir_p "plugin"
sh "curl 'http://www.vim.org/scripts/download_script.php?src_id=8828' > plugin/Tabmerge.vim"
end
```

For the first two, the `plugin` method will set up the git submodules for pathogen to use. The last one acts just like the original janus did, although it places everything into a pathogen-compatible `janus/vim/custom/tabmerge` directory.

I also added a helper, `always_update_submodules` to automatically enable `git pull` in all submodules when running `rake` (it just invokes the `dev:update_submodules` task), and a new rake task, `remove_submodule`, for easily removing a submodule when getting rid of a plugin you don't want anymore.