forked from vagrant-landrush/landrush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
49 lines (41 loc) · 1.04 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
require 'bundler/gem_tasks'
require 'rake'
require 'rake/testtask'
require 'rake/clean'
require 'rubocop/rake_task'
require 'cucumber/rake/task'
require 'fileutils'
require 'asciidoctor'
CLOBBER.include('pkg')
CLEAN.include('build')
task :init do
# general build directory
FileUtils.mkdir_p 'build'
# Vagrant home directory for integration tests
FileUtils.mkdir_p 'build/vagrant.d'
end
task features: :init
# Default test task
desc 'Run all unit tests'
Rake::TestTask.new do |t|
t.pattern = 'test/**/*_test.rb'
t.libs << 'test'
end
# Cucumber acceptance test task
Cucumber::Rake::Task.new(:features)
task features: :init
desc 'Render Asciidoc into HTML'
adoc_files = Rake::FileList['**/*.adoc']
task html: adoc_files.ext('.html')
rule '.html' => '.adoc' do |t|
FileUtils.mkdir_p 'build/html'
Asciidoctor.convert_file t.source, to_dir: 'build/html'
end
task default: [
:rubocop,
:test
]
task :generate_diagrams do
sh 'cd doc; seqdiag --fontmap=support/seqdiag.fontmap -Tsvg vagrant_dns_without_landrush.diag'
end
RuboCop::RakeTask.new