Skip to content

Commit

Permalink
include on_cran
Browse files Browse the repository at this point in the history
  • Loading branch information
hillalex committed Aug 6, 2024
1 parent db70660 commit 97bfdc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ compile_metadata <- function(gh_data, cran_data = NULL, description_contents = N
if (!("github_metadata" %in% class(gh_data))) {
stop("gh_data must be of type 'github_metadata'")
}
if (is.null(cran_data)) {
on_cran <- !is.null(cran_data)
if (on_cran) {
if (is.null(description_contents)) {
stop("If CRAN metadata is NULL, must provide DESCRIPTION contents")
}
Expand Down Expand Up @@ -41,7 +42,8 @@ compile_metadata <- function(gh_data, cran_data = NULL, description_contents = N
date_published = date_published,
has_tests = gh_data$has_tests,
has_vignettes = gh_data$has_vignettes,
num_contributors = gh_data$num_contributors
num_contributors = gh_data$num_contributors,
on_cran = on_cran
)
class(ret) <- append("htahub_metadata", class(ret))
ret
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ test_that("can read metadata from cran", {
expect_equal(meta$maintainer, "Rob Young")
expect_equal(meta$date_published, "2022-04-27 14:50:07 UTC")
})

test_that("Can compile metadata", {

})

0 comments on commit 97bfdc4

Please sign in to comment.