Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-pandoc@v1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-pandoc@v1

Expand Down
45 changes: 30 additions & 15 deletions R/read_log_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,27 +191,42 @@ parse_log <- function(nested_log) {
fill = "right"
) %>%
dplyr::mutate(dplyr::across(tidyselect::where(is.character), stringr::str_trim))

parsed_log$`Session Information`$`Packages` <-
nested_log$`Session Information`$`Packages` %>%
# remove indicator whether the package is attached to the search path
stringr::str_replace_all("\\*", " ") %>%
# account for loaded packages due to load_all()
stringr::str_replace_all(" P ", " ") %>%
readr::read_table(skip = 1, col_names = FALSE) %>%
dplyr::rename_with(~ c(
"package",
"version",
"date",
"lib",
"source",
"lang",
"r_version"
)) %>%
dplyr::mutate(
lang = stringr::str_remove(lang, "\\("),
r_version = stringr::str_remove(r_version, "\\)")
)
readr::read_table(skip = 1, col_names = FALSE)

# handle case where log is has 7 columns due to sessioninfo v1.2.2 or earlier
if (ncol(parsed_log$`Session Information`$`Packages`) == 7) {
parsed_log$`Session Information`$`Packages` <-
parsed_log$`Session Information`$`Packages` %>%
dplyr::rename_with(~ c(
"package",
"version",
"date",
"lib",
"source",
"lang",
"r_version"
)) %>%
dplyr::mutate(
lang = stringr::str_remove(lang, "\\("),
r_version = stringr::str_remove(r_version, "\\)")
)
} else {
parsed_log$`Session Information`$`Packages` <-
parsed_log$`Session Information`$`Packages` %>%
dplyr::rename_with(~ c(
"package",
"version",
"date",
"lib",
"source"
))
}

parsed_log$`Session Information`$`External software` <-
nested_log$`Session Information`$`External software` %>%
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-sha1.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_that("Test 1: File HashSum does not change for ex1.R", {
flines <- readLines(con)
close(con)

expect_true(any(grepl("File HashSum: e3b7438926d8fc6e55d927db377c9670a057e0a8", flines) == TRUE))
expect_true(any(grepl("File HashSum: 69bba3ee00038e547f0a95b6b62d16f9a56a946b", flines) == TRUE))

# remove all the stuff we added
rm(scriptPath, logDir)
Expand Down
Loading