]> git.cworth.org Git - sup/blobdiff - bin/sup-dump
refactor index access into three methods and rewrite PollManager#each_message_from
[sup] / bin / sup-dump
index 29f6d6ee7cb3ad4a3d95e3a381c77feca7b053a6..992fd0bb74cd0aa7da29729ae38b460d0aad8bc8 100755 (executable)
@@ -22,10 +22,9 @@ EOS
 end
 
 index = Redwood::Index.new
+Redwood::SourceManager.new
 index.load
 
-(1 ... index.index.reader.max_doc).each do |i|
-  next if index.index.deleted? i
-  d = index.index[i]
-  puts [d[:message_id], "(" + d[:label] + ")"] * " "
+index.each_message :load_spam => true, :load_deleted => true, :load_killed => true do |m|
+  puts "#{m.id} (#{m.labels.to_a * ' '})"
 end