diff --git a/NEWS.md b/NEWS.md index bffa401..18d2ef4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # DataPackageR 0.15.3 * conditional tests when pandoc is missing (ropensci/DataPackager/issues/46) * add use_data_object and use_processing_script (ropensci/DataPackager/issues/44) +* allow datapacakge_skeleton to be called without files or data objects for interactive construction. (ropensci/DataPackager/issues/44) # DataPackageR 0.15.2 * Add pandoc to SystemRequirements (ropensci/DataPackager/issues/46) diff --git a/R/skeleton.R b/R/skeleton.R index 8ddb62a..300cb5d 100644 --- a/R/skeleton.R +++ b/R/skeleton.R @@ -42,12 +42,12 @@ datapackage_skeleton <- if (is.null(name)) { stop("Must supply a package name", call. = FALSE) } - if (length(r_object_names) == 0) { - stop("You must specify r_object_names", call. = FALSE) - } - if (length(code_files) == 0) { - stop("You must specify code_files", call. = FALSE) - } + #if (length(r_object_names) == 0) { + # stop("You must specify r_object_names", call. = FALSE) + #} + #if (length(code_files) == 0) { + # stop("You must specify code_files", call. = FALSE) + #} if (force) { unlink(file.path(path, name), recursive = TRUE, force = TRUE) } diff --git a/man/use_processing_script.Rd b/man/use_processing_script.Rd index af87d36..1552f45 100644 --- a/man/use_processing_script.Rd +++ b/man/use_processing_script.Rd @@ -31,8 +31,8 @@ datapackage_skeleton( code_files = file, force = TRUE, r_object_names = "data") -use_processing_script(file = "newScript.Rmd", - title = "Processing a new dataset", +use_processing_script(file = "newScript.Rmd", + title = "Processing a new dataset", author = "Y.N. Here.") } } diff --git a/tests/testthat/test-edge-cases.R b/tests/testthat/test-edge-cases.R index 06a88b6..02eac71 100644 --- a/tests/testthat/test-edge-cases.R +++ b/tests/testthat/test-edge-cases.R @@ -215,7 +215,7 @@ test_that("package built in different edge cases", { expect_error(DataPackageR::construct_yml_config("foo.Rmd", render_root = "foobar" )) - expect_error(DataPackageR:::datapackage_skeleton( + expect_null(DataPackageR:::datapackage_skeleton( name = "foo", path = tempdir() )) diff --git a/tests/testthat/test-skeleton-edgecases.R b/tests/testthat/test-skeleton-edgecases.R index b4cf42e..d45b263 100644 --- a/tests/testthat/test-skeleton-edgecases.R +++ b/tests/testthat/test-skeleton-edgecases.R @@ -23,7 +23,7 @@ test_that("datapackage_skeleton errors with no name arg", { force = TRUE ) ) - expect_error( + expect_null( datapackage_skeleton( name = "mtcars20", path = tempdir(),