-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
33 lines (25 loc) · 844 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
require "mkmf"
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task default: :spec
desc "Regenerate the example HTML in example/example.html"
task :generate_example do
require_relative "lib/govuk_markdown"
markdown = File.read("example/example.md")
html = GovukMarkdown.render(markdown)
File.write("example/example.html", ERB.new(File.read("example/example_layout.html.erb")).result(binding))
case
when find_executable("xdg-open") # linux
sh("xdg-open example/example.html")
when find_executable("open") # mac
sh("open example/example.html")
else
puts "View the example in example/example.html"
end
end
desc "Print the current version of the gem"
task :gem_version do
require_relative "lib/govuk_markdown/version"
puts GovukMarkdown::VERSION
end