datawookie / emayili
Showing 1 of 5 files from the diff.

@@ -20,13 +20,13 @@
Loading
20 20
#' msg %>% encrypt()
21 21
#' }
22 22
encrypt <- function(msg, encrypt = TRUE, sign = TRUE, public_key = TRUE) {
23 -
  encrypt <- ifelse(is.null(encrypt), FALSE, encrypt)
23 +
  encrypt <- ifelse(is.null(encrypt), FALSE, encrypt)           # nocov start
24 24
  sign <- ifelse(is.null(sign), FALSE, sign)
25 25
  stopifnot(is.logical(encrypt) && is.logical(sign))
26 26
27 27
  msg$encrypt <- encrypt
28 28
  msg$sign <- sign
29 -
  msg$public_key <- public_key
29 +
  msg$public_key <- public_key                                  # nocov end
30 30
31 31
  if (get_option_invisible()) invisible(msg) else msg # nocov
32 32
}
@@ -41,7 +41,7 @@
Loading
41 41
42 42
  if (encrypt || sign || public_key) {
43 43
    if(!requireNamespace("gpg", quietly = TRUE)) {
44 -
      stop("Install {gpg} to encrypt and/or sign messages.")
44 +
      stop("Install {gpg} to encrypt and/or sign messages.")    # nocov
45 45
    }
46 46
    log_debug("Encrypt message: {encrypt}")
47 47
    log_debug("Sign message:    {sign}")
@@ -55,10 +55,10 @@
Loading
55 55
56 56
    keys <- gpg::gpg_list_keys()
57 57
58 -
    missing_keys <- anti_join(recipients, keys, by = "email")
58 +
    missing_keys <- anti_join(parties, keys, by = "email")
59 59
60 60
    if (nrow(missing_keys)) {
61 -
      stop("Missing public keys for the follow addresses: ", paste(missing_keys$email, collapse = ", "), ".")
61 +
      stop("Missing keys for the follow addresses: ", paste(missing_keys$email, collapse = ", "), ".")
62 62
    }
63 63
64 64
    # Get the fingerprints of the senders' keys.
@@ -77,10 +77,15 @@
Loading
77 77
78 78
    if (sign || public_key) {
79 79
      if (!("multipart_mixed" %in% class(content))) {
80 -
        log_debug("Convert message to multipart/mixed.")
81 -
        content <- multipart_mixed(
82 -
          children = list(content)
83 -
        )
80 +
        if (is.null(content)) {
81 +
          log_debug("Create empty multipart/mixed.")
82 +
          content <- multipart_mixed()
83 +
        } else {
84 +
          log_debug("Convert message to multipart/mixed.")
85 +
          content <- multipart_mixed(
86 +
            children = list(content)
87 +
          )
88 +
        }
84 89
      }
85 90
    }
86 91
Files Coverage
R 99.26%
Project Totals (20 files) 99.26%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading