Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 680454c

Browse files
committed
a few fixes for some other fxns that need to fail with scope info
bump to v0.4.2 update news and cran comments
1 parent bdedfc5 commit 680454c

File tree

9 files changed

+31
-20
lines changed

9 files changed

+31
-20
lines changed

DESCRIPTION

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ Description: Work with 'GitHub' 'gists' from 'R' (e.g.,
1010
'gist' 'commits', and get rate limit information when 'authenticated'. Some
1111
requests require authentication and some do not. 'Gists' website:
1212
<https://gist.github.com/>.
13-
Version: 0.4.1.9313
13+
Version: 0.4.2
1414
Authors@R: c(
15-
person("Scott", "Chamberlain", role = c("aut", "cre"), email = "[email protected]"),
15+
person("Scott", "Chamberlain", role = c("aut", "cre"),
16+
email = "[email protected]",
17+
comment = c(ORCID="0000-0003-1444-9135")),
1618
person("Ramnath", "Vaidyanathan", role = "aut"),
1719
person("Karthik", "Ram", role = "aut")
1820
)
@@ -29,7 +31,6 @@ Imports:
2931
rmarkdown,
3032
dplyr
3133
Suggests:
32-
roxygen2 (>= 6.0.1),
3334
git2r,
3435
testthat
3536
RoxygenNote: 6.0.1

NEWS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
gistr 0.4.2
2+
===============
3+
4+
### NEW FEATURES
5+
6+
* `gist()` gains a parameter `revision` to request a specific revision of a gists. note that the returned brief print out of the gist in your console may not vary from revision to revision, but the underlying data has the correct data for the revision (#71)
7+
8+
### MINOR IMPROVEMENTS
9+
10+
* affecting all functions that create data `gist_create()`, `gist_create_git()`, `gist_create_obj()`, `update()`, `delete()`: GitHub for good reason gives a 404 when there are authentication issues. A common problem is that a user has incorrect or missing scopes. We now attempt to detect this scope problem specifically and throw a message when that happens (#70)
11+
* toggle whether we index to a git path with `@` vs. `$` depending on `git2r` package version; for an upcoming version of `git2r` (#74)
12+
13+
114
gistr 0.4.0
215
===============
316

R/gist_create_git.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ cgist <- function(description, public) {
263263
)
264264
), auto_unbox = TRUE)
265265
)
266+
stopstatus(res)
266267
jsonlite::fromJSON(httr::content(res, "text", encoding = "UTF-8"), FALSE)
267268
}
268269

R/rate_limit.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#' @param ... Named args to \code{\link[httr]{GET}}
55
#' @examples \dontrun{
66
#' rate_limit()
7-
#' rate_limit(config=verbose())
87
#' }
98

109
rate_limit <- function(...){

R/update.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
#' @param gist A gist object or something coerceable to a gist
55
#' @param description (character) Brief description of gist (optional)
66
#' @template all
7+
#' @return
78
#' @examples \dontrun{
89
#' file1 <- system.file("examples", "alm.md", package = "gistr")
910
#' file2 <- system.file("examples", "zoo.json", package = "gistr")
1011
#'
1112
#' # add new files
1213
#' gists(what = "minepublic")[[3]] %>%
1314
#' add_files(file1, file2) %>%
14-
#' update(config = verbose())
15+
#' update()
1516
#'
1617
#' # update existing files
1718
#' ### file name has to match to current name

R/zzz.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ gist_PUT <- function(url, auth, headers, ...){
9090
}
9191

9292
gist_DELETE <- function(url, auth, headers, ...){
93-
DELETE(url, auth, headers, ...)
93+
res <- DELETE(url, auth, headers, ...)
94+
stopstatus(res, 204)
95+
res
9496
}
9597

9698
process <- function(x){
@@ -100,8 +102,8 @@ process <- function(x){
100102
jsonlite::fromJSON(temp, FALSE)
101103
}
102104

103-
stopstatus <- function(x) {
104-
if (x$status_code > 203) {
105+
stopstatus <- function(x, status_stop = 203) {
106+
if (x$status_code > status_stop) {
105107
res <- jsonlite::fromJSON(httr::content(x, as = "text",
106108
encoding = "UTF-8"), FALSE)
107109
errs <- sapply(res$errors, function(z) paste(names(z), z, sep = ": ",

cran-comments.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Test environments
22

3-
* local OS X install, R 3.3.3
4-
* ubuntu 12.04 (on travis-ci), R 3.3.3
3+
* local OS X install, R 3.5.0
4+
* ubuntu 14.04 (on travis-ci), R 3.5.0
55
* win-builder (devel and release)
66

77
## R CMD check results
@@ -11,21 +11,16 @@
1111
License components with restrictions and base license permitting such:
1212
MIT + file LICENSE
1313
File 'LICENSE':
14-
YEAR: 2017
14+
YEAR: 2018
1515
COPYRIGHT HOLDER: Scott Chamberlain
1616

1717
## Reverse dependencies
1818

19-
* I have run R CMD check on the 6 downstream dependencies.
20-
(Summary at <https://github.com/ropensci/gistr/tree/master/revdep>).
21-
* None had problems.
22-
* All revdep maintainers were notified of the release.
19+
I have run R CMD check on the 5 downstream dependencies. Summary at <https://github.com/ropensci/gistr/tree/master/revdep>. None had problems.
2320

2421
---
2522

26-
This version fixes a bug and changes function name in a dependency
27-
package in anticipation of a new version of it on CRAN (dplyr).
28-
23+
This version makes a change to accomodate an upcoming change in git2r, one of our dependencies - as well as a few other minor improvements.
2924

3025
Thanks!
3126
Scott Chamberlain

man/rate_limit.Rd

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/update.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)