Skip to content

Commit

Permalink
fix: remove setup name in vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
statnmap committed May 7, 2024
1 parent 763c1c0 commit 06968e2
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion R/inflate-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ knitr::opts_chunk$set(
)
```
```{r setup}
```{r}
library(.{pkgname}.)
```
',
Expand Down
4 changes: 3 additions & 1 deletion R/inflate.R
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ inflate <- function(pkg = ".", flat_file,


# Restart RStudio
if (needs_restart) {
is_rstudio <- Sys.getenv("RSTUDIO") == "1"

if (needs_restart & is_rstudio) {
cli::cat_rule("RStudio restart needed")
getFromNamespace("restart_rstudio", "usethis")("A restart of RStudio is required to activate the Build pane")
}
Expand Down
4 changes: 2 additions & 2 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ usethis::with_project(here::here(), {
- flat\_title
- dev\_history.Rmd
- path
- dev/flat\_history\_core.Rmd
- dev/flat\_history/flat\_history\_core.Rmd
- state
- 🛑 inactive
- 🛑 deprecated
- R
- R/fill\_description.R
- 👀 fill\_description
Expand Down
6 changes: 6 additions & 0 deletions dev/dev_history_cran.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ unlink(skeleton_dir, recursive = TRUE)
# _Check in interactive test-inflate for templates and Addins ----
pkgload::load_all()

# /!\ While running these tests manually with `test_file()`,
# do not do anything else in your IDE /!\
# Do not change file open, do not change text in the current file, nothing...
# Unit tests open files interactively and close them
# The focus needs to be kept on what the test is doing
Sys.setenv("NOT_CRAN" = "true")
testthat::test_dir("tests/testthat/")
testthat::test_file("tests/testthat/test-inflate-part1.R")
testthat::test_file("tests/testthat/test-inflate-part2.R")
testthat::test_file("tests/testthat/test-inflate_all.R")
testthat::test_file("tests/testthat/test-inflate_all_utils.R")
testthat::test_file("tests/testthat/test-build_fusen_chunks.R") # Opens files
testthat::test_file("tests/testthat/test-add_flat_template.R")
testthat::test_file("tests/testthat/test-skeleton.R")
testthat::test_file("tests/testthat/test-register_config_file.R") # interactivity
Expand Down
2 changes: 1 addition & 1 deletion dev/flat_get_package_structure.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ draw_the_tree <- function(structure_list, silent = FALSE) {
}
```

```{r examples-get_package_structure, eval=FALSE}
```{r examples-get_package_structure}
#' \dontrun{
#' # This only works inside a 'fusen' built package
#' pkg_structure <- get_package_structure()
Expand Down
2 changes: 1 addition & 1 deletion inst/rmarkdown/templates/additional/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ skeleton()

```{r tests-skeleton}
test_that("skeleton works", {
expect_true(inherits(skeleton, "function"))
})
```

Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-inflate-part1.R
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,10 @@ usethis::with_project(dummypackage, {
usethis::with_project(dummypackage, {
file.remove(file.path(dummypackage, ".here"))
file.remove(file.path(dummypackage, ".Rbuildignore"))
cat("", file = file.path(dummypackage, "dummy.Rproj"))
cat("", file = file.path(
dummypackage,
paste0(basename(dummypackage), ".Rproj")
))

# Add
# {fusen} steps
Expand Down
2 changes: 1 addition & 1 deletion vignettes/deal-with-a-fusen-flat-file.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r}
library(fusen)
```

Expand Down
4 changes: 1 addition & 3 deletions vignettes/draw-a-map-of-your-package-files-and-functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r}
library(fusen)
```

Expand All @@ -40,8 +40,6 @@ You can know:
With `draw_the_map()`, you can draw a tree of the package structure in the console.

```{r examples-get_package_structure}
#| eval: no
#' \dontrun{
#' # This only works inside a 'fusen' built package
#' pkg_structure <- get_package_structure()
Expand Down
2 changes: 1 addition & 1 deletion vignettes/inflate-all-your-flat-files.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r}
library(fusen)
```

Expand Down
2 changes: 1 addition & 1 deletion vignettes/register-files-in-config.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r}
library(fusen)
```

Expand Down
2 changes: 1 addition & 1 deletion vignettes/share-on-a-github-website.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r}
library(fusen)
```

Expand Down

0 comments on commit 06968e2

Please sign in to comment.