Skip to content

Commit

Permalink
(devel/R-withr) Updated 2.4.3 to 2.5.0
Browse files Browse the repository at this point in the history
# withr 2.5.0

* `defer()` and all `local_*()` functions now work when run inside of
  a `.Rmd`. The deferred expressions are executed when knitr exits.

* `defer()` and `local_` functions now work within `source()`.
  The deferred expressions are executed when `source()` exits.

* `with_()` and `local_()` gain a `get` argument. Supply a getter
  function to create `with` and `local` functions that are robust to
  early exits.

  When supplied, this restoration pattern is used:

  ```
  old <- get()
  on.exit(set(old))
  set(new)
  action()
  ```

  Instead of:

  ```
  old <- set(new)
  on.exit(set(old))
  action()
  ```

  This ensures proper restoration of the old state when an early exit
  occurs during `set()` (for instance when a deprecation warning is
  caught, see #191).

* These `with_` and `local_` functions are now robust to early exits (see next bullet):

  - `_locale()`
  - `_envvar()`
  - `_libpaths()`
  - `_options()`
  - `_par()`
  - `_path()`
  - `_seed()`

* `with_namespace()` and `local_namespace()` now pass `warn.conflicts`
  to `attach()` (@kyleam, #185).

* `local_rng_version()` and `local_seed()` no longer warn when
  restoring `sample.kind` to `"Rounding"` (#167).

* `with_seed()` now preserves the current values of `RNGkind()` (#167).

* `with_collate()` is no longer affected by the `LC_COLLATE`
  environment variable set to "C" (#179).

* Local evaluations in the `globalenv()` (as opposed to top-level
  ones) are now unwound in the same way as regular environments.

* `local_tempfile()` gains a lines argument so, if desired, you can pre-fill
  the temporary file with some data.
  • Loading branch information
mef committed Apr 30, 2022
1 parent 1ce3711 commit ed1bf6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions devel/R-withr/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# $NetBSD: Makefile,v 1.7 2022/04/23 23:56:46 gutteridge Exp $
# $NetBSD: Makefile,v 1.8 2022/04/30 14:47:28 mef Exp $

R_PKGNAME= withr
R_PKGVER= 2.4.3
R_PKGVER= 2.5.0
CATEGORIES= devel

MAINTAINER= pkgsrc-users@NetBSD.org
COMMENT= Run code 'with' temporarily modified global state
LICENSE= gnu-gpl-v2 OR gnu-gpl-v3

TEST_DEPENDS+= R-RSQLite-[0-9]*:../../databases/R-RSQLite
TEST_DEPENDS+= R-callr-[0-9]*:../../devel/R-callr
TEST_DEPENDS+= R-covr-[0-9]*:../../devel/R-covr
TEST_DEPENDS+= R-knitr-[0-9]*:../../print/R-knitr
TEST_DEPENDS+= R-rmarkdown-[0-9]*:../../textproc/R-rmarkdown
TEST_DEPENDS+= R-testthat-[0-9]*:../../devel/R-testthat

USE_LANGUAGES= # none

Expand Down
8 changes: 4 additions & 4 deletions devel/R-withr/distinfo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$NetBSD: distinfo,v 1.8 2022/04/23 23:56:46 gutteridge Exp $
$NetBSD: distinfo,v 1.9 2022/04/30 14:47:28 mef Exp $

BLAKE2s (R/withr_2.4.3.tar.gz) = ec382a5c748d4d5f3cf3746111839c8151a4cb7f06a678e887815e104431439e
SHA512 (R/withr_2.4.3.tar.gz) = 2f07c97c5781c4ef3dee02c33842f192af6638cb59899e2560bf8b89583a55ef6472212c78c388fb6021621b53b00b11d01bfef8ee57c7d7a6711acb1c3323ce
Size (R/withr_2.4.3.tar.gz) = 96600 bytes
BLAKE2s (R/withr_2.5.0.tar.gz) = 5e9b11b49b3a3e4f78c80c84e007cbfd0353b3e8d4d77da60617adf351af77c9
SHA512 (R/withr_2.5.0.tar.gz) = 9fb29b1d2866803e1a5e2b2ca6790c1c7531e43d8805f722930512803e60481c7ed5b034ee85ec9c4f5bae40e39238e8fcb435f7b290f71dfda0fc9f219e65ec
Size (R/withr_2.5.0.tar.gz) = 102089 bytes

0 comments on commit ed1bf6a

Please sign in to comment.