diff --git a/R/config.R b/R/config.R index 9e80bc9..61244cc 100644 --- a/R/config.R +++ b/R/config.R @@ -30,7 +30,7 @@ new_config <- function(...) { host = host ), ignore = ignore, - runner_compute = "hotwater_runner" # todo fix + runner_compute = "hotwater_runner" ), class = c("hotwater_config", "list") ) diff --git a/R/run.R b/R/run.R index f01dc1a..16c2065 100644 --- a/R/run.R +++ b/R/run.R @@ -16,7 +16,7 @@ #' @param ignore vector of files or file extensions to ignore (globs) #' #' @examples -#' \dontrun{ +#' if (interactive()) { #' hotwater::run(system.file("examples", "plumber.R", package = "hotwater")) #' } #' diff --git a/R/script.R b/R/script.R index d117950..46eff55 100644 --- a/R/script.R +++ b/R/script.R @@ -6,7 +6,7 @@ common_install_paths <- list( "/usr/local/bin/", "/bin/" ), - windows = c() + windows = c() # does windows even work with this? ) #' WORK IN PROGRESS @@ -55,21 +55,17 @@ uninstall_hotwater <- function(install_folder = "~/.local/bin/") { #' @noRd check_suggests <- function() { suggests <- c("docopt") - lapply( - suggests, - function(suggestion) { - if (!requireNamespace(suggestion, quietly = TRUE)) { - cli::cli_abort( - c( - "Running {.pkg hotwater} from the command-line requires the {.pkg {suggestion}} package", - "*" = "Try running {.code install.packages('{suggestion}')}" - ), - call = globalenv() - ) - } + for (suggestion in suggests) { + if (!requireNamespace(suggestion, quietly = TRUE)) { + cli::cli_abort( + c( + "Running {.pkg hotwater} from the command-line requires the {.pkg {suggestion}} package", + "*" = "Try running {.code install.packages('{suggestion}')}" + ), + call = globalenv() + ) } - ) - invisible() + } } #' Run hotwater as a bash script diff --git a/man/run.Rd b/man/run.Rd index f72f0c7..3e7c973 100644 --- a/man/run.Rd +++ b/man/run.Rd @@ -27,7 +27,7 @@ If a plumber endpoint returns an html response, when hotwater refreshes the API, a refresh of any webpage that is using the API. } \examples{ -\dontrun{ +if (interactive()) { hotwater::run(system.file("examples", "plumber.R", package = "hotwater")) } diff --git a/tests/testthat/test-engine.R b/tests/testthat/test-engine.R index 79a2605..341fe0d 100644 --- a/tests/testthat/test-engine.R +++ b/tests/testthat/test-engine.R @@ -1,7 +1,6 @@ test_that("engine reuse", { engine <- new_engine( new_config( - port = 9999L, path = "./foo/bar.R", dirs = "./R", host = "127.0.0.1"