From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.213.28.69 with SMTP id l5cs35297ebc; Thu, 28 Jan 2010 06:09:35 -0800 (PST) Received: by 10.91.32.1 with SMTP id k1mr442209agj.8.1264687774214; Thu, 28 Jan 2010 06:09:34 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 21si2372180gxk.45.2010.01.28.06.09.33; Thu, 28 Jan 2010 06:09:34 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 911C218582F7; Thu, 28 Jan 2010 09:09:30 -0500 (EST) Received: from mail-iw0-f193.google.com (mail-iw0-f193.google.com [209.85.223.193]) by rubyforge.org (Postfix) with ESMTP id D0F0E18582EF for ; Thu, 28 Jan 2010 09:07:34 -0500 (EST) Received: by iwn33 with SMTP id 33so697404iwn.0 for ; Thu, 28 Jan 2010 06:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:subject:from:to :in-reply-to:references:date:message-id:user-agent :content-transfer-encoding; bh=ZC9YH/fh12QKQpD8HIptf+8D5ayGNkR8PNNNHu2tNxk=; b=IgSx5vOfswNyKpo0Q1BHnTUUxG4wxzjedyrvuEeesd7sR0wy8OIRMTOuZmJcAfg5ME VAONaIiQdwhhGmnmsU4MhyZsO+sG2ynPWvkjv5TkIhc7l6io+yc03u1wCtUkXT5+lbq7 Iy8uyMUHq4SPyOOiymbGnkTjq/eyCeqGqiwVU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:subject:from:to:in-reply-to:references:date:message-id :user-agent:content-transfer-encoding; b=NrwTM3dvlbygOQdMTCsEknvIlCfFmDINFaZk5M+GGrlgDF85qCTw0sXLMba22tkMsR euWrh4snqrym7K9i3wRoYsKtFJAUO4JLf86+CHkx4OK5m55dsXX4f0dmCYYqntuIG4e5 oaqSrr9Nu9hRUO3CJtxfp6LnCkHZYympVDBBY= Received: by 10.231.153.205 with SMTP id l13mr5178680ibw.64.1264687650674; Thu, 28 Jan 2010 06:07:30 -0800 (PST) Received: from localhost (c-76-98-110-216.hsd1.nj.comcast.net [76.98.110.216]) by mx.google.com with ESMTPS id 20sm310550iwn.5.2010.01.28.06.07.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 Jan 2010 06:07:30 -0800 (PST) From: Eric Sherman To: sup-devel In-reply-to: <1264632472.97.0.545373102631.issue54@masanjin.net> References: <1264632472.97.0.545373102631.issue54@masanjin.net> Date: Thu, 28 Jan 2010 09:07:28 -0500 Message-Id: <1264687215-sup-8249@changeling.local> User-Agent: Sup/git Subject: [sup-devel] [PATCHv2] [issue54] log-mode and poll-mode buffers are not killable 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 Oops. Now, with the ability to quit sup. --- lib/sup/buffer.rb | 4 ++-- lib/sup/modes/log-mode.rb | 2 ++ lib/sup/modes/poll-mode.rb | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index 990dd4a..5fb1047 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -414,8 +414,8 @@ EOS def kill_all_buffers_safely until @buffers.empty? - ## inbox mode always claims it's unkillable. we'll ignore it. - return false unless @buffers.last.mode.is_a?(InboxMode) || @buffers.last.mode.killable? + ## inbox, log and poll modes always claim they're unkillable. we'll ignore them. + return false unless @buffers.last.mode.is_a?(InboxMode) || @buffers.last.mode.is_a?(LogMode) || @buffers.last.mode.is_a?(PollMode) || @buffers.last.mode.killable? kill_buffer @buffers.last end true diff --git a/lib/sup/modes/log-mode.rb b/lib/sup/modes/log-mode.rb index de320ce..e583caf 100644 --- a/lib/sup/modes/log-mode.rb +++ b/lib/sup/modes/log-mode.rb @@ -52,6 +52,8 @@ class LogMode < TextMode self.text = "" super end + + def killable?; false; end end end diff --git a/lib/sup/modes/poll-mode.rb b/lib/sup/modes/poll-mode.rb index cf61343..deb22d6 100644 --- a/lib/sup/modes/poll-mode.rb +++ b/lib/sup/modes/poll-mode.rb @@ -14,6 +14,8 @@ class PollMode < LogMode self << "Poll started at #{Time.now}\n" PollManager.do_poll { |s| self << (s + "\n") } end + + def killable?; false; end end end -- 1.6.6 _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel