Skip to content

Commit

Permalink
chore(NEWS.md): update workflow link to point to the v2 branch of r-l…
Browse files Browse the repository at this point in the history
…ib/actions repository

fix(R/zzz.R): remove unused function is_url_available

chore(codemeta.json): update fileSize field to 65.928KB

chore(man/gitignore-package.Rd): update bug report link to point to PMassicotte/gitignore repository

feat(vignettes/introduction.Rmd): add code chunk to check availability of https://www.toptal.com/developers/gitignore URL
  • Loading branch information
PMassicotte committed Dec 10, 2023
1 parent 58baa15 commit bcb4311
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# gitignore (development version)

- Skip or do not execute code chunks in vignettes if the internet or the gitignore API is not available, to fix CRAN problems.
- Update workflow link to point to the v2 branch of r-lib/actions repository.

# gitignore 0.1.5

Expand Down
9 changes: 0 additions & 9 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
backend_url <- function() {
"https://www.toptal.com/developers/gitignore"
}

is_url_available <- function(url_in = backend_url()) {
con <- url(url_in)
check <- suppressWarnings(
try(open.connection(con, open = "rt", timeout = 2), silent = TRUE)[1]
)
suppressWarnings(try(close.connection(con), silent = TTRUE))
ifelse(is.null(check), TRUE, FALSE)
}
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
},
"SystemRequirements": null
},
"fileSize": "65.748KB",
"fileSize": "65.928KB",
"releaseNotes": "https://github.com/ropensci/gitignore/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/gitignore/blob/main/README.md",
"contIntegration": ["https://app.codecov.io/gh/ropensci/gitignore?branch=main", "https://github.com/PMassicotte/gitignore/actions/workflows/R-CMD-check.yaml"],
Expand Down
3 changes: 2 additions & 1 deletion man/gitignore-package.Rd

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

13 changes: 13 additions & 0 deletions vignettes/introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ knitr::opts_chunk$set(
```

```{r, echo = FALSE}
is_url_available <- function() {
con <- url("https://www.toptal.com/developers/gitignore")
check <- suppressWarnings(
try(open.connection(con, open = "rt", timeout = 2), silent = TRUE)[1]
)
suppressWarnings(try(close.connection(con), silent = TTRUE))
ifelse(is.null(check), TRUE, FALSE)
}
```


## Basic idea

Based on the definition proposed by [freecodecamp](https://www.freecodecamp.org/news/gitignore-what-is-it-and-how-to-add-to-repo/):
Expand Down

0 comments on commit bcb4311

Please sign in to comment.