R Under development (unstable) (2024-10-20 r87250 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > testAdd <- function() { + ## simple examples of how to add drat information to your session + drat::addRepo("CRAN", "https://cloud.rstudio.com") + drat::addRepo(c("eddelbuettel", "RcppCore")) + + print(options("repos")) + } > > testInsertLocal <- function() { + ## simple test for local (non-GitHub) test + + ## that is my localhost setup on Ubuntu + localRepo <- "/var/www/html/drat" + ## guessing a tarball + localSource <- file.path(getwd(), "..", "..", + paste0("drat_", packageVersion("drat"), ".tar.gz")) + ## could be generalized via + if (file.exists(localRepo) && file.exists(localSource)) { + drat::insertPackage(localSource, localRepo) + } + } > > testInsertGit <- function() { + ## simple test for local git (non-GitHub push) test + + ## local gh-pages git dir + localGit <- "~/git/drat" + localGitSD <- "~/git/drat/src/contrib" + ## guessing a tarball + localSource <- file.path(getwd(), "..", "..", + paste0("drat_", packageVersion("drat"), ".tar.gz")) + ## could be generalized via + if (file.exists(localSource) && file.exists(localGitSD)) { + drat::insertPackage(localSource, localGit) + } + } > > testAdd() $repos CRAN eddelbuettel "https://cloud.rstudio.com" "https://eddelbuettel.github.io/drat/" RcppCore "https://RcppCore.github.io/drat/" > testInsertLocal() > testInsertGit() > > proc.time() user system elapsed 0.14 0.04 0.17