diff --git a/DESCRIPTION b/DESCRIPTION index e712590a..9b982d76 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,6 +23,7 @@ Suggests: tidyverse Config/testthat/edition: 3 Imports: + cli, curl (>= 5.1.0), httr2, lifecycle, diff --git a/R/helper.R b/R/helper.R index 27d5c3e5..95e252fd 100644 --- a/R/helper.R +++ b/R/helper.R @@ -311,41 +311,22 @@ startup_message <- function( pkgversion ) { - # 1) get github release - # using rvest - # - # NOTE: This is risky in case - # urls changes. Outcommented until a - # better solution to display deevelopment + cran version - # in startuÄ - # github_release <- rvest::html_text( - # rvest::html_element( - # css = 'small', - # rvest::html_element( - # css = 'div', - # rvest::html_element( - # css = 'nav', - # rvest::read_html( - # x = 'https://serkor1.github.io/cryptoQuotes/index.html' - # ) - # ) - # ) - # ) - # ) - - # 2) Generate CLI - # formatted messages - c( - paste('Loading', pkgname), - 'i' = paste('CRAN version:', pkgversion), - # 'i' = paste('Development version:', github_release), - '*' = paste('Release notes:', "https://serkor1.github.io/cryptoQuotes/news/index.html") + cli::rule( + left = paste(pkgname, cli::col_br_blue(pkgversion)), + right = cli::style_hyperlink( + text = paste( + cli::col_br_blue('release notes') + ), + url = 'https://serkor1.github.io/cryptoQuotes/news/index.html' + + ) ) } + # validators; #### date_validator <- function( from, diff --git a/R/zzz.R b/R/zzz.R index 229de49f..93391976 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -4,8 +4,10 @@ # objective: # script start; -.onAttach <- function(libname, pkgname) { +.onAttach <- function(libname, pkgname,...) { + # 1) startup message with + # using cli::rule msg <- startup_message( pkgname = pkgname, pkgversion = utils::packageVersion( @@ -13,12 +15,21 @@ ) ) - rlang::inform( - msg, - class = "packageStartupMessage" + + rlang::inform( + msg + , + ..., + class = "packageStartupMessage" ) + + + + + + } # script end; diff --git a/README.md b/README.md index bfb58b57..977cb169 100644 --- a/README.md +++ b/README.md @@ -193,122 +193,122 @@ Volume -2024-01-08 02:30:00 +2024-01-08 11:30:00 -43636.94 +44196.7 -43668.14 +44688 -43175 +44154.28 -43371.09 +44635.99 -1740.05517 +2259.56815 -2024-01-08 03:00:00 +2024-01-08 12:00:00 -43371.09 +44636 -43442.42 +45200 -43225 +44350 -43277.82 +44518.16 -1138.00533 +5567.92331 -2024-01-08 03:30:00 +2024-01-08 12:30:00 -43277.83 +44518.15 -43568.85 +45120.05 -43257.29 +44518.15 -43518.2 +45111.09 -984.91972 +1949.63739 -2024-01-08 04:00:00 +2024-01-08 13:00:00 -43518.2 +45111.1 -43598 +45179.14 -43430.79 +44948.83 -43530.33 +45098 -591.54225 +1995.89183 -2024-01-08 04:30:00 +2024-01-08 13:30:00 -43530.34 +45098 -43610.68 +45108.38 -43500 +44807.56 -43599.26 +44911.58 -523.47388 +1327.42193 -2024-01-08 05:00:00 +2024-01-08 14:00:00 -43599.26 +44911.58 -43599.27 +45031.31 -43590.62 +44832 -43590.62 +45002.78 -2.06449 +871.80155