PageRenderTime 23ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/vim/update_bundles.rb

https://bitbucket.org/aaront/vim
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
  1. #!/usr/bin/env ruby
  2. git_bundles = [
  3. "git://github.com/msanders/snipmate.vim.git",
  4. "git://github.com/Raimondi/delimitMate.git",
  5. "git://github.com/scrooloose/nerdtree.git",
  6. "git://github.com/timcharper/textile.vim.git",
  7. "git://github.com/tpope/vim-fugitive.git",
  8. "git://github.com/tpope/vim-git.git",
  9. "git://github.com/tpope/vim-markdown.git",
  10. "git://github.com/tpope/vim-repeat.git",
  11. "git://github.com/tpope/vim-surround.git",
  12. "git://github.com/tpope/vim-vividchalk.git",
  13. "git://github.com/tsaleh/vim-align.git",
  14. "git://github.com/tsaleh/vim-shoulda.git",
  15. "git://github.com/tsaleh/vim-supertab.git",
  16. "git://github.com/tsaleh/vim-tcomment.git",
  17. "git://github.com/vim-ruby/vim-ruby.git",
  18. "git://github.com/oscarh/vimerl.git"
  19. "git://git.wincent.com/command-t.git"
  20. ]
  21. bitbucket_bundles = [
  22. ]
  23. vim_org_scripts = [
  24. ["IndexedSearch", "7062", "plugin"],
  25. ["gist", "12732", "plugin"],
  26. ["jquery", "12107", "syntax"],
  27. ["python", "12804", "syntax"],
  28. ["python", "9196", "ftplugin"],
  29. ["tesla", "12745", "colors"],
  30. ["molokai", "9750", "colors"],
  31. ["minibufexpl", "3640", "plugin"],
  32. ["darkspectrum", "9771", "colors"],
  33. ["jinja2", "8666", "syntax"],
  34. ["python", "10034", "ftplugin"]
  35. ]
  36. require 'fileutils'
  37. require 'open-uri'
  38. bundles_dir = File.join(File.dirname(__FILE__), "bundle")
  39. FileUtils.cd(bundles_dir)
  40. puts "Trashing everything (lookout!)"
  41. Dir["*"].each {|d| FileUtils.rm_rf d }
  42. git_bundles.each do |url|
  43. dir = url.split('/').last.sub(/\.git$/, '')
  44. puts " Unpacking GH repo #{url} into #{dir}"
  45. `git clone #{url} #{dir}`
  46. FileUtils.rm_rf(File.join(dir, ".git"))
  47. end
  48. bitbucket_bundles.each do |url|
  49. dir = url.split('/').last
  50. puts " Unpacking BB repo #{url} into #{dir}"
  51. `hg clone #{url} #{dir}`
  52. FileUtils.rm_rf(File.join(dir, ".git"))
  53. end
  54. vim_org_scripts.each do |name, script_id, script_type|
  55. puts " Downloading #{name}"
  56. local_file = File.join(name, script_type, "#{name}.vim")
  57. FileUtils.mkdir_p(File.dirname(local_file))
  58. File.open(local_file, "w") do |file|
  59. file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read
  60. end
  61. end