-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRakefile
89 lines (73 loc) · 1.89 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
79
80
81
82
83
84
85
86
87
88
89
require 'colorize'
def colorizedsh(cmd)
puts cmd.yellow
sh cmd
end
namespace :pkg do
desc "Build doc"
task :doc do
puts "== Build doc".green
output = `R --vanilla -e 'devtools::document(roclets=c("rd", "collate", "namespace"))'`
output = output.gsub(/[Ee]rror/, "ERROR".red)
output = output.gsub(/[Ww]arning/, "WARNING".yellow)
puts output
end
desc "Install"
task :install do
puts "== Install".green
sh 'R --vanilla -e "devtools::install()"'
end
desc "Test"
task :test do
puts "== Test".green
sh 'R --vanilla -e "devtools::test()"'
end
desc "Run examples"
task :run_examples do
puts "== Run examples".green
sh 'R --vanilla -e "devtools::run_examples()"'
end
desc "Check man"
task :check_man do
puts "== Check man".green
sh 'R --vanilla -e "devtools::check_man()"'
end
desc "Check"
task :check do
puts "== Check".green
sh 'R --vanilla -e "devtools::check()"'
end
namespace :site do
vignettes = FileList.new('vignettes/*.Rmd')
desc "Build vignette for the website"
task :build_vignette do
puts "== Build vignette".green
sh 'R --vanilla -e "pkgdown::build_articles()"'
end
desc "Build home of the website"
task :build_home do
puts "== Build home".green
sh 'R --vanilla -e "pkgdown::build_home()"'
end
desc "Build reference of the website"
task :build_reference do
puts "== Build reference".green
sh 'R --vanilla -e "pkgdown::build_reference()"'
end
desc "Make the pkg website"
task :build do
puts "== Build site".green
sh 'R --vanilla -e "pkgdown::build_site()"'
end
desc "Open the pkg website"
task :open do
puts "== Open the site".green
sh 'xdg-open docs/index.html'
end
desc "Remove docs dir"
task :clean do
puts "== Remove docs/ dir".green
sh 'rm -rf docs/'
end
end
end