-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
78 lines (64 loc) · 1.63 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
require_relative 'lib/utils'
FEED_URL = 'https://www.diglib.org/category/ndsa/feed/'
Dotenv.load
task default: %w(import:rss)
namespace :import do
desc "Import NDSA feed"
task :rss do
Rss.import(FEED_URL)
end
end
namespace :test do
desc 'Validate HTML output'
task :html do
require 'html-proofer'
`bundle exec jekyll build`
options = {
assume_extension: true,
disable_external: true,
empty_alt_ignore: true,
url_swap: { "^/" => "http://localhost/" }
}
HTMLProofer.check_directory("./_site", options).run
# HTML::Proofer.new('./_site').run
end
desc 'Validate site with pa11y'
task :accessibility do
sh 'bundle exec jekyll build'
Ra11y::Site.new('./_site').run
end
end
namespace :geocode do
desc 'Geocode all records'
task :all do
Google.login
Geocode.new(Google.worksheet)
Geocode.geocode_all
end
desc 'Geocode members who do not have lon/lat'
task :empty do
Google.login
Geocode.new(Google.worksheet)
Geocode.geocode_empty
end
end
namespace :convert do
desc 'Run all conversions (for map and membership list)'
task :all => [:table_data, :members_map, :checksums]
desc 'Create checksums for the documents directory'
task :checksums do
`cd documents && find . -type f -print0 | xargs -0 md5sum >> checksums.md5`
end
desc 'Create dataset for data table'
task table_data: :dotenv do
Google.login
Members.new(Google.worksheet)
Members.write_json
end
desc 'Generate GeoJSON from Google Spreadsheet'
task members_map: :dotenv do
Google.login
Members.new(Google.worksheet)
Members.write_geojson
end
end