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
Redwood::start
-puts "loading index..."
index = Redwood::Index.new
index.load
-puts "loaded index of #{index.size} messages"
h = HighLine.new
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
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
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
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