Skip to content

Commit

Permalink
do not export stats_version for #9
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Aug 23, 2021
1 parent a734ef1 commit 2b65dc2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 38 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: roreviewapi
Title: Plumber API to report package structure and function
Version: 0.0.0.124
Version: 0.0.0.125
Authors@R:
person(given = "Mark",
family = "Padgham",
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export(post_to_issue)
export(push_to_gh_pages)
export(serve_api)
export(stats_badge)
export(stats_version)
export(stdout_stderr_cache)
export(symbol_crs)
export(symbol_tck)
Expand Down
42 changes: 21 additions & 21 deletions R/srr.R
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@

#' Get current version of statistical standards
#'
#' @return A single character containing version number
#' @export
stats_version <- function () {

u <- paste0 ("https://raw.githubusercontent.com/",
"ropenscilabs/statistical-software-review-book/",
"main/standards.Rmd")
f <- tempfile (fileext = ".Rmd")
chk <- utils::download.file (u, destfile = f, quiet = TRUE) # nolint

s <- readLines (f, encoding = "UTF-8")

v <- grep ("^\\#\\sStandards\\:\\sVersion", s, value = TRUE)
v <- gsub ("^\\s+", "", strsplit (v, "Version") [[1]] [2])
v <- strsplit (v, "\\s") [[1]] [1]

return (v)
}

#' Get stats badge grade and standards version for a submission
#'
#' @param repo The submission repo
Expand Down Expand Up @@ -61,3 +40,24 @@ get_html_var <- function (x, expr = "submission-type") {

return (x)
}

#' Get current version of statistical standards
#'
#' @return A single character containing version number
#' @noRd
stats_version <- function () {

u <- paste0 ("https://raw.githubusercontent.com/",
"ropenscilabs/statistical-software-review-book/",
"main/standards.Rmd")
f <- tempfile (fileext = ".Rmd")
chk <- utils::download.file (u, destfile = f, quiet = TRUE) # nolint

s <- readLines (f, encoding = "UTF-8")

v <- grep ("^\\#\\sStandards\\:\\sVersion", s, value = TRUE)
v <- gsub ("^\\s+", "", strsplit (v, "Version") [[1]] [2])
v <- strsplit (v, "\\s") [[1]] [1]

return (v)
}
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/roreviewapi",
"issueTracker": "https://github.com/ropensci-review-tools/roreviewapi/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.0.124",
"version": "0.0.0.125",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
14 changes: 0 additions & 14 deletions man/stats_version.Rd

This file was deleted.

0 comments on commit 2b65dc2

Please sign in to comment.