Skip to content

Commit

Permalink
Go back to rlang::expr_deparse() except for board_url() (#257)
Browse files Browse the repository at this point in the history
* Go back to `rlang::expr_deparse()` except for `board_url()`

* Update NEWS
  • Loading branch information
juliasilge authored Nov 8, 2023
1 parent 82f08aa commit 2a094b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# vetiver (development version)

* Fixed bug in generating plumber files (#257).

# vetiver 0.2.4

* Fixed how plumber files are generated for `board_url()` (#241).
Expand Down
8 changes: 7 additions & 1 deletion R/write-plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ vetiver_write_plumber <- function(board, name, version = NULL,
load_infra_pkgs <- glue_collapse(glue("library({infra_pkgs})"), sep = "\n")
load_required_pkgs <- glue_required_pkgs(v$metadata$required_pkgs, rsconnect)

board <- deparse(pins::board_deparse(board))
## rlang::expr_deparse won't work for board_url, but
## base deparse won't work for S3 and other complex boards:
if (inherits(board, "pins_board_url")) {
board <- deparse(pins::board_deparse(board))
} else {
board <- rlang::expr_deparse(pins::board_deparse(board))
}
board <- glue('b <- {board}')

if (rlang::is_empty(plumber_dots)) {
Expand Down

0 comments on commit 2a094b5

Please sign in to comment.