Browse Source

check urls

master
boB Rudis 5 years ago
parent
commit
1545533362
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 12
      DESCRIPTION
  2. 10
      NAMESPACE
  3. 3
      NEWS.md
  4. 4
      R/aaa.R
  5. 9
      R/check-package-urls.R
  6. 13
      R/hrbraddins-package.R
  7. 4
      R/refresh-renviron.R
  8. 4
      R/run-tiny-test.R
  9. 8
      README.md
  10. 6
      man/check_package_urls.Rd
  11. 12
      man/hrbraddins.Rd
  12. 11
      man/run_tiny_test.Rd

12
DESCRIPTION

@ -1,8 +1,8 @@
Package: hrbraddins
Type: Package
Title: Additional Addins for RStudio
Version: 0.2.0
Date: 2018-07-25
Title: Moar Addins for RStudio
Version: 0.3.0
Date: 2019-07-25
Author: Bob Rudis (bob@rud.is)
Maintainer: Bob Rudis <bob@rud.is>
Description: Provides additional addins for RStudio.
@ -33,5 +33,9 @@ Imports:
tinytest,
rprojroot,
memoise,
tools
tools,
httr,
janitor,
purrr,
tibble
RoxygenNote: 6.1.1

10
NAMESPACE

@ -20,13 +20,21 @@ import(rstudioapi)
import(shiny)
import(stringi)
import(tinytest)
importFrom(dplyr,as_data_frame)
import(utils)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,distinct)
importFrom(dplyr,filter)
importFrom(dplyr,full_join)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,progress_estimated)
importFrom(gistr,gist_create)
importFrom(httr,GET)
importFrom(httr,status_code)
importFrom(memoise,memoise)
importFrom(purrr,map_dbl)
importFrom(tibble,as_tibble)
importFrom(tidyr,gather)
importFrom(twitteR,tweet)
importFrom(utils,read.csv)

3
NEWS.md

@ -1,3 +1,6 @@
0.3.0
- Check package URLs
0.2.0
* Refresh Renviron

4
R/aaa.R

@ -0,0 +1,4 @@
.pb <- NULL
utils::globalVariables(c(
".", "URL", "env_var", "value", "new_value", ".rs.api.runScriptJob"
))

9
R/check-package-urls.R

@ -1,9 +1,7 @@
#' Check package URLs
#'
#' @param just_pass_or_fail if `TRUE` (default is `FALSE`) just return `TRUE` if
#' all the URL checks result in HTTP `200` status codes.
#' @export
check_package_urls <- function(just_pass_or_fail = FALSE) {
check_package_urls <- function() {
m_GET <- memoise::memoise(httr::GET) # avoid checking URL more than once
@ -37,8 +35,7 @@ check_package_urls <- function(just_pass_or_fail = FALSE) {
tryCatch(httr::status_code(m_GET(url = .x)), error = 599)
})) %>%
janitor::clean_names() %>%
tibble::as_tibble() -> out
if (just_pass_or_fail) all(out$status == 200) else print(out, nrow(out))
tibble::as_tibble() %>%
print(nrow(.))
}

13
R/hrbraddins-package.R

@ -1,15 +1,20 @@
#' Additional Addins for RStudio
#' Moar Addins for RStudio
#'
#' @name hrbraddins
#' @docType package
#' @author Bob Rudis (bob@@rud.is)
#' @import rstudioapi magick pdftools rmarkdown knitr
#' @import rstudioapi magick pdftools rmarkdown knitr utils
#' @importFrom httr GET status_code
#' @importFrom memoise memoise
#' @importFrom gistr gist_create
#' @importFrom twitteR tweet
#' @importFrom utils read.csv
#' @import shiny miniUI stringi
#' @importFrom dplyr as_data_frame bind_cols bind_rows left_join filter full_join
#' @importFrom dplyr bind_cols bind_rows left_join filter full_join progress_estimated
#' @importFrom dplyr distinct mutate
#' @importFrom tibble as_tibble
#' @importFrom purrr map_dbl
#' @importFrom tidyr gather
#' @importFrom uuid UUIDgenerate
#' @import tinytest rprojroot
NULL
"_PACKAGE"

4
R/refresh-renviron.R

@ -7,11 +7,11 @@ refresh_renviron <- function() {
renv <- path.expand("~/.Renviron")
curr_env <- gather(as_tibble(as.list(Sys.getenv())), env_var, value)
curr_env <- tidyr::gather(tibble::as_tibble(as.list(Sys.getenv())), env_var, value)
if (file.exists(renv)) readRenviron(renv)
new_env <- gather(as_data_frame(as.list(Sys.getenv())), env_var, new_value)
new_env <- tidyr::gather(tibble::as_tibble(as.list(Sys.getenv())), env_var, new_value)
both_env <- full_join(curr_env, new_env, by="env_var")

4
R/run-tiny-test.R

@ -1,3 +1,7 @@
#' Run {tinytest} on a package
#'
#' You should really bind this to something like cmd-opt-shift-t.
#'
#' @export
run_tiny_test <- function() {
try(tinytest::test_all(rprojroot::find_package_root_file()), silent = TRUE)

8
README.md

@ -5,7 +5,7 @@ developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.re
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-35.7%25-lightgrey.svg)
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/hrbraddins.svg?branch=master)](https://travis-ci.org/hrbrmstr/hrbraddins)
[![Coverage
@ -59,12 +59,12 @@ remotes::install_github("hrbrmstr/hrbraddins")
NOTE: To use the ‘remotes’ install options you will need to have the
[{remotes} package](https://github.com/r-lib/remotes) installed.
## tdigest Metrics
## hrbraddins Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
| R | 13 | 0.93 | 180 | 0.97 | 84 | 0.84 | 72 | 0.75 |
| Rmd | 1 | 0.07 | 5 | 0.03 | 16 | 0.16 | 24 | 0.25 |
| R | 13 | 0.93 | 180 | 0.97 | 84 | 0.85 | 72 | 0.75 |
| Rmd | 1 | 0.07 | 5 | 0.03 | 15 | 0.15 | 24 | 0.25 |
## Code of Conduct

6
man/check_package_urls.Rd

@ -4,11 +4,7 @@
\alias{check_package_urls}
\title{Check package URLs}
\usage{
check_package_urls(just_pass_or_fail = FALSE)
}
\arguments{
\item{just_pass_or_fail}{if `TRUE` (default is `FALSE`) just return `TRUE` if
all the URL checks result in HTTP `200` status codes.}
check_package_urls()
}
\description{
Check package URLs

12
man/hrbraddins.Rd

@ -4,9 +4,17 @@
\name{hrbraddins}
\alias{hrbraddins}
\alias{hrbraddins-package}
\title{Additional Addins for RStudio}
\title{Moar Addins for RStudio}
\description{
Additional Addins for RStudio
Provides additional addins for RStudio.
}
\seealso{
Useful links:
\itemize{
\item \url{https://gitlab.com/hrbrmstr/hrbraddins}
\item Report bugs at \url{https://gitlab.com/hrbrmstr/hrbraddins/issues}
}
}
\author{
Bob Rudis (bob@rud.is)

11
man/run_tiny_test.Rd

@ -0,0 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/run-tiny-test.R
\name{run_tiny_test}
\alias{run_tiny_test}
\title{Run {tinytest} on a package}
\usage{
run_tiny_test()
}
\description{
You should really bind this to something like cmd-opt-shift-t.
}
Loading…
Cancel
Save