From 19d43011d05ee2b3784c3ceaa4bdc6240b2b73af Mon Sep 17 00:00:00 2001 From: Trevor Davis Date: Wed, 7 Aug 2019 11:35:47 -0700 Subject: [PATCH] chore: CRAN v1.0.1 re-submission --- .Rbuildignore | 2 + .gitignore | 2 + DESCRIPTION | 6 +- NEWS.md | 5 ++ R/expand.R | 109 ++++++++++++++++++++++++++-------- README.Rmd | 28 +++++---- README.md | 45 +++++++++----- cran-comments.rst | 14 +++++ man/expand_braces.Rd | 8 +-- tests/testthat/test_expand.R | 110 ++++++++++++++++++++--------------- 10 files changed, 223 insertions(+), 106 deletions(-) create mode 100644 cran-comments.rst diff --git a/.Rbuildignore b/.Rbuildignore index dd999b5..1770496 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,4 +1,6 @@ +^cran-comments.rst$ ^README.Rmd$ +^README.html$ ^Rakefile$ ^notes.txt$ ^LICENSE.md$ diff --git a/.gitignore b/.gitignore index 1377554..32117fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ +README.html *.swp +notes.txt diff --git a/DESCRIPTION b/DESCRIPTION index 01564d6..6608427 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,12 @@ Package: bracer -Title: Bash-style Brace Expansion -Version: 0.1.0-0 +Title: Brace Expansions +Version: 1.0.1 Authors@R: person(given = "Trevor", family = "Davis", role = c("aut", "cre"), email = "trevor.l.davis@gmail.com") -Description: Provides partial support for Bash-style brace expansions. +Description: Performs brace expansions on strings. Made popular by Unix shells, brace expansion allows users to quickly generate certain character vectors by taking a single string and (recursively) expanding the comma-separated lists and double-period-separated integer and character sequences enclosed within braces in that string. The double-period-separated numeric integer expansion also supports padding the resulting numbers with zeros. Imports: stringr License: MIT + file LICENSE Encoding: UTF-8 diff --git a/NEWS.md b/NEWS.md index 18cb09f..c2db5ad 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +bracer 1.0.1 +============ + +* ``expand_braces`` can now parse nested braces. + bracer 0.1 ========== diff --git a/R/expand.R b/R/expand.R index ceab3bc..aa948ae 100644 --- a/R/expand.R +++ b/R/expand.R @@ -1,20 +1,27 @@ #' Bash-style brace expansion #' -#' \code{expand_braces} provides partial support for -#' Bash-style brace expansion. +#' \code{expand_braces} performs brace expansions on strings. Made popular by Unix shells, brace expansion allows users to quickly generate certain character vectors by taking a single string and (recursively) expanding the comma-separated lists and double-period-separated integer and character sequences enclosed within braces in that string. The double-period-separated numeric integer expansion also supports padding the resulting numbers with zeros. + #' @param string input character vector #' @return A character vector #' @examples #' expand_braces("Foo{A..F}") #' expand_braces("Foo{01..10}") -#' expand_braces("Foo{A..F}{1..5..2}") -#' expand_braces("Foo{a..f..2}{-01..5}") +#' expand_braces("Foo{A..E..2}{1..5..2}") +#' expand_braces("Foo{-01..1}") +#' expand_braces("Foo{{d..d},{bar,biz}}.{py,bash}") #' @import stringr #' @export expand_braces <- function(string) { - # Find brace starts and ends - brace_token <- "(?X', 'X=X', 'XX', 'X=X', 'X