Skip to content

Commit c298cb8

Browse files
committed
refactor: adapt code to new funky pkg
1 parent af33df9 commit c298cb8

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

DESCRIPTION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Imports:
1717
clock (>= 0.6.1),
1818
dplyr (>= 1.0.0),
1919
fs (>= 1.4.1),
20+
funky (>= 0.0.9000),
2021
glue (>= 1.4.1),
2122
heck (>= 0.1.1),
2223
magrittr (>= 2.0),
@@ -34,6 +35,7 @@ Suggests:
3435
testthat (>= 3.0.0),
3536
utils
3637
Remotes:
38+
gitlab::rpkg.dev/funky,
3739
gitlab::rpkg.dev/pal,
3840
gitlab::rpkg.dev/pkgpins,
3941
gitlab::rpkg.dev/pkgsnip

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
export(bundled_cli_path)
44
export(bundled_cli_vrsn)
5+
export(funky_config)
56
export(is_latest)
67
export(latest_version)
7-
export(pkg_config)
88
export(pkg_status)
99
export(releases)
1010
importFrom(magrittr,"%!>%")

R/rstd-package.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#' @section Package configuration:
22
#'
3-
#' `r pkgsnip::md_snip(id = "pkg_config", pkg = this_pkg)`
3+
#' `r pkgsnip::md_snip(id = "funky_config")`
44
#'
55
#' ```{r, echo = FALSE}
6-
#' pal::print_pkg_config(this_pkg)
6+
#' funky::print_config()
77
#' ```
88
#'
99
#' @keywords internal

R/rstd.gen.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See `README.md#r-markdown-format` for more information on the literate programming approach used applying the R Markdown format.
33

44
# rstd: Unofficial Utility Functions Around the RStudio IDE
5-
# Copyright (C) 2024 Salim Brüggemann
5+
# Copyright (C) 2025 Salim Brüggemann
66
#
77
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free
88
# Software Foundation, either version 3 of the License, or any later version.
@@ -16,7 +16,7 @@
1616

1717
# clear pkgpins cache
1818
tryCatch(expr = pkgpins::clear_cache(board = pkgpins::board(pkg = pkgname),
19-
max_age = pal::pkg_config_val(key = "global_max_cache_age",
19+
max_age = funky::config_val(key = "global_max_cache_age",
2020
pkg = pkgname)),
2121
error = function(e) cli::cli_alert_warning(text = "Failed to clear pkgpins cache on load of {.pkg {pkgname}}. Error message: {e$message}"))
2222
}
@@ -276,11 +276,11 @@ pkg_status <- function() {
276276

277277
#' `r this_pkg` package configuration metadata
278278
#'
279-
#' A [tibble][tibble::tbl_df] with metadata of all possible `r this_pkg` package configuration options. See [pal::pkg_config_val()] for more information.
279+
#' A [tibble][tibble::tbl_df] with metadata of all possible `r this_pkg` package configuration options. See [funky::config_val()] for more information.
280280
#'
281-
#' @format `r pkgsnip::return_lbl("tibble_cols", cols = colnames(pkg_config))`
281+
#' @format `r pkgsnip::return_lbl("tibble_cols", cols = colnames(funky_config))`
282282
#' @export
283283
#'
284284
#' @examples
285-
#' rstd::pkg_config
286-
"pkg_config"
285+
#' rstd::funky_config
286+
"funky_config"

R/sysdata.rda

28 Bytes
Binary file not shown.

Rmd/rstd.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ editor_options:
1212
1313
# clear pkgpins cache
1414
tryCatch(expr = pkgpins::clear_cache(board = pkgpins::board(pkg = pkgname),
15-
max_age = pal::pkg_config_val(key = "global_max_cache_age",
15+
max_age = funky::config_val(key = "global_max_cache_age",
1616
pkg = pkgname)),
1717
error = function(e) cli::cli_alert_warning(text = "Failed to clear pkgpins cache on load of {.pkg {pkgname}}. Error message: {e$message}"))
1818
}
@@ -382,17 +382,17 @@ pkg_status <- function() {
382382

383383
## Miscellaneous
384384

385-
### `pkg_config`
385+
### `funky_config`
386386

387387
```{r}
388388
#' `r this_pkg` package configuration metadata
389389
#'
390-
#' A [tibble][tibble::tbl_df] with metadata of all possible `r this_pkg` package configuration options. See [pal::pkg_config_val()] for more information.
390+
#' A [tibble][tibble::tbl_df] with metadata of all possible `r this_pkg` package configuration options. See [funky::config_val()] for more information.
391391
#'
392-
#' @format `r pkgsnip::return_lbl("tibble_cols", cols = colnames(pkg_config))`
392+
#' @format `r pkgsnip::return_lbl("tibble_cols", cols = colnames(funky_config))`
393393
#' @export
394394
#'
395395
#' @examples
396-
#' rstd::pkg_config
397-
"pkg_config"
396+
#' rstd::funky_config
397+
"funky_config"
398398
```

Rmd/sysdata.nopurl.Rmd

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,19 @@ editor_options:
1010

1111
- The chunks below have to be manually executed in order to regenerate the package data.
1212

13-
- Although the datasets below are saved as ["internal data" in `R/sysdata.rda`](https://r-pkgs.org/data.html#sec-data-sysdata), they can still be
14-
exported and documented (by documenting the dataset's quoted name in the main `.Rmd` source file – which only works when the dataset is also `@export`ed),
15-
something [not explicitly mentioned](https://coolbutuseless.github.io/2018/12/10/r-packages-internal-and-external-data/) in the book [R
13+
- Although the datasets below are saved as ["internal data" in `R/sysdata.rda`](https://r-pkgs.org/data.html#sec-data-sysdata), they can still be exported and
14+
documented (by documenting the dataset's quoted name in the main `.Rmd` source file – which only works when the dataset is also `@export`ed), something [not
15+
explicitly mentioned](https://coolbutuseless.github.io/2018/12/10/r-packages-internal-and-external-data/) in the book [R
1616
Packages](https://r-pkgs.org/data.html#sec-data-data). To do so, you first need to manually add the `export()` directive in the NAMESPACE file since
1717
roxygen2 won't add it automatically.
1818

1919
# Define data
2020

21-
## `pkg_config`
21+
## `funky_config`
2222

2323
```{r}
24-
pkg_config <-
25-
tibble::tibble(key = character(),
26-
default_value = list(),
27-
description = character()) %>%
24+
funky_config <-
25+
funky::ptype_config %>%
2826
tibble::add_row(key = "global_max_cache_age",
2927
default_value = list("30 days"),
3028
description = pkgsnip::md_snip("opt_global_max_cache_age"))
@@ -36,7 +34,7 @@ Save all the small data objects as a single internal file `R/sysdata.rda`. Note
3634
to package users.
3735

3836
```{r}
39-
usethis::use_data(pkg_config,
37+
usethis::use_data(funky_config,
4038
internal = TRUE,
4139
overwrite = TRUE,
4240
compress = "xz",
Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgdown/_pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ reference:
1010
- bundled_cli_vrsn
1111
- pkg_status
1212
- title: Miscellaneous
13-
- contents: pkg_config
13+
- contents: funky_config

0 commit comments

Comments
 (0)