Skip to content

Commit fef5684

Browse files
authored
Housekeeping
No user-facing changes
2 parents 7dcfaf5 + 53078d7 commit fef5684

File tree

10 files changed

+37
-31
lines changed

10 files changed

+37
-31
lines changed

R/config.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# handle all config here to pass to engine
2-
# including defaults, config files, etc
1+
# Handle all hotwater config here to pass to engine (see engine.R)
2+
# Includes defaults, config files, etc
33

44
new_config <- function(...) {
55
dots <- list(...)

R/mirai.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ new_runner <- function(engine) {
4545
i <- 0L
4646
timeout <- 1000L
4747

48-
while (i < timeout && is_runner_alive(engine) && !is_plumber_running(engine)) {
48+
repeat {
4949
i <- i + 1L
5050
try(
5151
cli::cli_progress_update(.envir = parent.frame(n = 1L)),
5252
silent = TRUE
5353
)
54+
55+
if (i >= timeout || !is_runner_alive(engine) || is_plumber_running(engine)) {
56+
break
57+
}
58+
5459
Sys.sleep(0.1)
5560
}
5661

R/run.R

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,23 @@
2020
#'
2121
#' @param path path to plumber API file.
2222
#'
23-
#' @param dirs (optional) a character vector of extra directories
23+
#' @param dirs **(optional)** a character vector of extra directories
2424
#' to watch for file changes. Paths are resolved from the current working
2525
#' directory, not the directory of the plumber API file.
2626
#'
27-
#' @param port \[default [httpuv::randomPort()]] port to launch API on.
27+
#' @param port port to launch API on.
2828
#'
29-
#' port can either be set explicitly, or it defaults to the
30-
#' `plumber.port` option. If the plumber option is undefined, the fallback
31-
#' value of [httpuv::randomPort()] is used.
29+
#' If NULL, defaults to the `plumber.port` option.
30+
#' If the plumber option is undefined, the fallback value of [httpuv::randomPort()] is used.
3231
#'
33-
#' @param host \[default "127.0.0.1"] host to launch API on.
32+
#' @param host host to launch API on.
3433
#'
35-
#' host can either be set explicitly, or it defaults to the
36-
#' `plumber.host` option. If the plumber option is undefined, the fallback
37-
#' value of "127.0.0.1" is used.
34+
#' If NULL, defaults to the `plumber.host` option.
35+
#' If the plumber option is undefined, the fallback value of "127.0.0.1" is used.
3836
#'
39-
#' @param ignore \[default `c("*.sqlite", "*.git*")`] vector of file globs
40-
#' to ignore.
37+
#' @param ignore vector of file globs to ignore.
38+
#'
39+
#' If NULL, defaults to `c("*.sqlite", "*.git")`
4140
#'
4241
#' @seealso [plumber::options_plumber],
4342
#' [plumber::get_option_or_env], [plumber::serializer_html]

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111

1212
<!-- badges: end -->
1313

14+
> [!NOTE]
15+
> This package is under active development and its functionality may change over time.
16+
1417
- autoreload for plumber
1518
- auto-refresh the browser when a change is made
16-
- run from the commandline with the `/exec/hotwater` bash script
19+
- run hotwater from the commandline via included bash script
1720

1821
## Installation
1922

TODO.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@
1818

1919
## 5
2020

21-
- An error doesn't always cause hotwater to attempt to restart. Should it? An error can indicate that the API has to be changed
22-
before trying again
21+
- An error doesn't always cause hotwater to attempt to restart. Should it? An error can indicate that the API has to be changed before trying again

man/hotwater-package.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/run.Rd

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-cli.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
test_that("startup/teardown messages don't error", {
1+
test_that("startup & teardown messages don't error", {
22
engine <- new_test_engine()
33
expect_no_error(suppressMessages(buildup_engine(engine)))
44
expect_no_error(suppressMessages(teardown_engine(engine)))

tests/testthat/test-script.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
test_that("hotwater install/uninstall works", {
1+
test_that("hotwater install & uninstall works", {
22
skip_on_os("windows")
33
local({
44
hw_install_folder <- withr::local_tempdir("install_path")

tests/testthat/test-watcher.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test_that("file watcher works", {
3939
changes <- get_changed_files(directory_state_old(), directory_state_new())
4040
expect_true(did_files_change(changes))
4141
expect_identical(
42-
sort(c("./R/run.R", "./R/deleted.R", "./R/new.R")),
42+
sort(c("./R/run.R", "./R/deleted.R", "./R/new.R")), # nolint: nonportable_path_linter.
4343
sort(changes)
4444
)
4545
})

0 commit comments

Comments
 (0)