Skip to content

Commit

Permalink
v0.2.6
Browse files Browse the repository at this point in the history
Merge pull request #37 from mokymai/devel
  • Loading branch information
GegznaV authored Jul 31, 2024
2 parents 730650f + 0f53f37 commit 79de00b
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 54 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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"),
Expand All @@ -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,
Expand Down
10 changes: 6 additions & 4 deletions R/packages--check.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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())}, ..."
))
}

Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -508,7 +511,6 @@ get_pkgs_installation_status_raw <- function(list_name = NULL, pkgs = NULL,




# Installation status --------------------------------------------------------
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
Expand Down
2 changes: 1 addition & 1 deletion R/paths-and-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
59 changes: 29 additions & 30 deletions R/programs.R
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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}'")
}

Expand Down Expand Up @@ -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")) {
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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
}
}
Expand All @@ -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)) {

Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Convenience functions to facilitate installation and management of required reso
<center>
<br>
<font color="darkred" size=4>
This package is intended to be used with <b>RStudio 2022.06.0</b> or newer<br>
and <b>R 4.3.1</b> or newer.<br>
This package is intended to be used with <b>RStudio 2024.04</b> or newer<br>
and <b>R 4.4.0</b> or newer.<br>
</font>
<font color="darkred" size=3>
Functions may not work correctly with the previous versions of RStudio and R.
Expand Down
4 changes: 2 additions & 2 deletions inst/install-r/pkgs-required-version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Minimal required versions of packages"
date: 2024-05-27
date: 2024-07-31
notes: ""


Expand All @@ -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 | -
Expand Down
8 changes: 4 additions & 4 deletions inst/install-r/programs-required-version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Minimal required versions of programs"
date: 2024-05-27
date: 2024-07-31
notes: ""


Expand All @@ -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 |


3 changes: 1 addition & 2 deletions inst/rs-settings/keybindings--addins.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 4 additions & 5 deletions inst/rs-settings/rstudio-prefs--bio-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion man/check_installed_programs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 79de00b

Please sign in to comment.