~hrbrmstr/vershist

f4fde54db900c0016c6a49c6dc80901eeb4a332c — boB Rudis 4 years ago ae08c11
Google Chrome
M NAMESPACE => NAMESPACE +2 -0
@@ 1,6 1,7 @@
# Generated by roxygen2: do not edit by hand

export(apache_httpd_version_history)
export(google_chrome_version_history)
export(is_valid)
export(lighttpd_version_history)
export(memcached_version_history)


@@ 17,6 18,7 @@ importFrom(curl,curl)
importFrom(dplyr,arrange)
importFrom(dplyr,as_data_frame)
importFrom(dplyr,bind_cols)
importFrom(dplyr,distinct)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_at)

M NEWS.md => NEWS.md +2 -2
@@ 1,4 1,4 @@
0.1.0 
* Initial release
* Support for Apache httpd, lighttpd, memcached, mongodb, nginx, mysql, openresty,
  openssh, sendmail and sqlite
\ No newline at end of file
* Support for Apache httpd, Google Chrome lighttpd, memcached, mongodb, nginx, mysql,
  openresty, openssh, sendmail and sqlite
\ No newline at end of file

M R/apache-httpd.R => R/apache-httpd.R +1 -1
@@ 21,7 21,7 @@ apache_httpd_version_history <- function() {
    dplyr::mutate(rls_year = lubridate::year(rls_date)) %>%
    dplyr::bind_cols(
      semver::parse_version(.$vers) %>%
        as_data_frame()
        dplyr::as_data_frame()
    ) %>%
    dplyr::arrange(major, minor, patch) %>%
    dplyr::mutate(vers = factor(vers, levels = vers))

A R/chrome.R => R/chrome.R +35 -0
@@ 0,0 1,35 @@
#' Retrieve Google Chrome Version Release History
#'
#' Reads <https://en.wikipedia.org/wiki/Google_Chrome_version_history"> to build a data
#' frame of Google Chrome 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
#' @export
google_chrome_version_history <- function() {

  pg <- xml2::read_html("https://en.wikipedia.org/wiki/Google_Chrome_version_history")

  dplyr::data_frame(
    vers = rvest::html_nodes(pg, xpath=".//tr/td[1]") %>% rvest::html_text(),
    rls_date = rvest::html_nodes(pg, xpath=".//tr/td[2]") %>%
      rvest::html_text() %>%
      stri_extract_first_regex("[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}")
  ) %>%
    dplyr::filter(!is.na(rls_date)) %>%
    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::distinct(vers, .keep_all=TRUE) %>%
    dplyr::bind_cols(
      semver::parse_version(.$vers) %>%
        dplyr::as_data_frame()
    ) %>%
    dplyr::arrange(major, minor, patch) %>%
    dplyr::mutate(vers = factor(vers, levels = vers))

}
\ No newline at end of file

M R/vershist-package.R => R/vershist-package.R +1 -1
@@ 10,7 10,7 @@
#' @import semver
#' @importFrom purrr keep discard map map_df %>% safely set_names
#' @importFrom dplyr mutate rename select as_data_frame left_join bind_cols arrange
#' @importFrom dplyr rename progress_estimated mutate_at
#' @importFrom dplyr rename progress_estimated mutate_at distinct
#' @importFrom stringi stri_match_first_regex stri_detect_fixed stri_detect_regex
#' @importFrom stringi stri_replace_all_regex stri_replace_first_fixed stri_trans_tolower
#' @importFrom stringi stri_extract_first_regex stri_sub stri_replace_first_regex

M README.Rmd => README.Rmd +7 -0
@@ 18,6 18,7 @@ The following functions are implemented:
Core:

- `apache_httpd_version_history`:	Retrieve Apache httpd Version Release History
- `google_chrome_version_history`:	Retrieve Google Chrome Version Release History
- `lighttpd_version_history`:	Retrieve lighttpd Version Release History
- `memcached_version_history`:	Retrieve memcached Version Release History
- `mongodb_version_history`:	Retrieve MongoDB Version Release History


@@ 57,6 58,12 @@ Apache
apache_httpd_version_history()
```

Google Chrome

```{r chrome, cache=TRUE}
google_chrome_version_history()
```

lighttpd

```{r lighttpd, cache=TRUE}

M README.md => README.md +23 -0
@@ 16,6 16,8 @@ Core:

  - `apache_httpd_version_history`: Retrieve Apache httpd Version
    Release History
  - `google_chrome_version_history`: Retrieve Google Chrome Version
    Release History
  - `lighttpd_version_history`: Retrieve lighttpd Version Release
    History
  - `memcached_version_history`: Retrieve memcached Version Release


@@ 72,6 74,27 @@ apache_httpd_version_history()
    ## 10 1.3.14 2000-10-10     2000     1     3    14 ""         ""   
    ## # ... with 19 more rows

Google Chrome

``` r
google_chrome_version_history()
```

    ## # A tibble: 71 x 8
    ##    vers    rls_date   rls_year major minor patch prerelease build
    ##    <fct>   <date>        <dbl> <int> <int> <int> <chr>      <chr>
    ##  1 0.2.149 2008-09-02    2008.     0     2   149 ""         ""   
    ##  2 0.3.154 2008-10-29    2008.     0     3   154 ""         ""   
    ##  3 0.4.154 2008-11-24    2008.     0     4   154 ""         ""   
    ##  4 1.0.154 2008-12-11    2008.     1     0   154 ""         ""   
    ##  5 2.0.172 2009-05-24    2009.     2     0   172 ""         ""   
    ##  6 3.0.195 2009-10-12    2009.     3     0   195 ""         ""   
    ##  7 4.0.249 2010-01-25    2010.     4     0   249 ""         ""   
    ##  8 4.1.249 2010-03-17    2010.     4     1   249 ""         ""   
    ##  9 5.0.375 2010-05-21    2010.     5     0   375 ""         ""   
    ## 10 6.0.472 2010-09-02    2010.     6     0   472 ""         ""   
    ## # ... with 61 more rows

lighttpd

``` r

A README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.RData => README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.RData +0 -0
A README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdb => README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdb +0 -0
A README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdx => README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdx +0 -0
A man/google_chrome_version_history.Rd => man/google_chrome_version_history.Rd +15 -0
@@ 0,0 1,15 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chrome.R
\name{google_chrome_version_history}
\alias{google_chrome_version_history}
\title{Retrieve Google Chrome Version Release History}
\usage{
google_chrome_version_history()
}
\description{
Reads \url{https://en.wikipedia.org/wiki/Google_Chrome_version_history"} to build a data
frame of Google Chrome 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.
}