~hrbrmstr/vershist

a16be72813c19113a0c27bf3a651e8ef79b40395 — hrbrmstr 2 years ago e9f606f
fixups for scrapers; added cache/refresh for mysql and etcd
2 files changed, 19 insertions(+), 3 deletions(-)

M R/openresty.R
M man/openresty_version_history.Rd
M R/openresty.R => R/openresty.R +13 -2
@@ 7,9 7,15 @@
#' ordered factor.
#'
#' @md
#' @param refresh if `TRUE` and there `~/.vershist` cache dir exists, will
#'        cause the version history database for apache to be rebuilt. Defaults
#'        to `FALSE` and has no effect if `~/.vershist` cache dir does not exist.
#' @note This function requires a valid GitHub API key stored in `GITHUB_PAT`
#' @export
openresty_version_history <- function() {
openresty_version_history <- function(refresh = FALSE) {

  tech <- "openresty"
  if (use_cache() && (!refresh) && is_cached(tech)) return(read_from_cache(tech))

  page <- gh::gh("/repos/openresty/openresty/tags")



@@ 52,6 58,11 @@ openresty_version_history <- function() {
    dplyr::mutate_at(.vars=c("major", "minor", "patch", "build"), .funs=c(as.integer)) %>%
    dplyr::arrange(major, minor, patch) %>%
    dplyr::mutate(vers = factor(vers, levels=vers)) %>%
    dplyr::select(vers, rls_date, rls_year, major, minor, patch, prerelease, build)
    dplyr::select(vers, rls_date, rls_year, major, minor, patch, prerelease, build) -> out


  if (use_cache() && (refresh || (!is_cached(tech)))) write_to_cache(out, tech)

  out

}
\ No newline at end of file

M man/openresty_version_history.Rd => man/openresty_version_history.Rd +6 -1
@@ 4,7 4,12 @@
\alias{openresty_version_history}
\title{Retrieve openresty Version Release History}
\usage{
openresty_version_history()
openresty_version_history(refresh = FALSE)
}
\arguments{
\item{refresh}{if \code{TRUE} and there \verb{~/.vershist} cache dir exists, will
cause the version history database for apache to be rebuilt. Defaults
to \code{FALSE} and has no effect if \verb{~/.vershist} cache dir does not exist.}
}
\description{
Reads \url{https://github.com/openresty/openresty/releases} to build a data frame of