Skip to content

Commit

Permalink
Protect pandoc_releases() call on CRAN to avoid API rate limite error…
Browse files Browse the repository at this point in the history
… in checks

This follows an email from CRAN about an error in checks with gh API rate limit.
  • Loading branch information
cderv committed Aug 15, 2023
1 parent 900f263 commit 15031cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/pandoc-browse.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ url_view <- function(...) {
#' @references <https://github.com/jgm/pandoc/releases>
#'
#' @return Open the web page in browser in interactive mode or print the url
#' @examplesIf rlang::is_interactive()
#' @examplesIf rlang::is_interactive() && rlang::is_installed("gh") && attr(curlGetHeaders("https://github.com"), "status") == "200"
#' pandoc_browse_release()
#' pandoc_browse_release("2.14")
#' @export
Expand Down
2 changes: 1 addition & 1 deletion man/pandoc_browse_release.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/testthat/test-pandoc-browse.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ test_that("url_view", {

test_that("pandoc_browse_release()", {
skip_if_not_installed("gh")
skip_if_offline()
skip_on_cran()
# trick to cache releases if not yet to avoid message
suppressMessages(pandoc_releases())
expect_snapshot(pandoc_browse_release())
Expand Down

0 comments on commit 15031cf

Please sign in to comment.