Skip to content

Commit

Permalink
revert changes for #85
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Oct 18, 2023
1 parent 65d4607 commit 4c8db0c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: autotest
Title: Automatic Package Testing
Version: 0.0.2.203
Version: 0.0.2.204
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265")),
Expand Down
29 changes: 15 additions & 14 deletions R/function-params.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,21 @@ get_params <- function (res, i, this_fn) {
}
pars <- formals (fun = this_fn, envir = pkg_env)

# Eval any formals in function environment:
params_env <- as.environment (params)
parent.env (params_env) <- pkg_env
index <- which (vapply (
pars,
function (i) methods::is (i, "call") && !is.symbol (i),
logical (1)
))
pars [index] <- lapply (pars [index], function (p) {
res <- p
if (methods::is (p, "call") && !is.symbol (p)) {
res <- eval (p, envir = params_env)
}
})
# Eval any formals in function environment (#85):
# (This does not work, and can not be implemented in this form.)
# params_env <- as.environment (params)
# parent.env (params_env) <- pkg_env
# index <- which (vapply (
# pars,
# function (i) methods::is (i, "call") && !is.symbol (i),
# logical (1)
# ))
# pars [index] <- lapply (pars [index], function (p) {
# res <- p
# if (methods::is (p, "call") && !is.symbol (p)) {
# res <- eval (p, envir = params_env)
# }
# })

nms <- names (pars)

Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/autotest",
"issueTracker": "https://github.com/ropensci-review-tools/autotest/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.2.203",
"version": "0.0.2.204",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 4c8db0c

Please sign in to comment.