-
Notifications
You must be signed in to change notification settings - Fork 22
/
Rakefile
24 lines (21 loc) · 612 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
require 'bundler/setup'
task default: :test
desc "Test examples in spec files"
task :test do
sh %(bundle exec common/extract-examples.rb index.html)
end
desc "Extract Examples"
task :examples do
sh %(rm -rf examples yaml)
sh %(bundle exec common/extract-examples.rb --example-dir examples --yaml-dir yaml index.html)
end
desc "Check HTML"
task :check_html do
require 'nokogiri'
doc = ::Nokogiri::HTML5(File.open("index.html"), max_parse_errors: 1000)
unless doc.errors.empty?
STDERR.puts "Errors found parsing index.html:"
doc.errors.each {|e| STDERR.puts " #{e}"}
exit(1)
end
end