Skip to content

Instantly share code, notes, and snippets.

@rjbgoudie
Created May 13, 2011 10:32
Show Gist options
  • Save rjbgoudie/970322 to your computer and use it in GitHub Desktop.
Save rjbgoudie/970322 to your computer and use it in GitHub Desktop.
Rakefile for public packages
def document(package)
rload = 'load(".RData")'
rdoc = "document(\"#{package}\")"
rsave = 'save.image()'
system "Rscript -e '#{rload}; #{rdoc}; #{rsave}'"
end
def build(package)
system "R CMD build #{package}"
end
def install(package)
system "R CMD INSTALL #{package}"
end
def test(package)
rdoc = "test(\"#{package}\")"
end
task :structmcmc do |t|
rm 'structmcmc/NAMESPACE' rescue nil
system 'rm -r structmcmc/man' rescue nil
document("structmcmc")
build("structmcmc")
install("structmcmc")
end
task :parental do |t|
rm 'parental/NAMESPACE' rescue nil
system 'rm -r parental/man' rescue nil
document("parental")
build("parental")
install("parental")
end
task :structmcmct do |t|
test("structmcmc")
end
task :structmcmci do |t|
build("structmcmc")
install("structmcmc")
end
task :parentalt do |t|
test("parental")
end
task :parentali do |t|
build("parental")
install("parental")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment