-
Notifications
You must be signed in to change notification settings - Fork 33
/
Rakefile
59 lines (49 loc) · 1.44 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rake/clean'
require 'dropcaster'
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new
rescue LoadError
warn 'Rubocop tasks not available.'
end
Rake::TestTask.new(:test) do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
end
task default: %i[rubocop test]
namespace :web do
file 'website/index.markdown' do |f|
concat 'website/_front_matter/index.yaml', 'README.markdown', f
end
CLOBBER << 'website/index.markdown'
file 'website/vision.markdown' do |f|
concat 'website/_front_matter/vision.yaml', 'VISION.markdown', f
end
CLOBBER << 'website/vision.markdown'
file 'website/contributors.markdown' do
require 'dropcaster/contributors'
File.write('website/contributors.markdown', Dropcaster.contributors)
end
CLOBBER << 'website/contributors.markdown'
file 'website/contributing.md' => 'website/contributors.markdown' do |f|
concat 'website/_front_matter/contributing.yaml', 'CONTRIBUTING.md', f
concat 'website/contributors.markdown', f
end
CLOBBER << 'website/contributing.md'
desc 'Generate web page'
task generate: ['website/index.markdown', 'website/vision.markdown', 'website/contributing.md'] do
cd 'website' do
`bundle exec jekyll build`
end
end
end
def concat(*files)
File.open(files.pop.to_s, 'a') do |f|
files.each do |src|
f << File.read(src)
end
end
end