]> git.cworth.org Git - sup/commitdiff
fixed bug in label assignment for new messages and cleaned up logging messages
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 31 Dec 2006 14:20:33 +0000 (14:20 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 31 Dec 2006 14:20:33 +0000 (14:20 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@132 5c8cc53c-5e98-4d25-b20a-d8db53a31250

bin/sup
bin/sup-import
lib/sup/imap.rb
lib/sup/index.rb
lib/sup/mbox/loader.rb
lib/sup/util.rb

diff --git a/bin/sup b/bin/sup
index 5348437f332857d2f30e8b4c35f5946ed626dce4..f4fafb9fc96cb52524ffb67a4cc97876a3d2fa7c 100644 (file)
--- a/bin/sup
+++ b/bin/sup
@@ -54,9 +54,7 @@ end
 module_function :start_cursing, :stop_cursing
 
 Redwood::start
-
 Index.new.load
-log "loaded #{Index.size} messages from index"
 
 if(s = Index.source_for DraftManager.source_name)
   DraftManager.source = s
index 3027e19a5d85482bf12aeb795e8e4fd567e2c4b8..bbf7e891d6b8846ec84ed49ab9e5ee8039ec81da 100644 (file)
@@ -83,10 +83,8 @@ end
 
 Redwood::start
 
-puts "loading index..."
 index = Redwood::Index.new
 index.load
-puts "loaded index of #{index.size} messages"
 
 h = HighLine.new
 
index ac3082a4927d46c8fd45c5967cd0c8391c532ef1..e388577b8d6bac42c656f48c29cab76375ba1f23 100644 (file)
@@ -5,7 +5,7 @@ require 'stringio'
 module Redwood
 
 class IMAP < Source
-  attr_reader :labels
+  attr_reader_cloned :labels
   
   def initialize uri, username, password, uid_validity=nil, last_uid=nil, usual=true, archived=false, id=nil
     raise ArgumentError, "username and password must be specified" unless username && password
index 4002c7dd9c19b602953b9cec3031ec844f36f69d..3de011e9e4be2fcfcc6825b625351dcb9bdcab67 100644 (file)
@@ -60,10 +60,11 @@ class Index
 
   def load_index dir=File.join(@dir, "ferret")
     if File.exists? dir
-      Redwood::log "loading index"
+      Redwood::log "loading index..."
       @index = Ferret::Index::Index.new(:path => dir, :analyzer => @analyzer)
+      Redwood::log "loaded index of #{@index.size} messages"
     else
-      Redwood::log "creating index"
+      Redwood::log "creating index..."
       field_infos = Ferret::Index::FieldInfos.new :store => :yes
       field_infos.add_field :message_id
       field_infos.add_field :source_id
index 20ba1bd5b55b2183adb526039a64df139b678fd3..d46ce8fcd765f2638dce3d8adda4f0ca160475c7 100644 (file)
@@ -4,7 +4,7 @@ module Redwood
 module MBox
 
 class Loader < Source
-  attr_reader :labels
+  attr_reader_cloned :labels
 
   def initialize uri_or_fp, start_offset=nil, usual=true, archived=false, id=nil
     super
index 77209bf8033f5b5c0e445f442b12e62f18c35a39..35c087a7e5256ff318d34b7b642cbad3638f3bc9 100644 (file)
@@ -7,6 +7,10 @@ class Module
     bool_reader(*args)
     bool_writer(*args)
   end
+
+  def attr_reader_cloned *args
+    args.each { |sym| class_eval %{ def #{sym}; @#{sym}.clone; end } }
+  end
 end
 
 class Object