-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a79b34
commit 88f7514
Showing
9 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#" Summarize caches for `redistverse` packages | ||
#" | ||
#" @param packages character vector of package names. Default is `c("alarmdata", "tinytiger")`. | ||
#" | ||
#" @return a vector of paths to the cache directories for the specified packages | ||
#" @export | ||
#" | ||
#" @examples | ||
#" redistverse_cache_status() | ||
redistverse_cache_status <- function(packages = c("alarmdata", "tinytiger")) { | ||
if ("alarmdata" %in% packages) { | ||
packages[packages == "alarmdata"] <- "alarm" | ||
} | ||
|
||
check_fns <- c( | ||
tinytiger = tinytiger::tt_cache_path, | ||
alarm = alarmdata::alarm_cache_path | ||
) | ||
|
||
use_cache <- logical(length(packages)) | ||
paths <- character(length(packages)) | ||
for (i in seq_along(packages)) { | ||
use_cache[i] <- getOption(x = paste0(packages[i], ".use_cache"), default = FALSE) | ||
if (use_cache[i] && !is.null(check_fns[[packages[i]]])) { | ||
paths[i] <- check_fns[[packages[i]]]() | ||
} else { | ||
paths[i] <- getOption(paste0(packages[i], ".cache_dir"), default = NA_character_) | ||
} | ||
} | ||
|
||
ul <- cli::cli_ul() | ||
for (i in seq_along(packages)) { | ||
if (is.na(paths[i])) { | ||
if (isFALSE(use_cache[i])) { | ||
cli::cli_li("{.pkg {packages[i]}}: cache is not enabled.") | ||
} else { | ||
cli::cli_li("{.pkg {packages[i]}}: cache enabled but not found.") | ||
} | ||
} else { | ||
cli::cli_li("{.pkg {packages[i]}}: cache is {.path {paths[i]}}.") | ||
} | ||
} | ||
cli::cli_end(ul) | ||
|
||
names(paths) <- packages | ||
|
||
invisible(paths) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CMD | ||
ORCID | ||
alarmdata | ||
censable | ||
easycensus | ||
geomander | ||
ggredist | ||
redist | ||
redistmetrics | ||
tidyverse | ||
tinytiger |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if(requireNamespace('spelling', quietly = TRUE)) | ||
spelling::spell_check_test(vignettes = TRUE, error = FALSE, | ||
skip_on_cran = TRUE) |