Repository {PaRe} | R Documentation |
Class representing the Repository
new()
Initializer for Repository class
Repository$new(path)
path
(character)
Path to R package project
invisible(self)
getName()
Get method for name.
Repository$getName()
(character)
Repository name
getPath()
Get method fro path
Repository$getPath()
(character)
Path to Repository folder
getFiles()
Get method to get a list of File objects.
Repository$getFiles()
getRFiles()
Get method to get only R-files.
Repository$getRFiles()
getDescription()
Get method to get the description of the package. See: description.
Repository$getDescription()
(description)
Description object.
getFunctionUse()
Get method for functionUse, will check if functionUse has already been fetched or not.
Repository$getFunctionUse()
(data.frame)
See getFunctionUse.
gitCheckout()
Method to run 'git checkout <branch/commit hash>'
Repository$gitCheckout(branch, ...)
invisible(self)
gitPull()
Method to run 'git pull'
Repository$gitPull(...)
...
Further parameters for pull.
invisible(self)
gitBlame()
Method to fetch data generated by 'git blame'.
Repository$gitBlame()
(tibble)
column | data type |
repository | character |
author | character |
file | character |
date | character |
lines | integer |
clone()
The objects of this class are cloneable with this method.
Repository$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other Representations:
Code
,
File
,
Function
fetchedRepo <- tryCatch(
{
# Set dir to clone repository to.
tempDir <- tempdir()
pathToRepo <- file.path(tempDir, "glue")
# Clone repo
git2r::clone(
url = "https://github.com/tidyverse/glue.git",
local_path = pathToRepo
)
# Create instance of Repository object.
repo <- PaRe::Repository$new(path = pathToRepo)
# Set fetchedRepo to TRUE if all goes well.
TRUE
},
error = function(e) {
# Set fetchedRepo to FALSE if an error is encountered.
FALSE
},
warning = function(w) {
# Set fetchedRepo to FALSE if a warning is encountered.
FALSE
}
)
if (fetchedRepo) {
repo
}