-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
34 lines (29 loc) · 699 Bytes
/
Rakefile
File metadata and controls
34 lines (29 loc) · 699 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
require 'html-proofer'
require 'yaml'
namespace :assets do
task :precompile do
sh 'bundle exec jekyll build'
end
end
def config
config = YAML.load_file('_config_' + ENV['RAILS_ENV'] + '.yml')
config['proofer'].keys.each do |key|
config['proofer'][key.to_sym] = config['proofer'].delete(key)
end
config
end
def serve_site
sh 'bundle exec jekyll serve -H $IP -P $PORT -c _config.yml,_config_' + ENV['RAILS_ENV'] + '.yml --detach'
end
def html_proofer
puts "HTML Proofer version: #{HTMLProofer::VERSION}"
HTMLProofer.check_directory('./_site', config['proofer']).run
end
task :test do
begin
serve_site
html_proofer
ensure
`pkill -f jekyll`
end
end