Skip to content

Commit

Permalink
use ... in fload() instead of explicit headers argument
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Dec 7, 2020
1 parent c77b80e commit 8be8ffb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
8 changes: 7 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2020-12-07 Dirk Eddelbuettel <edd@debian.org>

* R/fload.R (fload): Use ... instead of explicit header argument
* R/utils.R (.prep_input): Support ... use
* man/fparse.Rd: Document ... use

2020-12-04 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): Roll version and date
Expand Down Expand Up @@ -32,7 +38,7 @@
2020-10-28 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): Roll version and date
or

* inst/tinytest/test_misc.R: Expand test coverage
* src/internal-utils.cpp: Mark one line #nocov
* R/init.R (.onAttach): Mark six lines #nocov
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Suggests: bit64, tinytest
URL: https://github.com/eddelbuettel/rcppsimdjson/
BugReports: https://github.com/eddelbuettel/rcppsimdjson/issues
RoxygenNote: 7.1.1
Encoding: UTF-8
Encoding: UTF-8
9 changes: 4 additions & 5 deletions R/fload.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
#' @param compressed_download Whether to request server-side compression on
#' the downloaded document, default: \code{FALSE}
#'
#' @param headers Optional header content which can used to pass an API token,
#' default is query \code{getOption} for key \sQuote{RcppSimdJson.header} with
#' fallback of \code{NULL}
#' @param ... Optional arguments which can be use \emph{e.g.} to pass additional
#' header settings
#'
#' @examples
#' # load JSON files ===========================================================
Expand Down Expand Up @@ -68,7 +67,7 @@ fload <- function(json,
temp_dir = tempdir(),
keep_temp_files = FALSE,
compressed_download = FALSE,
headers = getOption("RcppSimdJson.header", default = NULL)) {
...) {
# validate arguments =======================================================
if (!.is_valid_json_arg(json)) {
stop("`json=` must be a non-empty character vector, raw vector, or a list containing raw vectors.")
Expand Down Expand Up @@ -162,7 +161,7 @@ fload <- function(json,
temp_dir = temp_dir,
compressed_download = compressed_download,
verbose = verbose,
headers = headers)
...)
if (!keep_temp_files) {
on.exit(unlink(diagnosis$input[diagnosis$is_from_url]), add = TRUE)
}
Expand Down
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
temp_dir,
compressed_download,
verbose,
headers = NULL) {
headers = NULL,
...) {
input[!is.na(input)] <- path.expand(input[!is.na(input)])
diagnosis <- .diagnose_input(input)
.headers <- headers
Expand Down
6 changes: 3 additions & 3 deletions man/fparse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8be8ffb

Please sign in to comment.