Skip to content

Commit a769c84

Browse files
committed
Release prep
1 parent 510e918 commit a769c84

File tree

6 files changed

+105
-29
lines changed

6 files changed

+105
-29
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ data.rds
1313
^docs$
1414
^pkgdown$
1515
^CRAN-SUBMISSION$
16+
^utils$

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: connections
22
Title: Integrates with the 'RStudio' Connections Pane and 'pins'
3-
Version: 0.2.0.9000
3+
Version: 0.2.1
44
Authors@R:
55
c(
66
person("Edgar", "Ruiz", email = "edgar@posit.co", role = c("aut", "cre")),

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# connections 0.2.1
2+
3+
- Addresses notes from CRAN

cran-comments.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
11
## New submission
22

3-
- Resubmitting after addressing the recommended changes from CRAN
4-
5-
- This submission attempts to restore the 'connections' package to CRAN. The
6-
code, tests, and repository have been updated. The original maintainer has been
7-
restored, with an updated email address. The previous maintainer is no longer
8-
accessible through the email on file for the latest version that was in CRAN.
3+
- Addresses CRAN notes
94

105
## Test environments
116

12-
* Mac OS M1 (aarch64-apple-darwin20), R 4.3.2 (Local)
13-
* Mac OS x86_64-apple-darwin20.0 (64-bit), R 4.3.2 (GH Actions)
14-
* Windows x86_64-w64-mingw32 (64-bit), R 4.3.2 (GH Actions)
15-
* Linux x86_64-pc-linux-gnu (64-bit), R 4.3.2 (GH Actions)
16-
* Linux x86_64-pc-linux-gnu (64-bit), R dev (GH Actions)
17-
* Linux x86_64-pc-linux-gnu (64-bit), R old release (GH Actions)
18-
* Local Mac OS M1 (aarch64-apple-darwin20), R 4.3.1 (Local)
7+
- Mac OS M1 (aarch64-apple-darwin20), R 4.5.0 (Local)
8+
- Windows Server 2022 x64 (build 20348) (x86_64, mingw32) R version 4.5.1 (2025-06-13 ucrt)
9+
- Ubuntu 24.04.3 LTS (x86_64, linux-gnu) R Under development (unstable) (2025-09-09 r88803)
10+
- Ubuntu 24.04.3 LTS (x86_64, linux-gnu) R version 4.4.3 (2025-02-28)
11+
- Ubuntu 24.04.3 LTS (x86_64, linux-gnu) R version 4.5.1 (2025-06-13)
12+
- macOS Sequoia 15.5 (aarch64, darwin20) R version 4.5.1 (2025-06-13)
1913

2014
## R CMD check results
2115

22-
0 errors ✔ | 0 warnings ✔ | 1 note ✖
23-
24-
25-
```
26-
NOTE
27-
Maintainer: ‘Edgar Ruiz <edgar@posit.co>’
28-
29-
New submission
30-
31-
Package was archived on CRAN
32-
33-
CRAN repository db overrides:
34-
X-CRAN-Comment: Archived on 2021-10-19 as check problems were not
35-
corrected in time.
36-
```
16+
0 errors ✔ | 0 warnings ✔ | 0 notes ✔

utils/cran-jobs.R

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
library(gh)
2+
library(purrr)
3+
library(glue)
4+
library(fs)
5+
6+
repo <- "rstudio/connections"
7+
workflow <- "R-CMD-check"
8+
9+
action_runs <- gh(glue("GET /repos/{repo}/actions/runs"))
10+
11+
latest_r_check <- action_runs$workflow_runs |>
12+
keep(\(x) x$name == workflow) |>
13+
head(1)
14+
15+
temp_file <- tempfile(fileext = ".zip")
16+
17+
gh(
18+
endpoint = glue("GET /repos/{repo}/actions/runs/{latest_r_check[[1]]$id}/logs"),
19+
.destfile = temp_file
20+
)
21+
22+
temp_dir <- tempdir()
23+
unzip(temp_file, exdir = temp_dir)
24+
25+
files <- temp_dir |>
26+
dir_ls(glob = "*.txt") |>
27+
keep(\(x) !grepl("git-", x))
28+
29+
get_line <- function(path) {
30+
job_log <- readLines(path)
31+
version_line <- job_log[substr(job_log, 30, 39) == " version "]
32+
version_line <- substr(version_line, 40, nchar(version_line))
33+
system_line <- job_log[substr(job_log, 30, 39) == " system "]
34+
system_line <- substr(system_line, 40, nchar(system_line))
35+
os_line <- job_log[substr(job_log, 30, 39) == " os "]
36+
os_line <- substr(os_line, 40, nchar(os_line))
37+
glue("- {os_line} ({system_line}) {version_line}")
38+
}
39+
40+
files |>
41+
map_chr(get_line) |>
42+
paste0("\n") |>
43+
walk(cat)
44+
45+
46+
dir_delete(temp_dir)

utils/toc.R

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
library(rstudioapi)
2+
3+
toc <- function() {
4+
ac <- getActiveDocumentContext()
5+
content <- ac$contents
6+
7+
is_title <- substr(content, 1, 1) == "#" & substr(content, 2, 2) != "|"
8+
9+
title <- content[is_title]
10+
11+
toc_start <- "<!-- toc: start -->"
12+
toc_end <- "<!-- toc: end -->"
13+
14+
toc <- NULL
15+
for(i in seq_along(title)) {
16+
current_title <- title[i]
17+
if(substr(current_title, 1, 4) == "### ") {
18+
new_title <- substr(current_title, 5, nchar(current_title))
19+
spacing <- " - "
20+
}
21+
if(substr(current_title, 1, 3) == "## ") {
22+
new_title <- substr(current_title, 4, nchar(current_title))
23+
spacing <- "- "
24+
}
25+
if(grepl("\\{", new_title)) {
26+
split_title <- unlist(strsplit(new_title, " "))
27+
new_title <- paste0(split_title[1:(length(split_title) - 1)], collapse = " ")
28+
}
29+
new_link <- tolower(new_title)
30+
new_link <- gsub(" ", "-", new_link)
31+
ret <- paste0(spacing, "[", new_title, "](#", new_link, ")")
32+
toc <- c(toc, ret)
33+
}
34+
35+
toc <- paste0(toc_start, "\n",
36+
paste0(toc, collapse = "\n"),
37+
"\n\n", toc_end)
38+
39+
pos_start <- as.document_position(c(which(content == toc_start), 1))
40+
pos_end <- as.document_position(c(which(content == toc_end), nchar(toc_end) + 1))
41+
42+
pos_range <- document_range(pos_start, pos_end)
43+
44+
modifyRange(pos_range, toc)
45+
46+
}

0 commit comments

Comments
 (0)