Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
From: Michael Stapelberg <michael+sup@stapelberg.de>
To: Rich Lane <rlane@club.cc.cmu.edu>
Cc: sup-devel <sup-devel@rubyforge.org>
Subject: Re: [sup-devel] [PATCH] Implement inline GPG
Date: Mon, 01 Mar 2010 14:45:54 +0100	[thread overview]
Message-ID: <1267450467-sup-4411@midna.zekjur.net> (raw)
In-Reply-To: <1267293663-sup-2241@zyrg.net>

Hi Rich,

Excerpts from Rich Lane's message of Sa Feb 27 19:05:58 +0100 2010:
> The problem is sign_start will be nil if the text isn't on a line by
> itself, causing a crash a few lines later. This happened to me when I
How about using the following solution?

gpg_start = "-----BEGIN PGP SIGNED MESSAGE-----"
gpg_end = "-----END PGP SIGNED MESSAGE-----"
gpg = lines.select { |l| true if l =~ /#{gpg_start}/ .. l =~ /#{gpg_end}/ }
msg.body = gpg.join("\n")

Is there a way to avoid the ugly "true if"? When just leaving it out, ruby
complained saying "ArgumentError: bad value for range".

Best regards,
Michael
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


  reply	other threads:[~2010-03-01 13:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18 11:40 Michael Stapelberg
2010-02-26 21:24 ` Rich Lane
2010-02-27 13:11   ` Michael Stapelberg
2010-02-27 18:05     ` Rich Lane
2010-03-01 13:45       ` Michael Stapelberg [this message]
2010-03-01 14:36         ` Christian Dietrich
2010-03-01 16:49           ` Michael Stapelberg
2010-03-01 17:46             ` Christian Dietrich
2010-03-09 16:43               ` [sup-devel] [PATCH] Implement inline GPG (updated) Michael Stapelberg
2010-03-10 21:23                 ` Michael Stapelberg
2010-03-12  4:43                   ` Rich Lane
2010-03-12 11:02                     ` Michael Stapelberg
2010-03-15  5:19                       ` Rich Lane

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=1267450467-sup-4411@midna.zekjur.net \
    --to=michael+sup@stapelberg.de \
    --cc=rlane@club.cc.cmu.edu \
    --cc=sup-devel@rubyforge.org \
    /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