Skip to content

Commit

Permalink
Fix semver_gt/lt examples
Browse files Browse the repository at this point in the history
* semver_gt/lt always parses version strings with parse_odkc_version and therefore accepts strings with complete or partial semantic versions.
  • Loading branch information
florianm committed Mar 13, 2024
1 parent 8f55458 commit a940692
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions R/ru_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,9 @@ get_default_odkc_version <- function() {
#' @export
#' @examples
#' get_default_odkc_version() |> semver_gt("0.8.0")
#' "2024.1.1" |>
#' parse_odkc_version() |>
#' semver_gt("2024.1.0")
#' "2024.1.1" |>
#' parse_odkc_version() |>
#' semver_gt("2024.1.1")
#' "2024.1.1" |>
#' parse_odkc_version() |>
#' semver_gt("2024.1.2")
#' "2024.1.1" |> semver_gt("2024.1.0")
#' "2024.1.1" |> semver_gt("2024.1.1")
#' "2024.1.1" |> semver_gt("2024.1.2")
semver_gt <- function(sv = get_default_odkc_version(), to = "1.5.0") {
base_version <- parse_odkc_version(sv, env_var = "")
to_version <- parse_odkc_version(to, env_var = "")
Expand All @@ -668,15 +662,9 @@ semver_gt <- function(sv = get_default_odkc_version(), to = "1.5.0") {
#' @export
#' @examples
#' get_default_odkc_version() |> semver_lt("0.8.0")
#' "2024.1.1" |>
#' parse_odkc_version() |>
#' semver_lt("2024.1.0")
#' "2024.1.1" |>
#' parse_odkc_version() |>
#' semver_lt("2024.1.1")
#' "2024.1.1" |>
#' parse_odkc_version() |>
#' semver_lt("2024.1.2")
#' "2024.1.1" |> semver_lt("2024.1.0")
#' "2024.1.1" |> semver_lt("2024.1.1")
#' "2024.1.1" |> semver_lt("2024.1.2")
semver_lt <- function(sv = get_default_odkc_version(), to = "1.5.0") {
base_version <- parse_odkc_version(sv, env_var = "")
to_version <- parse_odkc_version(to, env_var = "")
Expand Down

0 comments on commit a940692

Please sign in to comment.