-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
38 lines (29 loc) · 804 Bytes
/
Rakefile
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
require 'rspec/core/rake_task'
require 'yard'
task :default => :test
RSpec::Core::RakeTask.new :test do |c|
c.rspec_opts = '--color --format Fivemat'
end
# Build the gem.
task :build => [:package_template, :doc] do
Dir['*.gem'].each {|file| File.delete file}
system 'gem build *.gemspec'
end
# Rebuild and [re]install the gem.
task :install => :build do
system 'gem install *.gem'
end
# Generate documentation.
YARD::Rake::YardocTask.new :doc do |t|
t.options = %w(- license.txt)
end
task :package_template do
require 'zip'
zip_file = 'template.zip'
File.delete zip_file if File.exists? zip_file
Zip::File.open zip_file, Zip::File::CREATE do |zip|
Dir['template/**/*', 'template/**/.*'].each do |file|
zip.add file.gsub(/^template\//, ''), file
end
end
end