A tree explorer plugin for vim.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.8 KiB

  1. # written by travis jeffery <travisjeffery@gmail.com>
  2. # contributions by scrooloose <github:scrooloose>
  3. require 'rake'
  4. require 'find'
  5. require 'pathname'
  6. IGNORE = [/\.gitignore$/, /Rakefile$/]
  7. files = `git ls-files`.split("\n")
  8. files.reject! { |f| IGNORE.any? { |re| f.match(re) } }
  9. desc 'Zip up the project files'
  10. task :zip do
  11. zip_name = File.basename(File.dirname(__FILE__))
  12. zip_name.gsub!(/ /, '_')
  13. zip_name = "#{zip_name}.zip"
  14. if File.exist?(zip_name)
  15. abort("Zip file #{zip_name} already exists. Remove it first.")
  16. end
  17. puts "Creating zip file: #{zip_name}"
  18. system("zip #{zip_name} #{files.join(" ")}")
  19. end
  20. desc 'Install plugin and documentation'
  21. task :install do
  22. vimfiles = if ENV['VIMFILES']
  23. ENV['VIMFILES']
  24. elsif RUBY_PLATFORM =~ /(win|w)32$/
  25. File.expand_path("~/vimfiles")
  26. else
  27. File.expand_path("~/.vim")
  28. end
  29. files.each do |file|
  30. target_file = File.join(vimfiles, file)
  31. FileUtils.mkdir_p File.dirname(target_file)
  32. FileUtils.cp file, target_file
  33. puts "Installed #{file} to #{target_file}"
  34. end
  35. end
  36. desc 'Pulls from origin'
  37. task :pull do
  38. puts "Updating local repo..."
  39. system("cd " << Dir.new(File.dirname(__FILE__)).path << " && git pull")
  40. end
  41. desc 'Calls pull task and then install task'
  42. task :update => ['pull', 'install'] do
  43. puts "Update of vim script complete."
  44. end
  45. desc 'Uninstall plugin and documentation'
  46. task :uninstall do
  47. vimfiles = if ENV['VIMFILES']
  48. ENV['VIMFILES']
  49. elsif RUBY_PLATFORM =~ /(win|w)32$/
  50. File.expand_path("~/vimfiles")
  51. else
  52. File.expand_path("~/.vim")
  53. end
  54. files.each do |file|
  55. target_file = File.join(vimfiles, file)
  56. FileUtils.rm target_file
  57. puts "Uninstalled #{target_file}"
  58. end
  59. end
  60. task :default => ['update']