Skip to content

Commit

Permalink
allow datapackage_skeleton to be called without data object names or …
Browse files Browse the repository at this point in the history
…code files.

fix #44
  • Loading branch information
gfinak committed Aug 22, 2018
1 parent 61f0dfa commit 54206f2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
12 changes: 6 additions & 6 deletions R/skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions man/use_processing_script.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-edge-cases.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-skeleton-edgecases.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 54206f2

Please sign in to comment.