Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lockedata/starters
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: CaRdiffR/pRojects
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 4 commits
  • 6 files changed
  • 2 contributors

Commits on Nov 30, 2017

  1. Create testSwagger

    DaveRGP authored Nov 30, 2017

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4196546 View commit details
  2. move testSwagger to tests

    hturner committed Nov 30, 2017
    Copy the full SHA
    65b30b0 View commit details
  3. import swag from swagger

    hturner committed Nov 30, 2017
    Copy the full SHA
    9938823 View commit details
  4. Copy the full SHA
    4503fd0 View commit details
Showing with 63 additions and 1 deletion.
  1. +3 −1 DESCRIPTION
  2. +2 −0 NAMESPACE
  3. +22 −0 R/createSwaggerProject.R
  4. +1 −0 R/pRojects-package.r
  5. +30 −0 man/createSwaggerProject.Rd
  6. +5 −0 tests/testthat/test-createSwaggerProject.R
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@ Imports: devtools,
packrat,
shiny,
miniUI,
methods
methods,
swagger
Remotes: jonmcalder/swagger
Roxygen: list(markdown = TRUE)
RoxygenNote: 6.0.1
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -3,5 +3,7 @@
export(createAnalysisProject)
export(createBasicProject)
export(createPackageProject)
export(createSwaggerProject)
export(createTrainingProject)
importFrom(swagger,swag)
importFrom(utils,packageVersion)
22 changes: 22 additions & 0 deletions R/createSwaggerProject.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#' Create Package from Swagger API
#'
#' @param name Project
#' @param dir Directory to create
#' @param url URL or path to swagger JSON specification
#' @param overwrite Should we overwrite `dir` if it exists? (default: FALSE)
#'
#' @return path to the newly created package path
#' @export
#'
#' @examples
#' \dontrun{
#' createSwaggerProject("petstore",
#' dir = getwd(),
#' url = "http://petstore.swagger.io/v2/swagger.json")
#' }
createSwaggerProject <- function(name,
dir = name,
url,
overwrite = FALSE){
swag(spec = url, pkg_name = name, target_dir = dir, overwrite = overwrite)
}
1 change: 1 addition & 0 deletions R/pRojects-package.r
Original file line number Diff line number Diff line change
@@ -10,5 +10,6 @@
#' @name pRojects
#' @docType package
#'
#' @importFrom swagger swag
#' @importFrom utils packageVersion
NULL
30 changes: 30 additions & 0 deletions man/createSwaggerProject.Rd

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

5 changes: 5 additions & 0 deletions tests/testthat/test-createSwaggerProject.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
context("createSwaggerProject")

test_that("see if can call swagger",{
expect_output(print(swag))
})