-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathRakefile
More file actions
39 lines (31 loc) · 949 Bytes
/
Copy pathRakefile
File metadata and controls
39 lines (31 loc) · 949 Bytes
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
$LOAD_PATH.unshift File.join(File.dirname(__FILE__),'ruby')
require 'rake'
require 'find'
require 'pathname'
IGNORE_FILES = [/^\.gitignore$/, /^Rakefile$/,/^README.markdown$/,/^zip/]
files = `git ls-files`.split("\n")
files.reject! { |f| IGNORE_FILES.any? { |re| f.match(re) } }
vim_dir=File.expand_path("~/.vim")
desc 'zip project'
task :zip do
system("zip zip/vim-ruby-doc.zip #{files.join(" ")}")
end
desc 'pull from git repository'
task :pull do
puts 'Updating from git repository'
system("cd " << Dir.new(File.dirname(__FILE__)).path << " && git pull")
end
desc "install vim-ruby-doc in #{vim_dir} dir"
task :install do
files.each do |file|
if File.exists?(file)
target_file = File.join(vim_dir, file)
FileUtils.mkdir_p File.dirname(target_file)
FileUtils.cp file, target_file
puts "Installed #{file} to #{target_file}"
else
puts "#{file} removed?"
end
end
end
task default: :install