mirror of https://git.sr.ht/~hrbrmstr/vershist
boB Rudis
6 years ago
10 changed files with 96 additions and 2 deletions
@ -1,3 +1,4 @@ |
|||
0.1.0 |
|||
* Initial release |
|||
* Support for Apache httpd, lighttpd, mongodb, nginx, mysql, openresty, sendmail and sqlite |
|||
* Support for Apache httpd, lighttpd, mongodb, nginx, mysql, openresty, openssh, |
|||
sendmail and sqlite |
@ -0,0 +1,44 @@ |
|||
#' Retrieve OpenSSH (non-portable) Version Release History |
|||
#' |
|||
#' Reads <https://www.openssh.com/releasenotes.html> to build a data frame of |
|||
#' OpenSSH (non-portable) version release numbers and dates with semantic version |
|||
#' strings parsed and separate fields added. The data frame is also arranged in |
|||
#' order from lowest version to latest version and the `vers` column is an |
|||
#' ordered factor. |
|||
#' |
|||
#' @md |
|||
#' @note File an issue or PR if the "portable" equivalent is needed |
|||
#' @export |
|||
openssh_version_history <- function() { |
|||
|
|||
pg <- xml2::read_html("https://www.openssh.com/releasenotes.html") |
|||
|
|||
dplyr::data_frame( |
|||
|
|||
vers = rvest::html_nodes( |
|||
pg, xpath=".//h3/a[contains(@href, 'release') and not(contains(@name, 'p'))]" |
|||
) %>% |
|||
rvest::html_attr("name"), |
|||
|
|||
rls_date = rvest::html_nodes( |
|||
pg, xpath=".//h3/a[contains(@href, 'release') and not(contains(@name, 'p'))]/.." |
|||
) %>% |
|||
rvest::html_text() %>% |
|||
stri_extract_first_regex("[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}") |
|||
|
|||
) %>% |
|||
dplyr::filter(!is.na(rls_date)) %>% # 3.8.1p1 is portable only and we grab non-p |
|||
dplyr::mutate(rls_date = as.Date(rls_date)) %>% |
|||
dplyr::mutate(rls_year = lubridate::year(rls_date)) %>% |
|||
dplyr::mutate( |
|||
vers = ifelse(stri_count_fixed(vers, ".") == 1, sprintf("%s.0", vers), vers) |
|||
) %>% |
|||
dplyr::bind_cols( |
|||
semver::parse_version(.$vers) %>% |
|||
dplyr::as_data_frame() |
|||
) %>% |
|||
dplyr::arrange(major, minor, patch) %>% |
|||
dplyr::mutate(vers = factor(vers, levels = vers)) |
|||
|
|||
} |
|||
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,18 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/openssh.R |
|||
\name{openssh_version_history} |
|||
\alias{openssh_version_history} |
|||
\title{Retrieve OpenSSH (non-portable) Version Release History} |
|||
\usage{ |
|||
openssh_version_history() |
|||
} |
|||
\description{ |
|||
Reads \url{https://www.openssh.com/releasenotes.html} to build a data frame of |
|||
OpenSSH (non-portable) version release numbers and dates with semantic version |
|||
strings parsed and separate fields added. The data frame is also arranged in |
|||
order from lowest version to latest version and the \code{vers} column is an |
|||
ordered factor. |
|||
} |
|||
\note{ |
|||
File an issue or PR if the "portable" equivalent is needed |
|||
} |
Loading…
Reference in new issue