diff --git a/DESCRIPTION b/DESCRIPTION index d32caf2..ee873b9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: multiverse.internals Title: Internal Infrastructure for R-multiverse Description: R-multiverse requires this internal internal infrastructure package to automate contribution reviews and populate universes. -Version: 0.2.2 +Version: 0.2.2.9000 License: MIT + file LICENSE URL: https://github.com/r-multiverse/multiverse.internals BugReports: https://github.com/r-multiverse/multiverse.internals/issues diff --git a/NAMESPACE b/NAMESPACE index 3f73884..ca8f9d0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -31,6 +31,5 @@ importFrom(nanonext,status_code) importFrom(pkgsearch,cran_package) importFrom(utils,available.packages) importFrom(utils,compareVersion) -importFrom(utils,contrib.url) importFrom(vctrs,vec_rbind) importFrom(vctrs,vec_slice) diff --git a/NEWS.md b/NEWS.md index e00394b..eb52ec2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# multiverse.internals 0.2.2.9000 (development) + +* Makes `meta_checks()` and `meta_packages()` robust to trailing slashes in the supplied URL. + # multiverse.internals 0.2.2 * Add `issues_dependencies()`. diff --git a/R/meta_checks.R b/R/meta_checks.R index a1bc56a..965a2ae 100644 --- a/R/meta_checks.R +++ b/R/meta_checks.R @@ -19,7 +19,7 @@ meta_checks <- function(repo = "https://multiverse.r-multiverse.org") { "_status" ) listing <- file.path( - repo, + trim_url(repo), "api", paste0("packages?stream=true&fields=", paste(fields, collapse = ",")) ) diff --git a/R/meta_packages.R b/R/meta_packages.R index 54ed0ca..816ca89 100644 --- a/R/meta_packages.R +++ b/R/meta_packages.R @@ -10,7 +10,9 @@ meta_packages <- function(repo = "https://multiverse.r-multiverse.org") { fields <- c("Version", "Remotes", "RemoteSha") listing <- file.path( - contrib.url(repos = repo, type = "source"), + trim_url(repo), + "src", + "contrib", paste0("PACKAGES.json?fields=", paste(fields, collapse = ",")) ) out <- jsonlite::stream_in( diff --git a/R/package.R b/R/package.R index 17a6ed4..a2bb795 100644 --- a/R/package.R +++ b/R/package.R @@ -3,6 +3,6 @@ #' @importFrom jsonlite parse_json read_json stream_in write_json #' @importFrom nanonext ncurl parse_url status_code #' @importFrom pkgsearch cran_package -#' @importFrom utils available.packages compareVersion contrib.url +#' @importFrom utils available.packages compareVersion #' @importFrom vctrs vec_rbind vec_slice NULL diff --git a/tests/testthat/helper-mock.R b/tests/testthat/helper-mock.R index a1e842c..a5c324e 100644 --- a/tests/testthat/helper-mock.R +++ b/tests/testthat/helper-mock.R @@ -1,4 +1,4 @@ -# parse(text = deparse(meta_checks(repo = "https://multiverse.r-multiverse.org"))) # nolint +# dput(meta_checks(repo = "https://multiverse.r-multiverse.org")) # nolint mock_meta_checks <- structure( list( package = c( @@ -108,7 +108,7 @@ mock_meta_checks <- structure( row.names = c(NA, 21L) ) -# parse(text = deparse(meta_packages(repo = "https://multiverse.r-multiverse.org"))) # nolint +# dput(meta_packages(repo = "https://multiverse.r-multiverse.org")) # nolint mock_meta_packages <- structure( list( "_id" = c( @@ -590,7 +590,7 @@ mock_meta_packages <- structure( row.names = c(NA, 20L) ) -# parse(text = deparse(meta_packages(repo = "https://wlandau.r-universe.dev"))) # nolint +# dput(meta_packages(repo = "https://wlandau.r-universe.dev")) # nolint mock_meta_packages_graph <- structure( list( "_id" = c(