Skip to content

Commit

Permalink
Rename build_universe() to write_universe_manifest()
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Mar 7, 2024
1 parent 03605df commit 7283b76
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
export(assert_cran_url)
export(assert_package)
export(assert_release_exists)
export(build_universe)
export(get_current_versions)
export(record_versions)
export(review_pull_request)
export(review_pull_requests)
export(try_message)
export(write_universe_manifest)
importFrom(gh,gh)
importFrom(jsonlite,parse_json)
importFrom(jsonlite,read_json)
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# r.releases.internals 0.0.10

* Automatically merge GitLab URLs with non-"upcoming" releases.
* `build_universe()` omits `"branch": "release"` from listings originating from custom owners. The new `release_exceptions` can accept `"https://github.com/cran"`, for example.
* Rename `build_universe()` to `write_universe_manifest()`.
* `write_universe_manifest()` omits `"branch": "release"` from listings originating from a short list of prespecified GitHub/GitLab owners. The new `release_exceptions` can accept `"https://github.com/cran"`, for example.

# r.releases.internals 0.0.9

Expand Down
8 changes: 4 additions & 4 deletions R/build_universe.R → R/write_universe_manifest.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#' @title Build the universe.
#' @title Build the `packages.json` manifest for the universe.
#' @export
#' @keywords internal
#' @description Create the `r-universe` `packages.json` file
#' @description Create the R-universe `packages.json` file
#' from constituent text files with URLs.
#' @return NULL (invisibly)
#' @param input Character of length 1, directory path with the
#' text file listings of R releases.
#' @param output Character of length 1, file path where the
#' `r-universe` `packages.json` file will be written.
#' R-universe `packages.json` file will be written.
#' @param release_exceptions Character vector of URLs of GitHub owners
#' where `"branch": "*release"` should be omitted. Example:
#' `"https://github.com/cran"`.
build_universe <- function(
write_universe_manifest <- function(
input = getwd(),
output = "packages.json",
release_exceptions = character(0L)
Expand Down
14 changes: 7 additions & 7 deletions man/build_universe.Rd → man/write_universe_manifest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ writeLines(
file.path(packages, "jsonlite")
)
universe <- file.path(tempfile(), "out")
r.releases.internals::build_universe(input = packages, output = universe)
r.releases.internals::write_universe_manifest(
input = packages,
output = universe
)
json <- jsonlite::read_json(universe)
exp <- list(
list(
Expand Down Expand Up @@ -42,7 +45,7 @@ writeLines(
file.path(packages, "quarto")
)
universe <- file.path(tempfile(), "out")
r.releases.internals::build_universe(
r.releases.internals::write_universe_manifest(
input = packages,
output = universe,
release_exceptions = c(
Expand Down Expand Up @@ -85,7 +88,10 @@ writeLines(
)
universe <- file.path(tempfile(), "out")
out <- try(
r.releases.internals::build_universe(input = packages, output = universe),
r.releases.internals::write_universe_manifest(
input = packages,
output = universe
),
silent = TRUE
)
stopifnot(inherits(out, "try-error"))
Expand All @@ -108,7 +114,10 @@ writeLines(
file.path(packages, "paws.analytics")
)
universe <- file.path(tempfile(), "out")
r.releases.internals::build_universe(input = packages, output = universe)
r.releases.internals::write_universe_manifest(
input = packages,
output = universe
)
out <- jsonlite::read_json(path = universe)
exp <- list(
list(
Expand Down Expand Up @@ -145,7 +154,10 @@ writeLines(
)
universe <- file.path(tempfile(), "out")
out <- try(
r.releases.internals::build_universe(input = packages, output = universe),
r.releases.internals::write_universe_manifest(
input = packages,
output = universe
),
silent = TRUE
)
stopifnot(
Expand Down Expand Up @@ -173,7 +185,10 @@ writeLines(
)
universe <- file.path(tempfile(), "out")
out <- try(
r.releases.internals::build_universe(input = packages, output = universe),
r.releases.internals::write_universe_manifest(
input = packages,
output = universe
),
silent = TRUE
)
stopifnot(inherits(out, "try-error"))
Expand Down Expand Up @@ -211,7 +226,10 @@ writeLines(
)
universe <- file.path(tempfile(), "out")
out <- try(
r.releases.internals::build_universe(input = packages, output = universe),
r.releases.internals::write_universe_manifest(
input = packages,
output = universe
),
silent = TRUE
)
stopifnot(inherits(out, "try-error"))
Expand Down Expand Up @@ -242,7 +260,10 @@ writeLines(
)
universe <- file.path(tempfile(), "out")
out <- try(
r.releases.internals::build_universe(input = packages, output = universe),
r.releases.internals::write_universe_manifest(
input = packages,
output = universe
),
silent = TRUE
)
stopifnot(inherits(out, "try-error"))
Expand Down

0 comments on commit 7283b76

Please sign in to comment.