This repository has been archived by the owner on Nov 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip ci]
- Loading branch information
Showing
6 changed files
with
92 additions
and
7 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
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,42 @@ | ||
#' Remove tokens | ||
#' | ||
#' If there is a file with saved tokens it will delete it. | ||
#' | ||
#' This functions helps to comply with CRAN policy to remove files created by | ||
#' the package. | ||
#' @param old A logical value if you want to remove old tokens. | ||
#' @param new A logical value if you want to remove new tokens. | ||
#' | ||
#' @return An invisible logical value showing the success of the operation. | ||
#' If no tokens need to be deleted it will return FALSE too. | ||
#' `NULL` if there is nothing to do. | ||
#' @export | ||
#' @examples | ||
#' auth_clean(FALSE, FALSE) | ||
auth_clean <- function(old = TRUE, new = FALSE) { | ||
stopifnot(is_logical(old)) | ||
stopifnot(is_logical(new)) | ||
|
||
if (isFALSE(old) && isFALSE(new)) { | ||
inform(c("Nothing to do", | ||
i = "Did you meant to set `old = TRUE`?")) | ||
return(invisible(NULL)) | ||
} | ||
old_tokens <- find_old_tokens() | ||
tools_tokens <- find_tools_tokens() | ||
all_tokens_files <- c(old_tokens, tools_tokens) | ||
if (is.null(all_tokens_files)) { | ||
inform("No tokens were found! Nothing to do.") | ||
return(invisible(NULL)) | ||
} | ||
ot <- FALSE | ||
nt <- FALSE | ||
if (length(old_tokens) != 0 && old) { | ||
ot <- unlink(old_tokens) | ||
} | ||
if (length(tools_tokens) != 0 && new) { | ||
nt <- unlink(tools_tokens) | ||
} | ||
out <- old && ot || new && nt | ||
invisible(out) | ||
} |
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,5 @@ | ||
Update to add some functions, fix a bug and remove some links to removed documentation. | ||
There might be some errors following links, sometimes Twitter.com or rOpenSci block the CRAN checks of urls. | ||
|
||
Checks passed locally, in R-Hub there is a NOTE about lastMiKTeXException which apparently could be ignored. | ||
This submission so close to the previous one is because there is an ERROR in one of the CRAN checks after acceptance. | ||
This is probably caused by a previous version not following CRAN's policy of not writing to user directory. | ||
The example detected a file with the pattern .rtweet_token.*rds in the user directory. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.