Skip to content

Commit 2a621c2

Browse files
committed
Linting to get rid of trailing whitespace.
1 parent 041d529 commit 2a621c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+223
-223
lines changed

R/allocateUploadDirectory.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Allocate a directory for upload
22
#'
33
#' Create a new subdirectory in the staging directory to store files for an upload to the Gobbler registry.
4-
#' If the to-be-uploaded files are saved here, users can avoid an extra copying step in \code{\link{uploadDirectory}}.
4+
#' If the to-be-uploaded files are saved here, users can avoid an extra copying step in \code{\link{uploadDirectory}}.
55
#'
66
#' @param staging String containing the path to the staging directory.
77
#' @param create Logical scalar specifying whether to actually create the subdirectory.
@@ -17,7 +17,7 @@
1717
#' staging <- tempfile()
1818
#' dir.create(staging)
1919
#' allocateUploadDirectory(staging)
20-
#'
20+
#'
2121
#' @export
2222
allocateUploadDirectory <- function(staging, create=TRUE) {
2323
sinfo <- Sys.info()

R/approveProbation.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#'
33
#' Pretty much as it says: approve a probational upload of a version of a project's asset.
44
#' This removes the \code{on_probation} tag from the uploaded version.
5-
#'
5+
#'
66
#' @param project String containing the project name.
77
#' @param asset String containing the asset name.
88
#' @param version String containing the version name.
99
#' @param spoof String containing the name of a user on whose behalf this request is being made.
10-
#' This should only be used if the Gobbler service allows spoofing by the current user.
10+
#' This should only be used if the Gobbler service allows spoofing by the current user.
1111
#' If \code{NULL}, no spoofing is performed.
1212
#' @inheritParams createProject
1313
#'
@@ -17,24 +17,24 @@
1717
#' \code{\link{rejectProbation}}, to reject the probational upload.
1818
#'
1919
#' \code{\link{uploadDirectory}}, to specify probational uploads.
20-
#'
20+
#'
2121
#' @author Aaron Lun
2222
#' @examples
2323
#' info <- startGobbler()
2424
#' removeProject("test", info$staging, url=info$url) # to start with a clean slate.
2525
#' createProject("test", info$staging, url=info$url)
2626
#'
27-
#' # Mocking up an upload.
27+
#' # Mocking up an upload.
2828
#' src <- allocateUploadDirectory(info$staging)
2929
#' write(file=file.path(src, "foo"), "BAR")
30-
#' uploadDirectory("test", "probation", "v1", src,
30+
#' uploadDirectory("test", "probation", "v1", src,
3131
#' staging=info$staging, url=info$url, probation=TRUE)
3232
#' fetchSummary("test", "probation", "v1", registry=info$registry)
3333
#'
3434
#' # After approval, the probation status disappears.
3535
#' approveProbation("test", "probation", "v1", staging=info$staging, url=info$url)
3636
#' fetchSummary("test", "probation", "v1", registry=info$registry)
37-
#'
37+
#'
3838
#' @export
3939
approveProbation <- function(project, asset, version, staging, url, spoof=NULL) {
4040
dump_request(staging, url, "approve_probation", list(project=project, asset=asset, version=version), spoof=spoof)

R/cloneVersion.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' Clone the directory structure for a versioned asset into a separate location.
44
#' This is typically used to prepare a new version for a lightweight upload.
5-
#'
5+
#'
66
#' @param project String containing the project name.
77
#' @param asset String containing the asset name.
88
#' @param version String containing the version name.
@@ -14,27 +14,27 @@
1414
#'
1515
#' @details
1616
#' Cloning involves creating a directory at \code{destination} that has the same structure as that of the specified project-asset-version.
17-
#' All files in the version are represented as symlinks from \code{destination} to the corresponding file in the \code{registry}.
17+
#' All files in the version are represented as symlinks from \code{destination} to the corresponding file in the \code{registry}.
1818
#' The idea is that, when \code{destination} is used in \code{\link{uploadDirectory}}, the symlinks are converted into upload links.
1919
#' This allows users to create new versions very cheaply as duplicate files are not uploaded to/stored in the backend.
2020
#'
21-
#' Users can more-or-less do whatever they want inside the cloned \code{destination},
21+
#' Users can more-or-less do whatever they want inside the cloned \code{destination},
2222
#' but the symlink targets should be read-only as they refer to immutable files in the \code{registry}.
2323
#' If a file in \code{destination} needs to be modified, the symlink should be deleted and replaced with a new file.
2424
#'
2525
#' @author Aaron Lun
2626
#'
2727
#' @seealso
2828
#' \code{\link{allocateUploadDirectory}}, to obtain a possible value for \code{destination}.
29-
#'
29+
#'
3030
#' \code{\link{uploadDirectory}}, to prepare an upload based on the directory contents.
3131
#'
3232
#' @examples
3333
#' info <- startGobbler()
3434
#' removeProject("test", info$staging, url=info$url) # start with a clean slate.
3535
#' createProject("test", info$staging, url=info$url)
36-
#'
37-
#' # Mocking up an upload.
36+
#'
37+
#' # Mocking up an upload.
3838
#' src <- allocateUploadDirectory(info$staging)
3939
#' write(file=file.path(src, "foo"), "BAR")
4040
#' uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)

R/createProject.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#' Create a project
1+
#' Create a project
22
#'
33
#' Create a new project in the registry.
44
#'
55
#' @param project String containing the name of the project to create.
66
#' @param owners Character vector containing the user IDs for owners of this project.
77
#' This defaults to the current user.
88
#' @param uploaders List specifying the authorized uploaders for this project.
9-
#' See the \code{uploaders} field in the \code{\link{fetchPermissions}} return value for the expected format.
9+
#' See the \code{uploaders} field in the \code{\link{fetchPermissions}} return value for the expected format.
1010
#' @param staging String containing the path to the staging directory.
1111
#' @param url String containing the URL of the gobbler REST API.
1212
#'
13-
#' @return \code{NULL} is invisibly returned if the project was successfully created.
13+
#' @return \code{NULL} is invisibly returned if the project was successfully created.
1414
#'
1515
#' @author Aaron Lun
1616
#'

R/fetchDirectory.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
#' or a path to a local cache of the registry's contents otherwise.
2525
#'
2626
#' @author Aaron Lun
27-
#'
27+
#'
2828
#' @examples
2929
#' info <- startGobbler()
3030
#' removeProject("test", info$staging, url=info$url) # start with a clean slate.
3131
#' createProject("test", info$staging, url=info$url)
3232
#'
33-
#' # Mocking up an upload.
33+
#' # Mocking up an upload.
3434
#' src <- allocateUploadDirectory(info$staging)
3535
#' write(file=file.path(src, "foo"), "BAR")
3636
#' dir.create(file.path(src, "whee"))
@@ -42,13 +42,13 @@
4242
#' dir <- fetchDirectory("test/simple/v1", registry=info$registry, url=info$url)
4343
#' dir
4444
#' list.files(dir, recursive=TRUE)
45-
#'
45+
#'
4646
#' # Or, forcing remote access:
4747
#' cache <- tempfile()
48-
#' dir1 <- fetchDirectory("test/simple/v1",
49-
#' registry=info$registry,
50-
#' url=info$url,
51-
#' cache=cache,
48+
#' dir1 <- fetchDirectory("test/simple/v1",
49+
#' registry=info$registry,
50+
#' url=info$url,
51+
#' cache=cache,
5252
#' forceRemote=TRUE
5353
#' )
5454
#' dir1
@@ -94,7 +94,7 @@ fetchDirectory <- function(path, registry, url, cache=NULL, forceRemote=FALSE, o
9494
parallel::parLapply(cl, listing, acquire_file, cache=cache, path=path, url=url, overwrite=overwrite)
9595
}
9696

97-
# We use a directory-level OK file to avoid having to scan through all
97+
# We use a directory-level OK file to avoid having to scan through all
9898
# the directory contents to indicate that it's complete.
9999
dir.create(dirname(ok), showWarnings=FALSE, recursive=TRUE)
100100
write(file=ok, character(0))

R/fetchFile.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
#' @inheritParams fetchDirectory
1212
#'
1313
#' @author Aaron Lun
14-
#'
14+
#'
1515
#' @return String containing the path to the file on the caller's filesystem.
16-
#'
16+
#'
1717
#' @examples
1818
#' info <- startGobbler()
1919
#' removeProject("test", info$staging, url=info$url) # start with a clean slate.
2020
#' createProject("test", info$staging, url=info$url)
2121
#'
22-
#' # Mocking up an upload.
22+
#' # Mocking up an upload.
2323
#' src <- allocateUploadDirectory(info$staging)
2424
#' write(file=file.path(src, "foo"), "BAR")
2525
#' dir.create(file.path(src, "whee"))
@@ -28,7 +28,7 @@
2828
#'
2929
#' fetchFile("test/simple/v1/foo", registry=info$registry, url=info$url)
3030
#' fetchFile("test/simple/v1/whee/blah", registry=info$registry, url=info$url, forceRemote=TRUE)
31-
#'
31+
#'
3232
#' @export
3333
fetchFile <- function(path, registry, url, cache=NULL, forceRemote=FALSE, overwrite=FALSE) {
3434
if (!forceRemote && file.exists(registry)) {

R/fetchLatest.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
#'
33
#' Fetch the latest version of a project's asset.
44
#' This will call the REST API if the caller is not on the same filesystem as the registry.
5-
#'
5+
#'
66
#' @param project String containing the project name.
77
#' @param asset String containing the asset name.
88
#' @inheritParams listProjects
99
#'
10-
#' @return String containing the latest version of the asset.
10+
#' @return String containing the latest version of the asset.
1111
#' This may also be \code{NULL} if the asset has no (non-probational) versions.
1212
#'
1313
#' @author Aaron Lun
1414
#'
1515
#' @examples
1616
#' info <- startGobbler()
1717
#' removeProject("test", info$staging, url=info$url) # start with a clean slate.
18-
#' createProject("test", info$staging, url=info$url)
18+
#' createProject("test", info$staging, url=info$url)
1919
#'
2020
#' # Mocking up a few uploads.
2121
#' src <- allocateUploadDirectory(info$staging)

R/fetchManifest.R

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Fetch version manifest
1+
#' Fetch version manifest
22
#'
33
#' Fetch the manifest for a version of an asset of a project.
44
#' This will call the REST API if the caller is not on the same filesystem as the registry.
@@ -9,24 +9,24 @@
99
#' @inheritParams fetchDirectory
1010
#'
1111
#' @author Aaron Lun
12-
#'
12+
#'
1313
#' @return List containing the manifest for this version.
1414
#' Each element is named after the relative path of a file in this version.
1515
#' The value of each element is another list with the following fields:
1616
#' \itemize{
1717
#' \item \code{size}, an integer specifying the size of the file in bytes.
1818
#' \item \code{md5sum}, a string containing the hex-encoded MD5 checksum of the file.
19-
#' \item \code{link} (optional): a list specifying the link destination for a file.
19+
#' \item \code{link} (optional): a list specifying the link destination for a file.
2020
#' This contains the strings \code{project}, \code{asset}, \code{version} and \code{path}.
2121
#' If the link destination is itself a link, an \code{ancestor} list will be present that specifies the final location of the file after resolving all intermediate links.
2222
#' }
23-
#'
23+
#'
2424
#' @examples
2525
#' info <- startGobbler()
2626
#' removeProject("test", info$staging, url=info$url) # start with a clean slate.
2727
#' createProject("test", info$staging, url=info$url)
2828
#'
29-
#' # Mocking up an upload.
29+
#' # Mocking up an upload.
3030
#' src <- allocateUploadDirectory(info$staging)
3131
#' write(file=file.path(src, "foo"), "BAR")
3232
#' dir.create(file.path(src, "whee"))
@@ -35,14 +35,14 @@
3535
#'
3636
#' # Obtaining the manifest for this version.
3737
#' fetchManifest("test", "simple", "v1", registry=info$registry, url=info$url)
38-
#'
38+
#'
3939
#' # Force remote access.
4040
#' fetchManifest(
41-
#' "test",
42-
#' "simple",
43-
#' "v1",
44-
#' registry=info$registry,
45-
#' url=info$url,
41+
#' "test",
42+
#' "simple",
43+
#' "v1",
44+
#' registry=info$registry,
45+
#' url=info$url,
4646
#' forceRemote=TRUE
4747
#' )
4848
#' @export

R/fetchPermissions.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#' Fetch project permissions
1+
#' Fetch project permissions
22
#'
33
#' Fetch the permissions for a project.
44
#' This will call the REST API if the caller is not on the same filesystem as the registry.
5-
#'
5+
#'
66
#' @param project String containing the project name.
77
#' @param asset String containing the asset name.
88
#' If specified, permissions are retrieved for the asset rather than the entire project.
@@ -25,7 +25,7 @@
2525
#' \item (optional) \code{trusted}, a logical scalar indicating whether the uploader is trusted.
2626
#' If not provided, defaults to \code{FALSE}.
2727
#' }
28-
#' \item (optional) \code{global_write}, a logical scalar indicating whether global writes are enabled.
28+
#' \item (optional) \code{global_write}, a logical scalar indicating whether global writes are enabled.
2929
#' In this mode, any user can create any number of new assets in this project.
3030
#' Each user can also upload new versions of any asset that they created in this mode.
3131
#' }
@@ -40,7 +40,7 @@
4040
#' info <- startGobbler()
4141
#' removeProject("test", info$staging, url=info$url) # start with a clean slate.
4242
#'
43-
#' # Mocking up a project.upload.
43+
#' # Mocking up a project.upload.
4444
#' createProject("test", info$staging, url=info$url,
4545
#' uploaders=list(list(id="urmom", until=Sys.time() + 1000)))
4646
#'

R/fetchSummary.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' @inheritParams fetchManifest
77
#'
88
#' @author Aaron Lun
9-
#'
9+
#'
1010
#' @return List containing the summary for this version, with the following fields:
1111
#' \itemize{
1212
#' \item \code{upload_user_id}, string containing the identity of the uploader.
@@ -15,13 +15,13 @@
1515
#' \item \code{on_probation} (optional), a logical scalar indicating whether the upload is probational.
1616
#' If missing, this can be assumed to be \code{FALSE}.
1717
#' }
18-
#'
18+
#'
1919
#' @examples
2020
#' info <- startGobbler()
2121
#' removeProject("test", info$staging, url=info$url) # start with a clean slate.
2222
#' createProject("test", info$staging, url=info$url)
2323
#'
24-
#' # Mocking up an upload.
24+
#' # Mocking up an upload.
2525
#' src <- allocateUploadDirectory(info$staging)
2626
#' write(file=file.path(src, "foo"), "BAR")
2727
#' uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)
@@ -31,11 +31,11 @@
3131
#'
3232
#' # Force remote access.
3333
#' fetchSummary(
34-
#' "test",
35-
#' "simple",
36-
#' "v1",
37-
#' registry=info$registry,
38-
#' url=info$url,
34+
#' "test",
35+
#' "simple",
36+
#' "v1",
37+
#' registry=info$registry,
38+
#' url=info$url,
3939
#' forceRemote=TRUE
4040
#' )
4141
#' @export

0 commit comments

Comments
 (0)