-
-
Notifications
You must be signed in to change notification settings - Fork 200
/
Rakefile
44 lines (32 loc) · 934 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true
require "bundler"
Bundler::GemHelper.install_tasks
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
require "rubocop/rake_task"
RuboCop::RakeTask.new(:rubocop)
task default: [:spec, :proof_readme]
desc "Test the project"
task :test do
Rake::Task["spec"].invoke
end
desc "Run proofer on the README"
task :proof_readme do
require "html-proofer"
require "redcarpet"
renderer = Redcarpet::Render::HTML.new(
with_toc_data: true,
)
redcarpet = Redcarpet::Markdown.new(renderer)
html = redcarpet.render(File.read("README.md"))
mkdir_p "out"
File.write("out/README.html", html)
opts = {}
HTMLProofer.check_directory("./out", opts).run
end
require "bundler/gem_tasks"
require "rubygems/package_task"
GEMSPEC = Bundler.load_gemspec("html-proofer.gemspec")
gem_path = Gem::PackageTask.new(GEMSPEC).define
desc "Package the ruby gem"
task "package" => [gem_path]