Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5a7fb3754f
Fetching contributors…

Cannot retrieve contributors at this time

file 56 lines (49 sloc) 1.438 kb
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
require 'rake'
require 'rake/clean'

project = 'specky'
files = Dir['{doc,ftdetect,ftplugin,plugin,ruby,syntax}/*']

CLEAN.include 'tmp/*_ctags'

desc "Make zip file"
file "#{project}.zip" => files do |t|
  File.unlink t.name if File.exists?(t.name)
  system('zip','-q',t.name,*t.prerequisites)
end

desc "Make vimball"
file "#{project}.vba" => files do |t|
  File.unlink t.name if File.exists?(t.name)
  File.open(t.name,"w") do |out|
    out.puts '" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.'
    out.puts 'UseVimball'
    out.puts 'finish'
    t.prerequisites.each do |name|
      File.open(name) do |file|
        file.each_line {}
        out.puts name
        out.puts file.lineno
        file.rewind
        file.each_line {|l|out.puts l}
      end
    end
  end
end

desc "Install"
task :install do
  vimfiles = if ENV['VIMFILES']
               ENV['VIMFILES']
             elsif RUBY_PLATFORM =~ /(win|w)32$/
               File.expand_path("~/vimfiles")
             else
               File.expand_path("~/.vim")
             end

  puts "Installing #{project}.vim"
  files.each do |file|
    target_file = File.join(vimfiles, file)
    FileUtils.mkdir_p(File.dirname(target_file))
    FileUtils.rm(target_file) rescue nil
    FileUtils.cp(file, target_file)
    puts " Copied #{file} to #{target_file}"
  end
end

task 'zip' => "#{project}.zip"
task 'vimball' => "#{project}.vba"
task :default => [:zip, :vimball]
Something went wrong with that request. Please try again.