forked from ruby-conferences/ruby-conferences.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
47 lines (41 loc) · 1011 Bytes
/
Rakefile
File metadata and controls
47 lines (41 loc) · 1011 Bytes
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
#!/usr/bin/env rake
require 'yaml'
require 'date'
require './data_file_validator'
desc "Build Jekyll site"
task :build do
exit 1 unless system "bundle exec jekyll build"
end
desc "Verify generated HTML"
task :verify_html do
exit 2 unless system "bundle exec htmlproofer ./_site"
end
desc "Verify event data"
task :verify_data do
allowed_keys = [
"name",
"location",
"start_date",
"end_date",
"url",
"twitter",
"mastodon",
"reg_phrase",
"reg_date",
"cfp_open_date",
"cfp_close_date",
"cfp_link",
"status",
"date_precision",
"video_link",
"announced_on"
]
data = YAML.load_file("_data/conferences.yml", permitted_classes: [Date])
validator = DataFileValidator.validate(data, allowed_keys)
exit 3 if validator.missing_keys?
exit 4 if validator.bonus_keys?
events = validator.events
dates = events.map { |event| event["start_date"] }
exit 5 unless dates.sort == dates
end
task default: [:build, :verify_data, :verify_html]