forked from xnlogic/xnlogic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
43 lines (32 loc) · 1.02 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
require "bundler/gem_tasks"
require 'xn_gem_release_tasks'
XNGemReleaseTasks.setup Xnlogic, 'lib/xnlogic/version.rb'
begin
require 'ronn'
namespace :man do
directory "lib/xnlogic/man"
Dir["man/*.ronn"].each do |ronn|
basename = File.basename(ronn, ".ronn")
roff = "lib/xnlogic/man/#{basename}"
file roff => ["lib/xnlogic/man", ronn] do
sh "#{Gem.ruby} -S ronn --roff --pipe #{ronn} > #{roff}"
end
file "#{roff}.txt" => roff do
sh "groff -Wall -mtty-char -mandoc -Tascii #{roff} | col -b > #{roff}.txt"
end
task :build_all_pages => "#{roff}.txt"
end
desc "Build the man pages"
task :build => "man:build_all_pages"
desc "Clean up from the built man pages"
task :clean do
rm_rf "lib/xnlogic/man"
end
end
rescue LoadError
namespace :man do
task(:build) { warn "Install the ronn gem to be able to release!" }
task(:clean) { warn "Install the ronn gem to be able to release!" }
end
end
task :build => ['man:clean', 'man:build']