Skip to content

Commit

Permalink
Use glue_data to avoid breaking change in glue package
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Oct 1, 2024
1 parent 1dc392d commit 1ce55ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BugReports: https://github.com/mrc-ide/naomi.options/issues
Additional_repositories: https://mrc-ide.r-universe.dev
Imports:
data.table,
glue,
glue (>= 1.8.0),
jsonlite,
traduire (>= 0.0.5),
Suggests:
Expand Down
5 changes: 2 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ recursive_scalar <- function(x) {
#' @keywords internal
#'
build_json <- function(options_template, params) {
param_env <- list2env(params, parent = .GlobalEnv)
tryCatch(
glue::glue(options_template, .envir = param_env, .open = '"<+',
.close = '+>"', .transformer = json_transformer),
glue::glue_data(params, options_template, .open = '"<+',
.close = '+>"', .transformer = json_transformer),
error = function(e) {
e$message <- t_("MODEL_OPTIONS_FAIL", list(message = e$message))
stop(e)
Expand Down

0 comments on commit 1ce55ee

Please sign in to comment.