Skip to content

Releases: tidyverse/glue

glue 1.8.0

30 Sep 22:34
Compare
Choose a tag to compare
  • glue has a two new articles:

  • If the last argument of glue() is empty, it is dropped (#320). This makes
    it easy to structure glue() calls with one argument per line, and to anticipate adding arguments:

    glue(
      "here's some text, ",
      "and maybe more text will be added in the future?",
    )
  • glue_sql("{var*}") once again generates NULL if var is empty.
    This reverts #292. (#318).

  • The .envir argument to glue() and glue_data() really must be an
    environment now, as documented. Previously a list-ish object worked in
    some cases (by accident, not really by design). When you need to lookup
    values in a list-ish object, use glue_data(.x =) (#308, #317).
    Ditto for glue_sql() and glue_data_sql().

glue 1.7.0

10 Jan 00:18
Compare
Choose a tag to compare
  • If rlang is installed, glue will generate more informative errors if an
    interpolated expression either can't be parsed or fails to evaluate (#229).

  • + now works in more situations, and gives errors when one side isn't a
    character vector. It no longer automatically applies glue interpolation to
    a non-glue input, if there is one. You'll need to do that yourself (#286).

  • glue_collapse(character()) (and hence glue_sql_collapse(character())) now
    return "", so that they always return a single string (#88).

  • glue_sql() now collapses an empty vector to "" not "NULL" (#272).

  • glue_sql() now uses DBI::dbQuoteLiteral() for all object types. This
    should increase fidelity of escaping for different object types (#279).

  • The "Speed of glue" vignette has been converted to an article, which allows
    several package to be removed from Suggests (and re-located to
    Config/Needs/website). The code got a light refresh, including a switch
    from microbenchmark to bench and more modern use of ggplot2.

  • Add $(C_VISIBILITY) to compiler flags to hide internal symbols from the dll (#284 @lionel-).

glue 1.6.2

24 Feb 16:05
Compare
Choose a tag to compare
  • Modify a test for better forward compatibility with R.

glue 1.6.1

23 Jan 16:10
Compare
Choose a tag to compare
  • glue now registers its custom knitr engines in a way that is more robust to namespace-loading edge cases that can arise during package installation (#254).

glue 1.6.0

17 Dec 17:36
Compare
Choose a tag to compare
  • glue(), glue_data(), glue_col(), and glue_data_col() gain a new .literal argument, which controls how quotes and the comment character are treated when parsing the expression string (#235). This is mostly useful when using a custom transformer.

  • Trailing whitespace-only lines don't interfere with indentation (#247).

glue 1.5.1

30 Nov 14:19
Compare
Choose a tag to compare
  • Jennifer Bryan is now the maintainer.

  • The existing custom language engines for knitr, glue and glue_sql, are documented in a new vignette (#71).

  • glue_col() gives special treatment to styling functions from the crayon package, e.g. glue_col("{blue foo}") "just works" now, even if crayon is not attached (but is installed) (#241).

  • Unterminated backticks trigger the same error as unterminated single or double quotes (#237).

  • glue_sql() collapses zero-length DBI::SQL object into DBI::SQL("NULL") (#244 @shrektan).

glue 1.5.0

08 Nov 18:52
Compare
Choose a tag to compare

Breaking changes

  • Long deprecated function collapse() has been removed (#213)

New functions and arguments

  • New glue_sql_collapse() function to collapse inputs and return a DBI::SQL() object (#103).

  • glue() gains a new .comment argument, to control the comment character (#193).

  • glue() gains a new .null argument, to control the value to replace NULL values with (#217, @echasnovski).

Bugfixes and minor changes

  • sql_quote_transformer() is now allows whitespace after the trailing * (#218).
  • compare_proxy.glue() method defined so glue objects can be compared to strings in testthat 3e without errors (#212)
  • print.glue() no longer prints an empty newline for 0 length inputs (#214)
  • Unterminated comments in glue expression now throw an error (#227, @gaborcsardi)
  • Unterminated quotes in glue expressions now throw an error (#226, @gaborcsardi)

glue v1.4.2

06 Oct 13:46
Compare
Choose a tag to compare
  • glue_safe() gives a slightly nicer error message
  • The required version of R is now 3.2 (#189)
  • glue_sql() now collapses DBI::SQL() elements correctly (#192 @shrektan)
  • The internal compare() method gains a ... argument, for compatibility with testthat 3.0.0

glue 1.4.1

14 May 18:26
Compare
Choose a tag to compare
  • Internal changes for compatibility with vctrs 0.3.0 (#187).
  • glue_sql() now replaces missing values correctly when collapsing values (#185).
  • glue_sql() now always preserves the type of the column even in the presence of missing values (#130)

glue 1.4.0

03 Apr 15:28
Compare
Choose a tag to compare
  • .envir = NULL is now supported and is equivalent to passing .envir = emptyenv() (#140)

  • New glue_safe() and glue_data_safe() functions, safer versions of
    glue() that do not execute code, only look up values (using get()). These
    alternatives are useful for things like shiny applications where you do not
    have control of the input for your glue expressions. (#140)

  • Fixed memory access issue and memory leaks found by valgrind.