Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: mzulak@gmail.com (Matt Zulak)
Subject: [sup-talk] [PATCH] decrypt returns 3 elem array if gpg is unavailable
Date: Thu,  3 Sep 2009 12:38:53 -0400	[thread overview]
Message-ID: <1251995933-2252-1-git-send-email-mzulak@gmail.com> (raw)

CryptoManager's decrypt method returns a CryptoNotice if the GPG binary
can't be found on the path; however, the Message class expects a 3
element array with either a RMail::Message or nil at index 0.
This patch ensures sup plays nice when importing encrypted messages from
a mail-store on an environment that does not have GPG.
---
 lib/sup/crypto.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 7f044b9..afbc445 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -105,7 +105,7 @@ class CryptoManager
 
   ## returns decrypted_message, status, desc, lines
   def decrypt payload # a RubyMail::Message object
-    return unknown_status(cant_find_binary) unless @cmd
+    return [nil, nil, unknown_status(cant_find_binary)] unless @cmd
 
     payload_fn = Tempfile.new "redwood.payload"
     payload_fn.write payload.to_s
-- 
1.6.2.1



             reply	other threads:[~2009-09-03 16:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 16:38 Matt Zulak [this message]
2009-09-04 14:34 ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251995933-2252-1-git-send-email-mzulak@gmail.com \
    --to=mzulak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox