-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Cazelles
committed
Oct 27, 2020
1 parent
d973895
commit 8f99a9d
Showing
11 changed files
with
99 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
^README.Rmd$ | ||
^README_files/ | ||
^\.github/workflows/R-CMD-check\.yaml$ | ||
^.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# rowlbot 1.0.0.9000 | ||
|
||
* `rob_get_secret()`, `rob_set_token()`, `forget_token()` are now exposed. | ||
* `rowlbot()``gains two arguments: `token` and `...`. | ||
* `rob_getsecret()` is now `rob_get_secret()` for names consistency. | ||
|
||
|
||
# rowlbot 1.0.0 | ||
|
||
* Initial release (see README). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#' Get, set and forget authentification token. | ||
#' | ||
#' @param token authentification token (obtained at <https://owlbot.info/>). | ||
#' | ||
#' @export | ||
rob_get_secret <- function() { | ||
val <- Sys.getenv("OWLBOT_TOKEN") | ||
if (identical(val, "")) { | ||
message(" | ||
`OWLBOT_TOKEN` env var has not been set yet. | ||
A token is required to use the OWLBOT API, see | ||
https://owlbot.info/ | ||
") | ||
rob_set_token() | ||
val <- rob_get_secret() | ||
} | ||
val | ||
} | ||
|
||
#' @describeIn rob_get_secret set token interactively. | ||
#' @export | ||
rob_set_token <- function(token = NULL) { | ||
if (is.null(token)) | ||
token <- readline("Enter your token without quotes: ") | ||
if (identical(token, "")) { | ||
stop("No token has been provided.") | ||
} else { | ||
Sys.setenv(OWLBOT_TOKEN = token) | ||
cat("Authentication token stored for the session.\n") | ||
} | ||
invisible(NULL) | ||
} | ||
|
||
#' @describeIn rob_get_secret forget token. | ||
#' @export | ||
forget_token <- function() Sys.unsetenv("OWLBOT_TOKEN") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters