Skip to content

Commit

Permalink
add internal fn docs; closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Feb 7, 2024
1 parent 3e57378 commit d6da95b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dashboard
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.009
Version: 0.0.0.010
Authors@R:
person(given = "First",
family = "Last",
Expand Down
3 changes: 2 additions & 1 deletion R/dashboard-fn.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#' Apply the query above to extract data from GitHub GraphQL API, and
#' post-process into a `data.frame`.
#'
#' @param open_only Include only open issues?
#' @return (Invisibly) A `data.frame` with one row per issue and some key
#' statistics.
#' @noRd
Expand All @@ -21,7 +22,7 @@ dashboard_gh_data <- function (open_only = TRUE) {

while (has_next_page) {

q <- get_issues_qry (
q <- gh_issues_qry (
org = "ropensci",
repo = "software-review",
open_only = open_only,
Expand Down
17 changes: 13 additions & 4 deletions R/gh-query.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ get_gh_token <- function (token = "") {
)
}

get_issues_qry <- function (org = "ropensci",
repo = "software-review",
open_only = TRUE,
end_cursor = NULL) {
#' The GitHub GraphQL query.
#'
#' @param org The GitHub organization.
#' @param repo The GitHub repository.
#' @param open_only Include only open issues?
#' @param end_cursor The end cursor from the previous query.
#'
#' @return The GraphQL query to pass to a `gh::gh_gql()` call.
#' @noRd
gh_issues_qry <- function (org = "ropensci",
repo = "software-review",
open_only = TRUE,
end_cursor = NULL) {

after_txt <- ""
if (!is.null (end_cursor)) {
Expand Down
9 changes: 9 additions & 0 deletions R/gt-table.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#' Open a \pkg{gt} table in the default browser.
#'
#' This function is called internally from the \code{\link{dashboard}} function
#' if the `browse` argument is set to `TRUE`.
#'
#' @param dat The `data.frame` returned from the \code{\link{dashboard}} function.
#' @return Nothing; function called for side-effect only of opening \pkg{gt} table.
#'
#' @noRd
open_gt_table <- function (dat) {

# Suppress no visible binding notes:
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "dashboard: What the Package Does (One Line, Title Case)",
"codeRepository": "https://github.com/ropensci-review-tools/dashboard",
"license": "https://spdx.org/licenses/MIT",
"version": "0.0.0.009",
"version": "0.0.0.010",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit d6da95b

Please sign in to comment.