-
Notifications
You must be signed in to change notification settings - Fork 26
/
Rakefile
58 lines (48 loc) · 1.56 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
# -*- encoding: utf-8 -*-
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
require 'rake/clean'
require 'bundler/gem_tasks'
begin
require 'yard'
# options are defined in .yardopts
YARD::Rake::YardocTask.new
task :doc => :yard
rescue LoadError => e
warn "#{e.path} is not available"
end
begin
require 'asciidoctor-doctest'
require 'asciidoctor-latex'
require 'rake/testtask'
namespace :doctest do
Rake::TestTask.new(:latex) do |t|
t.description = 'Run integration tests for LaTeX output.'
t.pattern = 'test/latex_test.rb'
t.libs << 'test'
end
Rake::TestTask.new(:html) do |t|
t.description = 'Run integration tests for HTML output.'
t.pattern = 'test/html_test.rb'
t.libs << 'test'
end
end
task :doctest => [ 'doctest:latex', 'doctest:html' ]
task :test => :doctest
task :default => :test
namespace :generate do
DocTest::GeneratorTask.new(:latex) do |t|
t.converter_opts[:backend_name] = :latex
t.converter_opts[:dialect] = :latex
t.output_suite = DocTest::Latex::ExamplesSuite.new(examples_path: 'test/examples/tex')
t.examples_path.unshift 'test/examples/adoc' # extra input examples
end
DocTest::GeneratorTask.new(:html) do |t|
t.converter_opts[:backend_name] = :html
t.converter_opts[:dialect] = :latex
t.output_suite = DocTest::HTML::ExamplesSuite.new(examples_path: 'test/examples/html')
t.examples_path = ['test/examples/asciidoc-html'] # input examples
end
end
rescue LoadError => e
warn "#{e.path} is not available"
end