From 2c902f9a065644ac98de3c39e340fdfcb25a9d78 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Sun, 25 May 2025 12:10:06 +0200 Subject: [PATCH] refactor: :truck: rename to samwise --- DESCRIPTION | 10 +++++----- R/admin.R | 2 +- R/checks.R | 2 +- R/common-files.R | 8 ++++---- R/course-metadata.R | 2 +- R/create-group-names.R | 4 ++-- R/post-course.R | 2 +- README.md | 22 ++++++---------------- inst/templates/planning-issue.md | 8 ++++---- justfile | 6 +++--- r3admin.Rproj => samwise.Rproj | 0 11 files changed, 28 insertions(+), 38 deletions(-) rename r3admin.Rproj => samwise.Rproj (100%) diff --git a/DESCRIPTION b/DESCRIPTION index b8b65a0..2727cf8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,15 +1,15 @@ Type: Package -Package: r3admin -Title: R-Cubed Teaching Helper Functions. +Package: samwise +Title: The Trusty Sidekick for Managing the Rostools Workshops Version: 0.0.1 Authors@R: person("Luke", "Johnston", , "lwjohnst@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-4169-2616")) Description: Contains functions to help with managing, running, and - developing the r-cubed courses. + developing the rostools workshops. License: MIT + file LICENSE -URL: https://github.com/rostools/r3admin -BugReports: https://github.com/rostools/r3admin/issues +URL: https://github.com/rostools/samwise +BugReports: https://github.com/rostools/samwise/issues Depends: R (>= 2.10) Imports: diff --git a/R/admin.R b/R/admin.R index 99e5bec..38ff503 100644 --- a/R/admin.R +++ b/R/admin.R @@ -17,7 +17,7 @@ admin_create_planning_issue <- function(id) { } stamp_format <- lubridate::stamp_date("Mar. 1, 2021", quiet = TRUE) - template_path <- fs::path_package("r3admin", "templates", "planning-issue.md") + template_path <- fs::path_package("samwise", "templates", "planning-issue.md") issue_description <- whisker::whisker.render( # Skip the yaml metadata readr::read_lines(template_path, skip = 7), diff --git a/R/checks.R b/R/checks.R index 94b4515..80c1660 100644 --- a/R/checks.R +++ b/R/checks.R @@ -29,7 +29,7 @@ copy_emails_for_reminder <- function(data) { } copy_reminder_email_text <- function() { - fs::path_package("r3admin", "templates", "email-reminder.txt") %>% + fs::path_package("samwise", "templates", "email-reminder.txt") %>% readr::read_lines() %>% clipr::write_clip() } diff --git a/R/common-files.R b/R/common-files.R index 10b56bb..c241e68 100644 --- a/R/common-files.R +++ b/R/common-files.R @@ -7,11 +7,11 @@ #' copy_common_file <- function(file) { file <- rlang::arg_match(file, fs::path_file(list_common_files())) - common_path <- fs::path_package("r3admin", "common", file) + common_path <- fs::path_package("samwise", "common", file) header_text <- "" if (file == "_variables.yml") { header_text <- glue::glue( - "# Automatically created by `r3admin::copy_common_file('{file}')` on {lubridate::today()}." + "# Automatically created by `samwise::copy_common_file('{file}')` on {lubridate::today()}." ) } if (rprojroot::is_rstudio_project$testfun[[1]](".")) { @@ -35,7 +35,7 @@ copy_common_file <- function(file) { #' @examples #' list_common_files("LICENSE.md") list_common_files <- function(regexp = NULL) { - fs::path_package("r3admin", "common") |> + fs::path_package("samwise", "common") |> fs::dir_ls(regexp = regexp) } @@ -49,7 +49,7 @@ list_common_files <- function(regexp = NULL) { #' @examples #' list_template_files("planning-issue.md") list_template_files <- function(regexp = NULL) { - fs::path_package("r3admin", "templates") |> + fs::path_package("samwise", "templates") |> fs::dir_ls(regexp = regexp) } diff --git a/R/course-metadata.R b/R/course-metadata.R index de7026e..5af2fc2 100644 --- a/R/course-metadata.R +++ b/R/course-metadata.R @@ -7,7 +7,7 @@ #' @examples #' read_course_metadata() read_course_metadata <- function() { - courses_path <- fs::path_package(package = "r3admin", "data", "courses.yaml") + courses_path <- fs::path_package(package = "samwise", "data", "courses.yaml") yaml::read_yaml(courses_path)$course } diff --git a/R/create-group-names.R b/R/create-group-names.R index ab487ba..16aee00 100644 --- a/R/create-group-names.R +++ b/R/create-group-names.R @@ -55,7 +55,7 @@ group_name_to_pdf <- function(group_name, output_dir) { output_file <- stringr::str_replace_all(group_name, "\\.", "-") output_file <- fs::path_ext_set(output_file, "pdf") quarto::quarto_render( - input = fs::path_package("r3admin", "templates", "group-name-pdf.qmd"), + input = fs::path_package("samwise", "templates", "group-name-pdf.qmd"), output_file = output_file, execute_params = list( team_name = group_name @@ -73,7 +73,7 @@ group_names_as_strips_html <- fs::dir_create(output_dir) withr::local_dir(output_dir) quarto::quarto_render( - input = fs::path_package("r3admin", "templates", "group-name-strips.qmd"), + input = fs::path_package("samwise", "templates", "group-name-strips.qmd"), output_file = "group-names-to-cut.html", execute_params = list( name = group_names, diff --git a/R/post-course.R b/R/post-course.R index a9d3f44..db0ca5a 100644 --- a/R/post-course.R +++ b/R/post-course.R @@ -58,7 +58,7 @@ create_course_tag <- function(start_date, message) { #' #' @examples #' \dontrun{ -#' fs::path_package("r3admin", "extdata", "_people.csv") %>% zen_creators_from_csv() +#' fs::path_package("samwise", "extdata", "_people.csv") %>% zen_creators_from_csv() #' } zen_creators_from_csv <- function(path) { # TODO: Need to update this. diff --git a/README.md b/README.md index 3b5c018..57e1f14 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,17 @@ -# r3admin: Helper functions for managing the r-cubed courses +# samwise: The trusty helper for managing the rostools workshops -The goal of r3admin is to help with teaching and general admin for developing -and running the r-cubed courses. +The goal of samwise is to help with teaching and general admin for developing +and running the rostools workshops. ## Installation -You can install the development version of r3admin like so: +You can install the development version of samwise like so: ``` r -# install.packages("remotes") -remotes::install_github("rostools/r3admin") +# install.packages("pak") +pak::pak("rostools/samwise") ``` - -## Example - -This is a basic example which shows you how to solve a common problem: - -``` r -library(r3admin) -## basic example code -``` - diff --git a/inst/templates/planning-issue.md b/inst/templates/planning-issue.md index 7e13062..b9fcd55 100644 --- a/inst/templates/planning-issue.md +++ b/inst/templates/planning-issue.md @@ -21,7 +21,7 @@ Before the course, please review the CONTRIBUTING guide, Code of Conduct, and th ## To do before course -Several of the below tasks (for the admin/lead instructor) can be done using the r3admin package. +Several of the below tasks (for the admin/lead instructor) can be done using the samwise package. - [ ] {{tasks_start_date}}: (Optional) Send an calendar invite to registered participants with link to pre-course tasks and website. - [ ] {{instructors_precourse_meeting}}: Send a calendar invite to instructors/helpers for course location (with planning issue link), dinner locations, and post-course debrief. @@ -43,9 +43,9 @@ Several of the below tasks (for the admin/lead instructor) can be done using the ## To do after course - [ ] Close the Google Forms feedback survey -- [ ] Update git tag and release it (`r3admin::create_course_tag()`) -- [ ] Update course metadata in `r3admin/data/courses.yaml` -- [ ] Update instructor/helper metadata in `r3admin/data/courses.yaml` and `r3admin/data/people/` +- [ ] Update git tag and release it (`samwise::create_course_tag()`) +- [ ] Update course metadata in `samwise/data/courses.yaml` +- [ ] Update instructor/helper metadata in `samwise/data/courses.yaml` and `samwise/data/people/` - [ ] Update Zenodo DOI ## Other details diff --git a/justfile b/justfile index f5f1083..3f30940 100644 --- a/justfile +++ b/justfile @@ -38,13 +38,13 @@ run-targets: draft-reminder-email: run-targets #!/usr/bin/Rscript participant_emails <- get_participant_emails() - r3admin::create_draft_reminder_email() + samwise::create_draft_reminder_email() # Create a GitHub issue for planning the next upcoming course create-upcoming-planning-issue: build #!/usr/bin/Rscript - r3admin::admin_create_planning_issue( - id = r3admin::get_upcoming_course() + samwise::admin_create_planning_issue( + id = samwise::get_upcoming_course() ) # Create the PDF and HTML files used for putting people into the groups diff --git a/r3admin.Rproj b/samwise.Rproj similarity index 100% rename from r3admin.Rproj rename to samwise.Rproj