Skip to content

Commit

Permalink
updated to verbose options
Browse files Browse the repository at this point in the history
  • Loading branch information
muschellij2 committed Jun 23, 2017
1 parent f326f68 commit c22ae7f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ghtravis
Type: Package
Title: Interfaces with GitHub API and Travis
Version: 0.5.3
Version: 0.5.4
Author: John Muschelli
Maintainer: John Muschelli <muschellij2@gmail.com>
Description: Interfaces and compares things on 'GitHub'
Expand Down
20 changes: 19 additions & 1 deletion R/binary_release_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#'
#' @param repo Remote repository name
#' @param pat GitHub Personal Authentication Token (PAT)
#' @param verbose print diagnostic messages
#'
#' @param ... additional arguments to \code{\link[httr]{GET}}
#' @return \code{data.frame} of binary releases
#' @export
Expand All @@ -16,6 +18,7 @@
binary_release_table = function(
repo,
pat = NULL,
verbose = TRUE,
...){

xrepo = repo
Expand All @@ -41,8 +44,16 @@ binary_release_table = function(
tag_content = as.data.frame(tag_content, stringsAsFactors = FALSE)
# return(NA) # there should be no releases, but there may be somehow?
}
if (verbose) {
message("tag_content is ")
print(tag_content)
}

df = binary_table_no_tags(repo = xrepo, pat = pat, ...)
if (verbose) {
message("binary_table_no_tags is ")
print(df)
}
if (all(is.na(df))) {
return(NA)
}
Expand All @@ -55,7 +66,10 @@ binary_release_table = function(

# df = merge(tag_content, df, by = "tag_name", all.x = TRUE)
df = merge(tag_content, df, by = "tag_name", all = TRUE)

if (verbose) {
message("merged data is is ")
print(df)
}
make_time = function(times) {
strptime(times, format = "%Y-%m-%dT%H:%M:%SZ")
}
Expand All @@ -67,6 +81,10 @@ binary_release_table = function(
ord = order(df$asset_created_at, df$asset_updated_at, decreasing = TRUE)
df = df[ord, ]

if (verbose) {
message("sorted data is is ")
print(df)
}
return(df)
}

Expand Down
2 changes: 1 addition & 1 deletion R/latest_release_with_binary.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ latest_release_with_binary = function(repo,
verbose = TRUE,
...){

df = binary_release_table(repo = repo, pat = pat, ...)
df = binary_release_table(repo = repo, pat = pat, verbose = verbose, ...)
if (is.null(nrow(df))) {
return(NA)
}
Expand Down
4 changes: 3 additions & 1 deletion man/binary_release_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c22ae7f

Please sign in to comment.