-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
79 lines (64 loc) · 2.94 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
require 'pathname'
task :default do
puts "update the bundles:"
puts # blank line
puts " $ rake update:bundles"
end
namespace :update do
BUNDLES = {
# plugins
:ack => "git://github.com/mileszs/ack.vim.git",
:bufexplorer => "http://www.vim.org/scripts/download_script.php?src_id=14208",
:fugitive => "git://github.com/tpope/vim-fugitive.git",
:nerdcommenter => "git://github.com/scrooloose/nerdcommenter.git",
:nerdtree => "git://github.com/scrooloose/nerdtree.git",
:ragtag => "git://github.com/tpope/vim-ragtag.git",
:rails => "git://github.com/tpope/vim-rails.git",
:ruby_refactoring => "git://github.com/ecomba/vim-ruby-refactoring.git",
:snipmate => "git://github.com/msanders/snipmate.vim.git",
:snipmate_snippets => "[email protected]:amerine/snipmate-snippets.git",
:specky => "git://github.com/vim-scripts/Specky.git",
:surround => "git://github.com/tpope/vim-surround.git",
:tabular => "git://github.com/godlygeek/tabular",
:taglist => "http://www.vim.org/scripts/download_script.php?src_id=7701",
:textobj_user => "git://github.com/kana/vim-textobj-user.git",
:textobj_rubyblock => "git://github.com/nelstrom/vim-textobj-rubyblock.git",
# syntax definitions
:syntax_git => "git://github.com/tpope/vim-git.git",
:syntax_haml => "git://github.com/tpope/vim-haml.git",
:syntax_html5 => "git://github.com/othree/html5-syntax.vim.git",
:syntax_json => "git://github.com/leshill/vim-json.git",
:syntax_markdown => "git://github.com/ujihisa/vim-markdown.git",
:syntax_rdoc => "git://github.com/hallison/vim-rdoc.git",
:syntax_textile => "git://github.com/timcharper/textile.vim.git"
}
desc "update any bundles defined in the Rakefile"
task :bundles do
bundle_home = Pathname.new( ENV['HOME'] ) + '.vim' + 'bundle'
mkdir_p bundle_home
BUNDLES.sort_by {|k,v| k.to_s }.each do |bundle, location|
target_path = bundle_home + bundle.to_s
puts "*" * 72
puts "*** Instaling #{bundle} to #{target_path} from #{location}"
puts # blank line
rm_rf target_path
case location.match( /^(.*?):/ )[1]
when 'git'
sh "git clone #{location} #{target_path} > /dev/null"
rm_rf target_path + '.git'
when 'http'
mkdir_p target_path
sh "cd #{target_path} && curl -s '#{location}' | tar zx -"
end
docdir = target_path + 'doc'
if docdir.exist?
puts "doc dir exists; tagging"
sh "vim -u NONE -esX -c 'helptags #{docdir}' -c quit"
end
puts # blank line
puts "Removing the snippets included in snipmate"
rm_rf Pathname.new( ENV['HOME'] ) + '.vim' + 'bundle' + 'snipmate' + 'snippets'
puts # blank line
end
end # task :bundles
end # namespace :update