diff --git a/DESCRIPTION b/DESCRIPTION index 5d2e2486..afcbe3c6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: bio Type: Package Title: Resources Manager for R, RStudio and Related Software -Version: 0.2.5 -Date: 2024-05-27 +Version: 0.2.6 +Date: 2024-07-31 Authors@R: person("Vilmantas", "Gegzna", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9500-5167"), @@ -18,12 +18,13 @@ Language: en-US Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Additional_repositories: https://mokymai.github.io/download/ Imports: backup.tools (>= 0.0.3), checkmate, + cli, clipr, crayon, desc, diff --git a/R/packages--check.R b/R/packages--check.R index a3c1eb38..41bd257e 100644 --- a/R/packages--check.R +++ b/R/packages--check.R @@ -208,7 +208,8 @@ read_pkgs_list <- function(list_name, "It seems that there is no online version of list ", "{list_name_blue} or it cannot be accessed. ", "\nCheck if the list name is correct. ", - "Did you mean one of: \n{usethis::ui_value(bio::get_pkg_lists_local())}, ..." + "Did you mean one of: \n", + "{usethis::ui_value(bio::get_pkg_lists_local())}, ..." )) } else { usethis::ui_stop(w$message) @@ -239,7 +240,8 @@ get_path_pkgs_list <- function(list_name, local_list) { usethis::ui_stop(paste0( "List {list_name_blue} was not found on your computer. \n", "Check if the list name is correct. ", - "Did you mean one of: \n{usethis::ui_value(bio::get_pkg_lists_local())}, ..." + "Did you mean one of: \n", + "{usethis::ui_value(bio::get_pkg_lists_local())}, ..." )) } @@ -475,7 +477,8 @@ merge_pkgs_status_lists <- function(pkgs_list, pkgs_installed, #' head(get_pkgs_installation_status_raw("mini")) get_pkgs_installation_status_raw <- function(list_name = NULL, pkgs = NULL, local_list = getOption( - "bio.local_list", TRUE)) { + "bio.local_list", TRUE + )) { checkmate::assert_character(list_name, null.ok = TRUE) checkmate::assert_character(pkgs, null.ok = TRUE) if (is.null(list_name) && is.null(pkgs)) { @@ -508,7 +511,6 @@ get_pkgs_installation_status_raw <- function(list_name = NULL, pkgs = NULL, - # Installation status -------------------------------------------------------- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # diff --git a/R/paths-and-files.R b/R/paths-and-files.R index 2381fa80..8b207f71 100644 --- a/R/paths-and-files.R +++ b/R/paths-and-files.R @@ -195,7 +195,7 @@ get_path_rstudio_internal_state_dir <- function(..., .check = FALSE) { # Linux/Mac: ~/.rstudio-desktop - if (rstudioapi::isAvailable() && rstudioapi::versionInfo()$version >= 1.4) { + if (rstudioapi::isAvailable() && rstudioapi::versionInfo()$version >= "1.4") { # RStudio 1.4 base <- switch(get_os_type(), diff --git a/R/programs.R b/R/programs.R index ce24625d..1244b085 100644 --- a/R/programs.R +++ b/R/programs.R @@ -41,7 +41,7 @@ check_user_info <- function() { #' @param skip_online_check (logical) If `TRUE`, the numbers of newest available #' stable programs are downloaded, when internet connection is connected. #' @param type (character) Which programs should be checked? Options: -#' `main`, `all`, `gmc-bs`, `gmc-r`. +#' `main`, `all`, `dev`, `gmc-bs`, `gmc-r`. #' #' @return #' Invisible `NULL`. @@ -64,7 +64,7 @@ check_installed_programs <- function(type = "main", skip_online_check = FALSE) { type_lwr <- tolower(type) - if (!type_lwr %in% c("main", "all", "gmc-bs", "gmc-r")) { + if (!type_lwr %in% c("main", "dev", "all", "gmc-bs", "gmc-r")) { ui_warn("Unknown value of type = '{type}'") } @@ -92,17 +92,17 @@ check_installed_programs <- function(type = "main", skip_online_check = FALSE) { "R Build Tools" } - check_tool_installed( - tool_name, - if (rstudioapi::isAvailable()) { - # Requires RStudio to be running - rstudioapi::buildToolsCheck() - } else { - pkgbuild::has_build_tools() - } - ) - - + if (type_lwr %in% c("all", "dev")) { + check_tool_installed( + tool_name, + if (rstudioapi::isAvailable()) { + # Requires RStudio to be running + rstudioapi::buildToolsCheck() + } else { + pkgbuild::has_build_tools() + } + ) + } # XQuartz (on Mac) if (type_lwr %in% c("all", "gmc-bs")) { @@ -177,14 +177,11 @@ get_available_r_version <- function(force = FALSE, skip = FALSE) { purrr::reduce(c) %>% stringr::str_extract("(?<=R-).\\d*[.].\\d*[.]\\d*(?=.tar.gz)") %>% .[!is.na(.)] %>% - numeric_version() %>% + as.numeric_version() %>% max() } else { - ui_warn(paste( - "To get the newest availableR version, network connection is required.", - "You are offline. " - )) + msg_offline(get_what = "R version") NULL } } @@ -202,28 +199,30 @@ get_available_rs_version <- function(force = FALSE, skip = FALSE) { readr::read_lines() %>% stringr::str_extract("(?<=RStudio-).*?(?=.exe)") %>% .[!is.na(.)] %>% - numeric_version() %>% + as.numeric_version() %>% max() } else { - ui_warn(paste( - "To get the newest available RStudio version,", - "network connection is required. You are offline. " - )) + msg_offline(get_what = "RStudio version") } } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -check_internet_connection <- function() { +msg_offline <- function(get_what = "versions") { + cli::cli_warn(c( + "To get the newest available {get_what}, network connection is required.", + "x" = "This computer is offline. " + )) +} + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +check_internet_connection <- function(get_what = "versions") { if (pingr::is_online()) { FALSE # Online } else { - ui_warn(paste0( - "To get the newest available versions, network connection is required. ", - "You are offline. " - )) + msg_offline(get_what = get_what) TRUE # Offline } } @@ -238,8 +237,8 @@ check_program_version <- function(name = "", v_installed = NULL, r_color <- red install_status <- "" - v_recommended <- numeric_version(v_recommended) - v_installed <- numeric_version(v_installed) + v_recommended <- as.numeric_version(v_recommended) + v_installed <- as.numeric_version(v_installed) if (!is.null(v_available)) { diff --git a/README.Rmd b/README.Rmd index c4776cc0..72a04599 100644 --- a/README.Rmd +++ b/README.Rmd @@ -39,8 +39,8 @@ Convenience functions to facilitate installation and management of required reso

-This package is intended to be used with RStudio 2022.06.0 or newer
-and R 4.3.1 or newer.
+This package is intended to be used with RStudio 2024.04 or newer
+and R 4.4.0 or newer.
Functions may not work correctly with the previous versions of RStudio and R. diff --git a/inst/install-r/pkgs-required-version.txt b/inst/install-r/pkgs-required-version.txt index 221d41d8..5f2cfe2a 100644 --- a/inst/install-r/pkgs-required-version.txt +++ b/inst/install-r/pkgs-required-version.txt @@ -1,6 +1,6 @@ --- title: "Minimal required versions of packages" -date: 2024-05-27 +date: 2024-07-31 notes: "" @@ -13,7 +13,7 @@ addin.tools | 0.0.10 | FALSE | - addins.rmd | 0.0.14 | FALSE | - addins.rs | 0.0.12 | FALSE | - backup.tools | 0.0.3 | FALSE | - -bio | 0.2.5 | FALSE | - +bio | 0.2.6 | FALSE | - BiocManager | 1.30.20 | FALSE | - blogdown | 1.9 | FALSE | - bookdown | 0.32 | FALSE | - diff --git a/inst/install-r/programs-required-version.txt b/inst/install-r/programs-required-version.txt index 9710cf9f..88e496ee 100644 --- a/inst/install-r/programs-required-version.txt +++ b/inst/install-r/programs-required-version.txt @@ -1,6 +1,6 @@ --- title: "Minimal required versions of programs" -date: 2024-05-27 +date: 2024-07-31 notes: "" @@ -9,8 +9,8 @@ notes: "" --- # This text must be in line 10 ----------------------------------------------- program | required_version | ignore | notes_version -R | 4.3.3 | FALSE | -RStudio | 2023.12.1 | FALSE | For 32-bit systems v 1.1.463 -Quarto | 1.4.554 | FALSE | +R | 4.4.0 | FALSE | +RStudio | 2024.04 | FALSE | For 32-bit systems v 1.1.463 +Quarto | 1.5.55 | FALSE | diff --git a/inst/rs-settings/keybindings--addins.json b/inst/rs-settings/keybindings--addins.json index b07f0d80..f883903d 100644 --- a/inst/rs-settings/keybindings--addins.json +++ b/inst/rs-settings/keybindings--addins.json @@ -1,6 +1,5 @@ { - "addins.rmd::rmd_code_block_python" : "Ctrl+R", - "addins.rmd::rmd_code_block_r" : "Ctrl+E", + "addins.rmd::rmd_code_block_r" : "Ctrl+R", "addins.rmd::rmd_code_inline_highlighted_as_r" : "Ctrl+Shift+Alt+T", "addins.rmd::rmd_equation_a_inline" : "Shift+Alt+S", "addins.rmd::rmd_format_bold" : "Ctrl+Alt+B", diff --git a/inst/rs-settings/rstudio-prefs--bio-default.json b/inst/rs-settings/rstudio-prefs--bio-default.json index 5e992228..a46c1ee3 100644 --- a/inst/rs-settings/rstudio-prefs--bio-default.json +++ b/inst/rs-settings/rstudio-prefs--bio-default.json @@ -105,7 +105,7 @@ "memory_query_interval_seconds" : 10, "native_file_dialogs" : true, "navigate_to_build_error" : true, - "new_proj_git_init" : true, + "new_proj_git_init" : false, "new_proj_use_renv" : false, "num_spaces_for_tab" : 2, "packages_pane_enabled" : true, @@ -116,7 +116,7 @@ "publish_ca_bundle" : "", "publish_check_certificates" : true, "python_project_environment_automatic_activate": true, - "rainbow_fenced_divs" : true, + "rainbow_fenced_divs" : false, "rainbow_parentheses" : true, "real_time_spellchecking" : true, "reduced_motion" : false, @@ -167,7 +167,7 @@ "show_rmd_render_command" : false, "show_terminal_tab" : true, "show_user_home_page" : "sessions", - "soft_wrap_r_files" : true, + "soft_wrap_r_files" : false, "soft_wrap_rmd_files" : true, "sort_file_names_naturally" : true, "source_with_echo" : true, @@ -198,7 +198,6 @@ "ui_language" : "en", "use_dataimport" : true, "use_devtools" : true, - "use_internet2" : true, "use_newlines_in_makefiles" : true, "use_publish_ca_bundle" : false, "use_roxygen" : false, @@ -215,7 +214,7 @@ "visual_markdown_editing_font_size_points" : 0, "visual_markdown_editing_is_default" : false, "visual_markdown_editing_list_spacing" : "tight", - "visual_markdown_editing_max_content_width" : 700, + "visual_markdown_editing_max_content_width" : 1000, "visual_markdown_editing_references_location" : "section", "visual_markdown_editing_show_doc_outline" : true, "visual_markdown_editing_show_margin" : true, diff --git a/man/check_installed_programs.Rd b/man/check_installed_programs.Rd index eba5f486..a012d3c9 100644 --- a/man/check_installed_programs.Rd +++ b/man/check_installed_programs.Rd @@ -8,7 +8,7 @@ check_installed_programs(type = "main", skip_online_check = FALSE) } \arguments{ \item{type}{(character) Which programs should be checked? Options: -\code{main}, \code{all}, \code{gmc-bs}, \code{gmc-r}.} +\code{main}, \code{all}, \code{dev}, \code{gmc-bs}, \code{gmc-r}.} \item{skip_online_check}{(logical) If \code{TRUE}, the numbers of newest available stable programs are downloaded, when internet connection is connected.}