From 9b8b45147d1f4302aef8f29beee5ab55c942a023 Mon Sep 17 00:00:00 2001 From: Maciej Banas Date: Fri, 6 Dec 2024 12:55:13 +0000 Subject: [PATCH] Make possible passing all parameters to GitStats::set_*_host(). --- DESCRIPTION | 2 +- R/set_repos.R | 24 ++++++++++-------------- man/set_github_repos.Rd | 11 +++++------ man/set_gitlab_repos.Rd | 7 +++---- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 438bc9c..42c5432 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: GitAI Title: Extracts Knowledge From Git Repositories -Version: 0.0.0.9009 +Version: 0.0.0.9010 Authors@R: c( person("Kamil", "Wais", , "kamil.wais@gmail.com", role = c("aut", "cre")), person("Krystian", "Igras", , "krystian8207@gmail.com", role = "aut"), diff --git a/R/set_repos.R b/R/set_repos.R index a5bb485..7b894de 100644 --- a/R/set_repos.R +++ b/R/set_repos.R @@ -1,15 +1,14 @@ #' Set GitHub repositories in `GitAI` object. #' @name set_github_repos #' @param gitai A \code{GitAI} object. -#' @param host A character, GitHub host. -#' @param repos A character vector or repositories full names. -#' @param verbose A logical. If \code{FALSE} you won't be getting -#' additional diagnostic messages. +#' @param ... Parameters to pass to \code{\link[GitStats]{set_github_host}} +#' function. +#' @param verbose A logical. If \code{FALSE} you won't be getting additional +#' diagnostic messages. #' @return A \code{GitAI} object. #' @export set_github_repos <- function(gitai, - host = NULL, - repos, + ... = ..., verbose = is_verbose()) { if (is.null(gitai$gitstats)) { gitstats <- GitStats::create_gitstats() @@ -18,8 +17,7 @@ set_github_repos <- function(gitai, } gitai$gitstats <- gitstats |> GitStats::set_github_host( - host = host, - repos = repos, + ... = ..., verbose = verbose ) invisible(gitai) @@ -28,15 +26,14 @@ set_github_repos <- function(gitai, #' Set GitLab repositories in `GitAI` object. #' @name set_gitlab_repos #' @param gitai A \code{GitAI} object. -#' @param host A character, GitLab host. -#' @param repos A character vector or repositories full names. +#' @param ... Parameters to pass to \code{\link[GitStats]{set_gitlab_host}} +#' function. #' @param verbose A logical. If \code{FALSE} you won't be getting #' additional diagnostic messages. #' @return A \code{GitAI} object. #' @export set_gitlab_repos <- function(gitai, - host = NULL, - repos, + ... = ..., verbose = is_verbose()) { if (is.null(gitai$gitstats)) { gitstats <- GitStats::create_gitstats() @@ -45,8 +42,7 @@ set_gitlab_repos <- function(gitai, } gitai$gitstats <- gitstats |> GitStats::set_gitlab_host( - host = host, - repos = repos, + ... = ..., verbose = verbose ) invisible(gitai) diff --git a/man/set_github_repos.Rd b/man/set_github_repos.Rd index 2ba85b2..ea6e0bd 100644 --- a/man/set_github_repos.Rd +++ b/man/set_github_repos.Rd @@ -4,17 +4,16 @@ \alias{set_github_repos} \title{Set GitHub repositories in \code{GitAI} object.} \usage{ -set_github_repos(gitai, host = NULL, repos, verbose = is_verbose()) +set_github_repos(gitai, ... = ..., verbose = is_verbose()) } \arguments{ \item{gitai}{A \code{GitAI} object.} -\item{host}{A character, GitHub host.} +\item{...}{Parameters to pass to \code{\link[GitStats]{set_github_host}} +function.} -\item{repos}{A character vector or repositories full names.} - -\item{verbose}{A logical. If \code{FALSE} you won't be getting -additional diagnostic messages.} +\item{verbose}{A logical. If \code{FALSE} you won't be getting additional +diagnostic messages.} } \value{ A \code{GitAI} object. diff --git a/man/set_gitlab_repos.Rd b/man/set_gitlab_repos.Rd index 1ddaa7c..d121151 100644 --- a/man/set_gitlab_repos.Rd +++ b/man/set_gitlab_repos.Rd @@ -4,14 +4,13 @@ \alias{set_gitlab_repos} \title{Set GitLab repositories in \code{GitAI} object.} \usage{ -set_gitlab_repos(gitai, host = NULL, repos, verbose = is_verbose()) +set_gitlab_repos(gitai, ... = ..., verbose = is_verbose()) } \arguments{ \item{gitai}{A \code{GitAI} object.} -\item{host}{A character, GitLab host.} - -\item{repos}{A character vector or repositories full names.} +\item{...}{Parameters to pass to \code{\link[GitStats]{set_gitlab_host}} +function.} \item{verbose}{A logical. If \code{FALSE} you won't be getting additional diagnostic messages.}