-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from jmbarbone/78-scribe-execute
78 scribe execute
- Loading branch information
Showing
17 changed files
with
199 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
^cran-comments\.md$ | ||
^CRAN-SUBMISSION$ | ||
^revdep$ | ||
^\.git$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
.InstallScribe <- function() { | ||
devtools::document() | ||
pak::pkg_install("local::.", Sys.getenv("R_LIBS_SCRIBE")) | ||
} | ||
|
||
if (file.exists("~/.Rprofile")) { | ||
source("~/.Rprofile") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#' Check method arguments | ||
#' | ||
#' @param object Object to check | ||
#' @param prefix Prefix to use for method names | ||
#' @param verbose Print out additional information | ||
#' @keywords internal | ||
#' @noRd | ||
check_methods <- function(object, prefix, verbose = getOption("verbose")) { | ||
requireNamespace("testthat") | ||
|
||
for (method in object$methods()) { | ||
obj <- get0(method, object$def@refMethods, mode = "function") | ||
|
||
if (is.null(obj)) { | ||
next | ||
} | ||
|
||
exp <- get0(paste0(prefix, method), mode = "function") | ||
|
||
if (is.null(exp)) { | ||
if (verbose) { | ||
cat("Skipping method: ", method, "()\n", sep = "") # nocov | ||
} | ||
|
||
next | ||
} | ||
|
||
obj <- as.list(formals(obj)) | ||
|
||
if (identical(obj, list())) { | ||
# exp will be a named list, but will be empty | ||
obj <- structure(list(), names = character()) | ||
} | ||
|
||
exp <- as.list(formals(exp))[-1L] | ||
|
||
testthat::expect_identical( | ||
object = obj, | ||
expected = exp, | ||
info = paste0("method: ", method, "()"), | ||
ignore_srcref = TRUE | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
CMD | ||
Codecov | ||
fixmes | ||
ORCID | ||
ReferenceClass | ||
Rscript | ||
arg | ||
args | ||
fixmes | ||
pak | ||
pkgs | ||
ReferenceClass | ||
repo | ||
Rscript | ||
scribeArg | ||
scribeArgs | ||
scribeCommandArgs | ||
todos |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.