Skip to content

Commit

Permalink
Take dots instead of a list
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Feb 24, 2020
1 parent eece204 commit 778c1d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 9 additions & 2 deletions R/compat-downstream-dep.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ check_downstream_deps <- local({
}
}

function(pkg, deps, with_rlang = requireNamespace("rlang")) {
function(pkg, ..., with_rlang = requireNamespace("rlang")) {
deps <- list(...)
nms <- names(deps)

if (is.null(nms)) {
stop("Downstream dependencies should be named.", call. = FALSE)
}

Map(
function(dep_pkg, dep_data) {
force(dep_data)
Expand All @@ -74,7 +81,7 @@ check_downstream_deps <- local({
with_rlang = with_rlang
))
},
names(deps),
nms,
deps
)
}
Expand Down
12 changes: 6 additions & 6 deletions R/rlang.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ NULL
is_same_body <- NULL


downstream_deps <- list(
dplyr = c(min = "0.8.0", from = "0.4.0")
)


base_ns_env <- NULL
base_pkg_env <- NULL

Expand All @@ -21,7 +16,12 @@ base_pkg_env <- NULL
}

check_linked_version(pkg, with_rlang = FALSE)
check_downstream_deps(pkg, downstream_deps, with_rlang = FALSE)

check_downstream_deps(
pkg,
dplyr = c(min = "0.8.0", from = "0.4.0"),
with_rlang = FALSE
)

on_package_load("glue", .Call(rlang_glue_is_there))

Expand Down

0 comments on commit 778c1d8

Please sign in to comment.