From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.86.59.13 with SMTP id h13cs367505fga; Mon, 1 Mar 2010 05:46:12 -0800 (PST) Received: by 10.224.88.204 with SMTP id b12mr2240823qam.232.1267451171284; Mon, 01 Mar 2010 05:46:11 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 8si9681232qwj.35.2010.03.01.05.46.10; Mon, 01 Mar 2010 05:46:11 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 6F23D18582E2; Mon, 1 Mar 2010 08:46:10 -0500 (EST) Received: from twice-irc.de (mx2.twice-irc.de [79.140.35.195]) by rubyforge.org (Postfix) with ESMTP id CC07E185827F for ; Mon, 1 Mar 2010 08:45:55 -0500 (EST) Received: from midna.zekjur.net (midna.zekjur.net [IPv6:2001:4d88:1008:4242:21c:c0ff:fe7e:4776]) by twice-irc.de (Postfix) with ESMTPSA id 3A812166560; Mon, 1 Mar 2010 14:45:55 +0100 (CET) Received: by midna.zekjur.net (Postfix, from userid 101) id A44E6320F0; Mon, 1 Mar 2010 14:45:54 +0100 (CET) From: Michael Stapelberg To: Rich Lane In-reply-to: <1267293663-sup-2241@zyrg.net> References: <1266493070-sup-7733@midna.zekjur.net> <1267219197-sup-2428@zyrg.net> <1267276103-sup-6406@midna.zekjur.net> <1267293663-sup-2241@zyrg.net> Date: Mon, 01 Mar 2010 14:45:54 +0100 Message-Id: <1267450467-sup-4411@midna.zekjur.net> User-Agent: Sup/git Cc: sup-devel Subject: Re: [sup-devel] [PATCH] Implement inline GPG X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org 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