/vim/update_bundles.rb
Ruby | 71 lines | 60 code | 10 blank | 1 comment | 0 complexity | 1628710c6574a6150813f1a2d495e5cf MD5 | raw file
Possible License(s): Apache-2.0, BSD-2-Clause, JSON, 0BSD
- #!/usr/bin/env ruby
- git_bundles = [
- "git://github.com/msanders/snipmate.vim.git",
- "git://github.com/Raimondi/delimitMate.git",
- "git://github.com/scrooloose/nerdtree.git",
- "git://github.com/timcharper/textile.vim.git",
- "git://github.com/tpope/vim-fugitive.git",
- "git://github.com/tpope/vim-git.git",
- "git://github.com/tpope/vim-markdown.git",
- "git://github.com/tpope/vim-repeat.git",
- "git://github.com/tpope/vim-surround.git",
- "git://github.com/tpope/vim-vividchalk.git",
- "git://github.com/tsaleh/vim-align.git",
- "git://github.com/tsaleh/vim-shoulda.git",
- "git://github.com/tsaleh/vim-supertab.git",
- "git://github.com/tsaleh/vim-tcomment.git",
- "git://github.com/vim-ruby/vim-ruby.git",
- "git://github.com/oscarh/vimerl.git"
- "git://git.wincent.com/command-t.git"
- ]
- bitbucket_bundles = [
- ]
- vim_org_scripts = [
- ["IndexedSearch", "7062", "plugin"],
- ["gist", "12732", "plugin"],
- ["jquery", "12107", "syntax"],
- ["python", "12804", "syntax"],
- ["python", "9196", "ftplugin"],
- ["tesla", "12745", "colors"],
- ["molokai", "9750", "colors"],
- ["minibufexpl", "3640", "plugin"],
- ["darkspectrum", "9771", "colors"],
- ["jinja2", "8666", "syntax"],
- ["python", "10034", "ftplugin"]
- ]
- require 'fileutils'
- require 'open-uri'
- bundles_dir = File.join(File.dirname(__FILE__), "bundle")
- FileUtils.cd(bundles_dir)
- puts "Trashing everything (lookout!)"
- Dir["*"].each {|d| FileUtils.rm_rf d }
- git_bundles.each do |url|
- dir = url.split('/').last.sub(/\.git$/, '')
- puts " Unpacking GH repo #{url} into #{dir}"
- `git clone #{url} #{dir}`
- FileUtils.rm_rf(File.join(dir, ".git"))
- end
- bitbucket_bundles.each do |url|
- dir = url.split('/').last
- puts " Unpacking BB repo #{url} into #{dir}"
- `hg clone #{url} #{dir}`
- FileUtils.rm_rf(File.join(dir, ".git"))
- end
- vim_org_scripts.each do |name, script_id, script_type|
- puts " Downloading #{name}"
- local_file = File.join(name, script_type, "#{name}.vim")
- FileUtils.mkdir_p(File.dirname(local_file))
- File.open(local_file, "w") do |file|
- file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read
- end
- end