diff --git a/DESCRIPTION b/DESCRIPTION index 61d3999c..76726662 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: blockr Title: A block-based framework for data manipulation and visualization -Version: 0.0.2.9020 +Version: 0.0.2.9021 Authors@R: c(person(given = "Nicolas", family = "Bennett", diff --git a/NEWS.md b/NEWS.md index ebb10159..cf4dc55c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# blockr 0.0.2.9020 +# blockr 0.0.2.9021 ## Feature - Improved `submit` feature for blocks. Now submit isn't added as a class but as a special block attribute. When you design a block, you can pass the `submit` parameter like so: diff --git a/R/registry.R b/R/registry.R index 70d262ab..938190bb 100644 --- a/R/registry.R +++ b/R/registry.R @@ -8,11 +8,9 @@ available_blocks <- function() { } block_descr_getter <- function(field) { - field <- force(field) function(x) { - stopifnot(inherits(x, "block_descr")) attr(x, field) @@ -20,11 +18,9 @@ block_descr_getter <- function(field) { } block_descrs_getter <- function(descr_getter, ptype = character(1L)) { - getter <- force(descr_getter) function(blocks = available_blocks()) { - if (inherits(blocks, "block_descr")) { blocks <- list(blocks) } @@ -44,7 +40,6 @@ block_descr <- block_descrs_getter(block_descr_getter("description")) new_block_descr <- function(constructor, name, description, classes, input, output, pkg, category) { - stopifnot( is.function(constructor), is_string(name), is_string(description), is_string(category), @@ -53,7 +48,8 @@ new_block_descr <- function(constructor, name, description, classes, input, ) structure( - constructor, name = name, description = description, + constructor, + name = name, description = description, classes = classes, input = input, output = output, package = pkg, category = category, class = "block_descr" ) @@ -72,18 +68,18 @@ block_registry <- new.env() #' @rdname available_blocks #' @export register_block <- function( - constructor, - name, - description, - classes, - input, - output, - package = NA_character_, - category = "uncategorized" -) { - - descr <- new_block_descr(constructor, name, description, classes, input, - output, package, category) + constructor, + name, + description, + classes, + input, + output, + package = NA_character_, + category = "uncategorized") { + descr <- new_block_descr( + constructor, name, description, classes, input, + output, package, category + ) id <- classes[1L] @@ -98,16 +94,14 @@ register_block <- function( #' @rdname available_blocks #' @export register_blocks <- function( - constructor, - name, - description, - classes, - input, - output, - package = NA_character_, - category = "uncategorized" -) { - + constructor, + name, + description, + classes, + input, + output, + package = NA_character_, + category = "uncategorized") { if (length(constructor) == 1L && !is.list(classes)) { classes <- list(classes) } @@ -141,13 +135,9 @@ get_block_descr <- function(id) { #' @rdname available_blocks #' @export unregister_blocks <- function(ids = NULL, package = NULL) { - if (is.null(ids) && is.null(package)) { - ids <- list_blocks() - } else if (not_null(package)) { - stopifnot(is_string(package)) pkgs <- eapply(block_registry, `attr`, "package") @@ -163,7 +153,6 @@ unregister_blocks <- function(ids = NULL, package = NULL) { } register_blockr_blocks <- function(pkg) { - if (missing(pkg)) { pkg <- pkg_name() } @@ -232,12 +221,12 @@ register_blockr_blocks <- function(pkg) { c("rds_block", "parser_block", "transform_block"), c("json_block", "parser_block", "transform_block"), c("xpt_block", "parser_block", "transform_block"), - c("filter_block", "transform_block", "submit_block"), + c("filter_block", "transform_block"), c("select_block", "transform_block"), - c("summarize_block", "transform_block", "submit_block"), + c("summarize_block", "transform_block"), c("arrange_block", "transform_block"), c("group_by_block", "transform_block"), - c("join_block", "transform_block", "submit_block"), + c("join_block", "transform_block"), c("head_block", "transform_block"), c("mutate_block", "transform_block") ), @@ -303,7 +292,6 @@ register_blockr_blocks <- function(pkg) { #' @rdname available_blocks #' @export construct_block <- function(block, ...) { - if (is_string(block)) { block <- get_block_descr(block) } diff --git a/_pkgdown.yml b/_pkgdown.yml index 4645e5ae..095072b7 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -206,6 +206,6 @@ reference: news: releases: - - text: "blockr 0.0.2.9020" + - text: "blockr 0.0.2.9021" - text: "blockr 0.0.2" - text: "blockr 0.0.1.9000"