File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ require 'yaml'
2
+
1
3
task :clean do
2
4
sh ( 'rm -rf _site' )
3
5
end
@@ -24,7 +26,21 @@ task :build => [:dependencies, :submodules] do
24
26
sh ( 'bundle exec jekyll build --config _config.yml' )
25
27
end
26
28
27
- task :validate => [ :build ] do
29
+ task :validate_kit_versions do
30
+ data = YAML . load_file ( '_data/kit_versions.yml' )
31
+ data . each do |entry |
32
+ actual = entry . keys . to_set
33
+ expected = [ 'version' , 'released' ] . to_set
34
+ missing = expected - actual
35
+ extra = actual - expected
36
+ messages = [ ]
37
+ messages << "Missing keys: #{ missing . to_a . join ( ', ' ) } " if missing . size ( ) > 0
38
+ messages << "Extra keys: #{ extra . to_a . join ( ', ' ) } " if extra . size ( ) > 0
39
+ raise "For entry\n #{ entry } \n #{ messages . join ( "\n " ) } \n \n " if messages . size ( ) > 0
40
+ end
41
+ end
42
+
43
+ task :validate_links => [ :build ] do
28
44
# Explanation of arguments:
29
45
# --assume-extension # Tells html-proofer that `.html` files can be accessed without the `.html` part in the url.
30
46
# --disable-external # For speed. Ideally we'd check external links too, but ignoring for now.
@@ -33,3 +49,5 @@ task :validate => [:build] do
33
49
# --url-swap # Adjust for Jekyll's baseurl. See https://github.com/gjtorikian/html-proofer/issues/618 for more.
34
50
sh ( 'bundle exec htmlproofer _site --assume-extension --disable-external --empty-alt-ignore --allow-hash-href --url-swap "^/docs/:/"' )
35
51
end
52
+
53
+ task :validate => [ :validate_kit_versions , :validate_links ]
You can’t perform that action at this time.
0 commit comments