Skip to content

Releases: tidyverse/glue

glue 1.3.2

19 Mar 14:53
Compare
Choose a tag to compare
  • glue now implements vctrs methods. This ensures that vectors of glue
    strings are compatible with tidyverse packages like tidyr
    (r-lib/tidyselect#170, tidyverse/tidyr#773, @lionel-).

  • Fix a LTO type mismatch warning (#146)

  • glue_sql() now quotes lists of values appropriate to their type, rather
    than coercing all values to characters (#153)

  • glue_data() now implicitly coerces .x to a list.

  • glue() gains the .trim argument, like glue_data().

  • single_quote() double_quote() and backtick() all return NA for NA
    inputs (#135).

  • Improve trim()'s handling of lines containing only indentation (#162, #163, @alandipert)

Glue v1.3.1

27 Mar 19:33
Compare
Choose a tag to compare

Features

  • glue() now has a + method to combine strings.

Bugfixes and minor changes

  • glue_sql() now supports unquoting lists of Id objects.
  • glue_sql() now quotes characters with NAs appropriately (#115).
  • glue_sql() now quotes Dates appropriately (#98).
  • A potential protection error reported by rchk was fixed.

Glue v1.3.0

27 Mar 19:33
Compare
Choose a tag to compare

Breaking changes

  • The evaluate() function has been removed. Changes elsewhere in glue made
    the implementation trivial so it was removed for clarities sake. Previous
    uses can be replaced by eval(parse(text = text), envir).

  • collapse() has been renamed to glue_collapse() to avoid namespace
    collisions with dplyr::collapse().

Features

  • compare.glue() was added, to make it easier to use glue objects in
    testthat::expect_equal() statements.

  • glue_col() and glue_data_col() functions added to display strings with
    color.

Bugfixes and minor changes

  • Glue now throws an informative error message when it cannot interpolate a
    function into a string (#114, @haleyjeppson & @ijlyttle).

  • Glue now evaluates unnamed arguments lazily with delayedAssign(), so there
    is no performance cost if an argument is not used. (#83, @egnha).

  • Fixed a bug where names in the assigned expression of an interpolation
    variable would conflict with the name of the variable itself (#89, @egnha).

  • Do not drop the glue class when subsetting (#66).

  • Fix glue() and collapse() always return UTF-8 encoded strings (#81, @dpprdan)

glue 1.2.0

30 Oct 19:08
Compare
Choose a tag to compare

glue 1.2.0

  • The implementation has been tweaked to be slightly faster in most cases.

  • glue() now has a .transformer argument, which allows you to use custom
    logic on how to evaluate the code within glue blocks. See
    vignettes("transformers") for more details and example transformer
    functions.

  • glue() now returns NA if any of the results are NA and .na is NULL.
    Otherwise NA values are replaced by the value of .na.

  • trim() to use the trimming logic from glue is now exported.

  • glue_sql() and glue_data_sql() functions added to make constructing SQL
    statements with glue safer and easier.

  • glue() is now easier to use when used within helper functions such as
    lapply.

  • Fix when last expression in glue() is NULL.

glue 1.1.1

23 Jun 15:10
Compare
Choose a tag to compare
  • Another fix for PROTECT / REPROTECT found by the rchk static analyzer.

glue v1.1.0

13 Jun 21:09
Compare
Choose a tag to compare

Fix for PROTECT errors when resizing output strings.

glue() always returns 'UTF-8' strings, converting inputs if in other
encodings if needed.

to() and to_data() have been removed.

glue() and glue_data() can now take alternative delimiters to { and }.
This is useful if you are writing to a format that uses a lot of braces, such
as LaTeX. (#23)

collapse() now returns 0 length output if given 0 length input (#28).