[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-devel] [PATCH] Implement inline GPG



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