From 51eecccac696c2ec1c269b29db6b20389dc83e3f Mon Sep 17 00:00:00 2001 From: Alexander Glushkov Date: Wed, 6 Jul 2011 01:38:00 +0300 Subject: [PATCH] search for bundle/snipmat.vim/snippets as a snippets dir --- Rakefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 15cece2..70350a0 100644 --- a/Rakefile +++ b/Rakefile @@ -4,8 +4,13 @@ namespace :snippets_dir do task :find do vim_dir = File.join(ENV['VIMFILES'] || ENV['HOME'] || ENV['USERPROFILE'], RUBY_PLATFORM =~ /mswin|msys|mingw32/ ? "vimfiles" : ".vim") - pathogen_dir = File.join(vim_dir, "bundle") - @snippets_dir = File.directory?(pathogen_dir) ? File.join(pathogen_dir, "snipmate", "snippets") : File.join(vim_dir, "snippets") + possible_dirs = [ + File.join(vim_dir, 'snippets'), + File.join(vim_dir, 'bundle', 'snipmate', 'snippets'), + File.join(vim_dir, 'bundle', 'snipmate.vim', 'snippets') + ] + + @snippets_dir = possible_dirs.find{ |dir| File.directory? dir } end desc "Purge the contents of the vim snippets directory"