roger-interface {roger} | R Documentation |
R Interface for Roger Command Line Tools
Description
R interfaces to the Roger base system command line tools roger
checkreq
, roger clone
, roger grade
, roger push
,
roger switch
and roger validate
.
Usage
roger_checkreq(file = "./requirements.txt", ...,
.debugOnly = FALSE)
roger_clone(pattern, project, rogerrc_file = NULL, machine = NULL,
curl_options = NULL, api = NULL, quiet = FALSE, ...,
.debugOnly = FALSE)
roger_grade(dir = getwd(), config_file = NULL, time_limit = NULL,
detached_head = FALSE, output_file = NULL,
quiet = FALSE, ..., .debugOnly = FALSE)
roger_push(branch, repos = getwd(), create = FALSE, file = NULL,
add_file = NULL, message = NULL, quiet = FALSE, ...,
.debugOnly = FALSE)
roger_switch(branch, repos = getwd(), quiet = FALSE, ...,
.debugOnly = FALSE)
roger_validate(dir = getwd(), config_file = NULL,
check_local_repos = TRUE, ..., .debugOnly = FALSE)
Arguments
file |
requirements file name for |
pattern |
regular expression pattern. |
project |
name of a Git project containing repositories. |
dir |
character vector of directory names containing projects to
grade or validate; only the first one is used by |
repos |
character vector of Git repository names to publish grading results into. |
branch |
name of the branch in which to publish the grading results (identical for every repository). |
add_file |
character vector of file names to publish along with the grading results. |
api |
character string; name of the REST API used to retrieve the urls of the repositories. |
check_local_repos |
boolean; check the status of the local repository? |
config_file |
name of grading or validation configuration file;
overrides the defaults |
create |
boolean; is |
curl_options |
character vector of command line options to pass
to |
detached_head |
boolean; leave the repositories in a detached head state for further manual grading? |
machine |
URI and context of the Git server. |
message |
character vector of commit messages pasted together to form a single paragraph. |
output_file |
grading results file name; if |
rogerrc_file |
path to the rogerrc file. |
quiet |
boolean; suppress output? |
time_limit |
date and time in ISO 8601 format (YYYY-MM-DD HH:MM:SS) by which to grade a project in a Git repository. |
... |
further arguments passed to |
.debugOnly |
boolean; print the system call only? |
Details
These functions build calls to the Roger base system command line
tools and execute them using system2
.
Command line option values are always quoted with
shQuote
.
Refer to the command line tools documentation for detailed information on the arguments and options.
Value
Character vector containing the standard output and standard error of the command line tools.
Note
The interface functions require that the Roger base system is installed on your machine and in your system path. See the Roger Project download page https://roger-project.gitlab.io/download/.
Examples
## Sample usage for students
## Not run: ## Validate the project in the current directory using the
## configuration file 'validateconf-prototype'.
roger_validate(config_file = "validateconf-prototype")
## End(Not run)
## Sample usage for graders.
## Not run: ## First check the availability of the grading tools.
roger_checkreq()
## Clone all repositories matching the pattern '[0-9]{9}_prototype'
## in the BitBucket project 'a2042-12345'.
roger_clone("[0-9]{9}_prototype", "a2042-12345")
## Grade all directories (repositories) starting with '[0-9]*'
## as of 2020-04-30 23:59:59 using the configuration in file
## 'gradeconf-prototype'; write results in file 'GRADING.txt'
## of each directory; leave repositories in detached head state
## for manual grading of files.
roger_grade("[0-9]*/", config_file = "gradeconf-prototype",
time_limit = "2020-04-30 23:59:59", detached_head = TRUE,
output_file = "GRADING.txt")
## Publish results in every repository in a new branch
## 'grading-results'. No need to specify the grading results file
## name since 'GRADING.txt' is the default in an English locale.
roger_push("grading-results", "[0-9]*/", create = TRUE,
message = c("Here are your grading results"))
## Return all repositories to main branch.
roger_switch("main", "[0-9]*/")
## End(Not run)