Skip to content

Commit

Permalink
Add :check task
Browse files Browse the repository at this point in the history
As suggested by @jnavila.

Check only HTML and epub books. As before this refactor, default
book:build task also check them.

Signed-off-by: Bagas Sanjaya <[email protected]>
  • Loading branch information
bagasme committed Jan 28, 2021
1 parent 732ae56 commit 6e4a261
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace :book do
params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}'"

desc 'build basic book formats'
task :build => [:build_html, :build_epub, :build_pdf]
task :build => [:build_html, :build_epub, :build_pdf, :check]

desc 'generate contributors list'
file 'book/contributors.txt' do
Expand All @@ -29,7 +29,6 @@ namespace :book do
`bundle exec asciidoctor #{params} -a data-uri progit.asc`
puts " -- HTML output at progit.html"

exec_or_raise('htmlproofer --check-html progit.html')
end

desc 'build Epub format'
Expand All @@ -38,7 +37,6 @@ namespace :book do
`bundle exec asciidoctor-epub3 #{params} progit.asc`
puts " -- Epub output at progit.epub"

exec_or_raise('epubcheck progit.epub')
end

desc 'build Mobi format'
Expand All @@ -65,6 +63,16 @@ namespace :book do
puts " -- PDF output at progit.pdf"
end

desc 'Check generated books'
task :check => [:build_html, :build_epub] do
begin
puts "Checking generated books"

exec_or_raise('htmlproofer --check-html progit.html')
exec_or_raise('epubcheck progit.epub')
end
end

desc 'Clean all generated files'
task :clean do
begin
Expand Down

0 comments on commit 6e4a261

Please sign in to comment.