From f6647b188d02b479b7b8806f4647922eb388e7ba Mon Sep 17 00:00:00 2001 From: wmorgan Date: Sat, 24 Nov 2007 18:39:27 +0000 Subject: [PATCH] better source error reporting, and better message loading git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@715 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup.rb | 9 +++++++-- lib/sup/modes/thread-index-mode.rb | 5 +++-- lib/sup/poll.rb | 4 ++-- lib/sup/util.rb | 12 +++++++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/sup.rb b/lib/sup.rb index 83ed101..ac242ec 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -124,8 +124,10 @@ module Redwood return unless BufferManager.instantiated? broken_sources = Index.usual_sources.select { |s| s.error.is_a? FatalSourceError } + File.open("goat", "w") { |f| f.puts Kernel.caller } unless broken_sources.empty? - BufferManager.spawn "Broken source notification", TextMode.new(< 1 + BufferManager.say "#{message} (#{i}/#{num})", sid if t.size > 1 m.load_from_source! end end diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb index 5aed29b..21464b4 100644 --- a/lib/sup/poll.rb +++ b/lib/sup/poll.rb @@ -87,7 +87,7 @@ EOS yield "Loading from #{source}... " unless source.done? || source.has_errors? rescue SourceError => e Redwood::log "problem getting messages from #{source}: #{e.message}" - Redwood::report_broken_sources + Redwood::report_broken_sources :force_to_top => true next end @@ -163,7 +163,7 @@ EOS end rescue SourceError => e Redwood::log "problem getting messages from #{source}: #{e.message}" - Redwood::report_broken_sources + Redwood::report_broken_sources :force_to_top => true end end end diff --git a/lib/sup/util.rb b/lib/sup/util.rb index baf4c50..b2a0a4d 100644 --- a/lib/sup/util.rb +++ b/lib/sup/util.rb @@ -310,8 +310,18 @@ class Fixnum end end + ## hacking the english language def pluralize s - to_s + " " + (self == 1 ? s : s + "s") + to_s + " " + + if self == 1 + s + else + if s =~ /(.*)y$/ + $1 + "ies" + else + s + "s" + end + end end end -- 2.43.0